Use Drizzle adapter and Drizzle CLI auth migrations

This commit is contained in:
2026-02-24 16:21:03 -05:00
parent 11eeafafef
commit 0ab464f910
10 changed files with 1133 additions and 110 deletions

View File

@@ -9,7 +9,7 @@ Turbopack-first rebuild of a fiscal.ai-style terminal with OpenClaw integration.
- Elysia route layer mounted in Next Route Handlers
- Turbopack for `dev` and `build`
- Better Auth (email/password, magic link, admin, organization plugins)
- PostgreSQL adapter for Better Auth
- Drizzle ORM (PostgreSQL) + Better Auth Drizzle adapter
- Internal API routes via Elysia catch-all (`app/api/[[...slugs]]/route.ts`)
- Durable local task engine and JSON data store
- OpenClaw/ZeroClaw analysis via OpenAI-compatible chat endpoint
@@ -24,11 +24,17 @@ bun run dev
Open [http://localhost:3000](http://localhost:3000).
Better Auth requires PostgreSQL. Set `DATABASE_URL`, `BETTER_AUTH_SECRET`, and `BETTER_AUTH_BASE_URL` in `.env.local`.
Auth tables are migrated automatically on first authenticated request.
Generate and apply auth schema migrations before starting the app:
```bash
bun run db:generate
bun run db:migrate
```
## Production build
```bash
bun run db:migrate
bun run build
bun run start
```