Files
stack/.env.example
Jason Woltje d03f78ae17 feat(auth): @mosaic/auth — BetterAuth email/password setup
Implements P0-004: authentication package with BetterAuth + Drizzle adapter.

- BetterAuth configured with Drizzle adapter (usePlural for table mapping)
- Email/password authentication enabled
- Role field (admin/member/viewer) as additional user field
- 7-day sessions with daily refresh
- Mounted at /api/auth/* basePath
- createAuth() factory takes Db instance for DI flexibility
- BETTER_AUTH_SECRET and BETTER_AUTH_URL env vars added to .env.example

Verified: auth instance created, handler and API methods confirmed.

Closes #4

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 21:20:42 -05:00

21 lines
572 B
Plaintext

# Database (port 5433 avoids conflict with host PostgreSQL)
DATABASE_URL=postgresql://mosaic:mosaic@localhost:5433/mosaic
# Valkey (Redis-compatible, port 6380 avoids conflict with host Redis/Valkey)
VALKEY_URL=redis://localhost:6380
# Docker Compose host port overrides (optional)
# PG_HOST_PORT=5433
# VALKEY_HOST_PORT=6380
# OpenTelemetry
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
OTEL_SERVICE_NAME=mosaic-gateway
# Auth (BetterAuth)
BETTER_AUTH_SECRET=change-me-to-a-random-32-char-string
BETTER_AUTH_URL=http://localhost:4000
# Gateway
GATEWAY_PORT=4000