feat(backend): add BetterAuth email/password authentication

- Add PostgreSQL connection (src/db.ts)
- Configure BetterAuth with email/password (src/auth/index.ts)
- Add session middleware for route protection (src/auth/session-middleware.ts)
- Add registerAuthHandlers for mounting auth routes (src/auth/http.ts)
- Rename index.ts to server.ts
- Add .env.example with required environment variables

Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
2026-01-25 16:21:00 +00:00
parent fffcccc227
commit c10c8a553a
9 changed files with 128 additions and 9 deletions

View File

@@ -0,0 +1,14 @@
import { Hono } from "hono"
import { registerAuthHandlers } from "./auth/http.ts"
const app = new Hono()
app.get("/health", (c) => c.json({ status: "ok" }))
registerAuthHandlers(app)
export default {
port: 3000,
fetch: app.fetch,
}