- Integrated BetterAuth library for modern authentication - Added Session, Account, and Verification database tables - Created complete auth module with service, controller, guards, and decorators - Implemented shared authentication types in @mosaic/shared package - Added comprehensive test coverage (26 tests passing) - Documented type sharing strategy for monorepo - Updated environment configuration with OIDC and JWT settings Key architectural decisions: - BetterAuth over Passport.js for better TypeScript support - Separation of User (DB entity) vs AuthUser (client-safe subset) - Shared types package to prevent FE/BE drift - Factory pattern for auth config to use shared Prisma instance Ready for frontend integration (Issue #6). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Fixes #4
31 lines
738 B
Plaintext
31 lines
738 B
Plaintext
# API Configuration
|
|
API_PORT=3001
|
|
API_HOST=0.0.0.0
|
|
|
|
# Web Configuration
|
|
NEXT_PUBLIC_API_URL=http://localhost:3001
|
|
|
|
# Database
|
|
DATABASE_URL=postgresql://mosaic:mosaic_dev_password@localhost:5432/mosaic
|
|
POSTGRES_USER=mosaic
|
|
POSTGRES_PASSWORD=mosaic_dev_password
|
|
POSTGRES_DB=mosaic
|
|
POSTGRES_PORT=5432
|
|
|
|
# Valkey (Redis-compatible cache)
|
|
VALKEY_URL=redis://localhost:6379
|
|
VALKEY_PORT=6379
|
|
|
|
# Authentication (Authentik OIDC)
|
|
OIDC_ISSUER=https://auth.example.com/application/o/mosaic-stack/
|
|
OIDC_CLIENT_ID=your-client-id
|
|
OIDC_CLIENT_SECRET=your-client-secret
|
|
OIDC_REDIRECT_URI=http://localhost:3001/auth/callback
|
|
|
|
# JWT Configuration
|
|
JWT_SECRET=change-this-to-a-random-secret-in-production
|
|
JWT_EXPIRATION=24h
|
|
|
|
# Development
|
|
NODE_ENV=development
|