Alepha is a full-stack TypeScript framework built for the agentic era.
Everything between your code and the runtime β HTTP server, routing, auth, queues, storage, jobs, SSR β is rewritten clean and integrated for Node, Bun, and Cloudflare Workers. Two load-bearing layers are deliberately not reinvented: React for UI and Drizzle for SQL. No library glue, no config sprawl: one small, consistent surface of typed primitives.
That small surface is the point. AI coding agents (Claude Code, Codex) work best against a narrow, predictable API β so they generate predictable, consistent code you can actually review.
- One schema, everywhere β Database, API validation, TypeScript types, React forms β all from one definition
- One surface β Every feature is a typed
$primitive. No third-party glue to wire up or keep in sync - Multi-runtime β Same code runs on Node, Bun, and Cloudflare Workers
- Deploy anywhere β Cloudflare, Vercel, Docker, bare metal
Each layer builds on the previous β use only what you need.
| Layer | Description | Primitives |
|---|---|---|
| Foundation | DI, lifecycle, config | $inject, $env, $module, $hook, $logger |
| Backend | Database, queues, storage, API | $entity, $action, $queue, $bucket, $scheduler |
| Frontend | React with SSR, routing, i18n | $page, $head, $atom, $dictionary |
| Platform | Users, auth, jobs, audits | $realm, $job, $audit, $notification |
Every feature is one typed $primitive β no decorators, no file-system magic, no runtime metadata. An agent reading the code sees exactly what it does, in one place.
For UI, Alepha keeps React as the coding interface β agents write standard React components, the most familiar surface in their training data, with no framework-specific dialect to get wrong. For SQL it builds on Drizzle, but wraps it completely: you write one typed $entity schema and a $repository, never Drizzle itself. One is a proven interface agents already know; the other is a proven engine they never have to think about.
The smaller and more consistent the surface, the more reliably an agent generates correct code against it. Point your AI assistant at alepha.dev/llms.txt for the full machine-readable API.
Define an API, call it from a React page β typed end-to-end, no codegen, no glue.
// src/Api.ts
import { t } from "alepha";
import { $action } from "alepha/server";
import { $entity, $repository, db } from "alepha/orm";
const viewEntity = $entity({
name: "views",
schema: t.object({
id: db.primaryKey(),
createdAt: db.createdAt(),
}),
});
export class Api {
views = $repository(viewEntity);
inc = $action({
schema: { // β validates + generates OpenAPI
response: t.object({
count: t.number()
})
},
handler: async () => {
await this.views.create({});
return { count: await this.views.count() };
},
});
}// src/AppRouter.tsx
import { $client } from "alepha/server/links";
import { $page } from "alepha/react/router";
import type { Api } from "./Api.ts";
export class AppRouter {
api = $client<Api>(); // β fully typed, zero codegen
home = $page({
loader: () => this.api.inc(),
component: (props) => <div>Counter: {props.count}</div>,
});
}The Api class is the only contract. $client<Api>() derives every call site from it β change a handler's return type and the page stops compiling.
Requirements: Node.js 22+ or Bun 1.3+
npx alepha init my-api --api # REST API
npx alepha init my-app --react # React app (SSR)
npx alepha init my-saas --saas # API + React + auth + admin panel- Documentation
- llms.txt β for AI assistants
- GitHub