Caravela
Declare your domain. Sail with the generated code.
A schema-driven, composable full-stack framework for Phoenix projects. Describe a domain (entities, fields, relations, hooks, permissions) as an Elixir DSL; Caravela generates Ecto schemas, migrations, Phoenix contexts, JSON controllers, Absinthe schemas, and LiveView + typed Svelte components.
defmodule MyApp.Domains.Library do
use Caravela.Domain, multi_tenant: true
version "v1"
entity :books do
field :title, :string, required: true, min_length: 3
field :published, :boolean, default: false
end
can_create :books, fn ctx -> ctx.current_user.role in [:admin, :editor] end
endmix caravela.gen MyApp.Domains.Library
mix caravela.gen.live MyApp.Domains.LibraryInstall
{:caravela, "~> 0.4.0"}Documentation
Full guides live under docs/ and ship with the Hex package.
- Getting started
- DSL reference
- Generators
- Multi-tenancy
- API versioning
- GraphQL with Absinthe
- LiveSvelte frontend
- Live runtime (
Caravela.Live.*) - Regeneration & the CUSTOM marker
Run mix docs to build the full API reference locally (HexDocs-style).
Status
Phases 1–4 are in place: DSL + compiler, Ecto schemas + migrations,
hooks + permissions, Phoenix contexts, JSON API, Absinthe/GraphQL,
multi-tenancy, API versioning, LiveSvelte generation, and the
Caravela.Live.* runtime. A GenServer-backed flow runtime for
composable async workflows lands next.
License
MPL-2.0 — see LICENSE and NOTICE.
Use Caravela freely, including in closed-source apps. Modifications to Caravela source files must stay under MPL-2.0 with attribution.
Support the project
Caravela is built in the open and free to use. Donation channels will be linked here once set up. PRs, bug reports, and kind words all help keep the sails full.