Backend changes: - Add better-auth and pg packages - Create Better Auth instance with PostgreSQL adapter - Add Better Auth route handler at /api/auth/* - Create migration script for Better Auth database schema - Update main index to use Better Auth routes instead of custom auth - Configure email/password and OAuth (GitHub/Google) providers Frontend changes: - Add better-auth client - Create Better Auth client instance configuration - Update lib/auth.ts to use Better Auth session - Rewrite sign-in page with Better Auth methods - Rewrite sign-up page with Better Auth methods - Remove NextAuth route handler Documentation: - Add comprehensive migration guide with setup instructions - Document environment variables and API endpoints - Include testing checklist and rollback plan Benefits: - Unified authentication for both Elysia backend and Next.js frontend - Database-backed sessions (more secure than JWT) - Better TypeScript support - Extensible plugin system for future features - Active development and frequent updates
29 lines
688 B
JSON
29 lines
688 B
JSON
{
|
|
"name": "fiscal-backend",
|
|
"version": "0.1.0",
|
|
"scripts": {
|
|
"dev": "bun run --watch src/index.ts",
|
|
"start": "bun run src/index.ts",
|
|
"db:migrate": "bun run src/db/migrate.ts",
|
|
"db:seed": "bun run src/db/seed.ts"
|
|
},
|
|
"dependencies": {
|
|
"@elysiajs/cors": "^1.4.1",
|
|
"@elysiajs/swagger": "^1.3.1",
|
|
"bcryptjs": "^3.0.3",
|
|
"better-auth": "^1.4.18",
|
|
"dotenv": "^17.3.1",
|
|
"elysia": "^1.4.25",
|
|
"jsonwebtoken": "^9.0.3",
|
|
"pg": "^8.18.0",
|
|
"postgres": "^3.4.8",
|
|
"zod": "^4.3.6"
|
|
},
|
|
"devDependencies": {
|
|
"@types/pg": "^8.16.0",
|
|
"@types/bcryptjs": "^3.0.0",
|
|
"@types/jsonwebtoken": "^9.0.10",
|
|
"bun-types": "latest"
|
|
}
|
|
}
|