Avelon
A TypeScript framework for Next.js apps. Each kind of code has one home, generators write it there, and a linter fails the build when a file crosses a boundary.
bunx --package @avelonjs/cli reeve new my-app
cd my-app && bun install && bun run devEach kind of code has one home
One command writes a resource into the directory map, so the next developer finds every piece where the last one put it.
bunx --no-install reeve make:model Post -mfcp --resource- app/
Models/ Post.ts - the model
- app/
Wards/ PostWard.ts - which rows each actor may reach
- app/
Policies/ PostPolicy.ts - which actions each actor may take
- app/
Http/ Controllers/ PostController.ts - the seven resource actions
- app/
Http/ Requests/ PostRequest.ts - input validation for each write
- resources/
views/ pages/ posts.tsx - the pages the controller renders
- database/
migrations/ …_create_posts_table.ts - the table
- app/
Providers/ AppProvider.ts - registers the ward and the policy
A write, end to end
The route names the controller action.
The action validates through a Request before anything reaches the model. Bailiff fails a write that skips it.
The ward is added to every query on the table, so another user’s rows stay out of reach even when a query forgets its where clause.
// routes/web.ts
Route.resource('posts', PostController)
// app/Http/Controllers/PostController.ts
export class PostController {
async store(request: HttpRequest) {
const input = await PostRequest.validate(request)
await Post.create({ id: crypto.randomUUID(), ...input })
return redirect(route('posts.index'), 303)
}
}
// app/Wards/PostWard.ts
export const PostWard: WardAbilities = {
read: () => true,
insert: (actor) => actor !== null,
update: (actor) => (actor ? { user_id: actor.id } : false),
delete: (actor) => (actor ? { user_id: actor.id } : false),
}What keeps it that way
Generators write it
reeve writes each file where the map says it goes and registers what needs registering. Every generated file passes the app’s bun run check.
CLI guideBailiff holds the shape
An ESLint plugin fails the build when a view imports a model, a write skips validation, or a model has no ward.
Linting guideDrivers keep vendors swappable
Postgres, Neon, Supabase, and Resend sit behind one contract per service. A method the configured driver lacks is a compile error.
Drivers guideWards scope every query
Row access is declared once in TypeScript. Every model query on the table carries it, so a missing where clause cannot leak rows.
Authorization guide
Look up a name
Each row maps a job to the Avelon name, path, or command you reach for.
CLI
18 names
reevereeve new my-appreeve tinkerreeve aboutreeve doctorreeve route:listreeve migratereeve db:seedreeve ward:explain Postreeve event:listreeve stub:publishreeve make:model -mfcp --resourcereeve make:controller --resourcereeve make:requestreeve make:policyreeve make:errandreeve make:listener --event= --queuedreeve make:authHTTP
11 names
routes/web.tsRoute.resource.bind('post', 'Post')app/Http/Controllersapp/Http/Requestsapp/Http/Middlewareapp/Http/Viewsview(ref, props)route(name, params)url(name, params)generated server actionsData
14 names
Scrivener (@avelonjs/orm)Query IRdatabase.transaction()WardssoftDeletesstatic fillablestatic castswith() → RelationLoadpaginate()findOrFailModelLifecycle eventsdriver-owned migrationsassay defineFactorydatabase/seedsAuth and authorization
7 names
PoliciesGateWardsidentity driver + reeve make:authsocial drivertokens driver (Signet)Gate.actor()Async work
8 names
Errandsdelivery: 'queued'reeve errand:workreeve errand:failedEvents / ListenersNotices + notifications driver@avelonjs/resendVigilFrontend and runtime
7 names
RSC via @avelonjs/nextNext bundlerTailwind 4storage drivercache contract + fakerealtime contract + fakebun + next devTooling and packaging
15 names
bun / npm @avelonjsPrettierbun test + Assaytsc strictBailifftyped registry + providersapp/Providers/AppProvider.tscapability-narrowed facadesavelon.config.tsHearthMootreeve doctorflags contract + fakesearch contract + fakepayments contract + fake