Modules
Caravela — a schema-driven, composable full-stack framework for Phoenix.
Compile-time hook that assembles and validates a domain IR.
DSL entry point. use Caravela.Domain in a module to declare a domain
Top-level entry point for the ephemeral async-workflow system.
DSL macros for declaring flows. Pulled in via use Caravela.Flow.
GenServer that executes a flow step tree one step at a time.
Step primitives that make up a flow tree.
Wait for ms of state-stability, then advance.
Iterate a collection already in state under key. For every item,
invoke fun.(item, state). The fun may return
Invoke tasks_fn.(state) to build a list of zero-arity funs, run
them all concurrently, and collect each one's return under the
collect_as key in state.
Run every fun in tasks concurrently, take the first to return.
The winner is stored under the collect_as key.
Loop step forever. Break by raising or via {:error, _} from Run.
Run fun.(state) once. The return value drives what happens next
Run steps in order.
Synchronously apply fun.(state) → new state.
Pause for ms milliseconds, then advance.
Block until fun.(state) returns truthy, then advance.
DynamicSupervisor for flow runner processes.
Generates a Phoenix context module for a Caravela.Schema.Domain.
Generates one Phoenix JSON controller per entity in a
Caravela.Schema.Domain.
Preserves user-authored code across regenerations.
Generates one Ecto schema module per entity from a compiled
Caravela.Schema.Domain.
Generates Absinthe types, queries, and mutations from a
Caravela.Schema.Domain.
Renders the live router snippet for a Caravela domain's generated
LiveViews, analogous to Caravela.Gen.RouterScope for the JSON API.
Generates Phoenix LiveView modules that mount Svelte components via LiveSvelte.
Generates a single Ecto migration file for every entity in a
Caravela.Schema.Domain.
Renders the router scope snippet a developer needs to paste into
their lib/<app>_web/router.ex after generating controllers.
Generates typed Svelte components and a TypeScript interfaces file
from a Caravela.Schema.Domain.
Generates a dynamic Svelte form component from a module that declares
use Caravela.Live.Form. The emitted component receives
field_visibility and async_errors as props and wraps visibility-
gated fields in {#if field_visibility.<name>} blocks.
DSL for declaring a server-side state machine that a LiveView can mount
via Caravela.Live.Template. Mirrors the Ballerina "domain logic"
layer: state fields, named updaters that transition the state, and
event handlers that run on messages pushed from the Svelte side.
DSL for declaring form-visibility predicates and async-validation
rules on top of Caravela.Live.Domain.
use macro that binds a Phoenix LiveView to a Caravela.Live.Domain
module.
Composable state updater functions for LiveView assigns.
Naming conventions translating domain declarations into Elixir module names, file paths, and Postgres table names.
Internal Intermediate Representation (IR) for a Caravela domain.
A whole domain: the top-level IR produced by compilation.
A domain entity (table).
A single field on an entity.
A lifecycle hook declared in the DSL via on_create, on_update, or
on_delete.
An authorization rule declared via can_read, can_create,
can_update, or can_delete.
A relation between two entities.
Row-level multi-tenancy support.
Type mapping between the Caravela DSL, Ecto, and Postgres.
Mix Tasks
All-in-one generator. Produces
Generates one Phoenix JSON controller per entity in the domain and
prints a router scope snippet the developer can paste into
lib/<app>_web/router.ex.
Generates a Phoenix context module for the given domain, with CRUD
functions for every entity, authorization via can_* permissions,
and lifecycle hooks via on_*.
Generates an Absinthe schema layer for the given domain: one file each for object types, queries, and mutations. All three delegate to the generated context module, so authorization, hooks, and multi-tenant scoping flow through the Absinthe resolvers for free.
Generates the frontend layer for a Caravela domain: a trio of LiveView modules (index/show/form) per entity, plus typed Svelte components and a TypeScript interfaces file.
Generates Ecto schemas and a migration file from a Caravela domain declaration.