- Drizzle (postgres-js) setup: schema (quiz_category, quiz_question, quiz_played, game_history), client (nullable — no DATABASE_URL → null), drizzle.config, initial migration, migrate script - Open Trivia DB seed: curated geek categories, mcq + truefalse, base64 decode (incl. type/difficulty), 1 req/5s rate limit, idempotent (prompt unique); also seeds the FR in-code bank as source 'manual' - quiz wired to the DB: per-room pool preloaded at game start (loadQuizPool excludes already-played), records quiz_played for cross-session anti-repeat; falls back to the in-code bank when no DB - docker-compose for local Postgres; db:* scripts; DATABASE_URL in env Roadmap V1 step 5. Verified against a real Postgres: migrate + seed (270 OpenTDB + 10 manual), DB-backed game serves OpenTDB questions and fills quiz_played; no-DB fallback still serves the in-code bank. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
24 lines
625 B
YAML
24 lines
625 B
YAML
# Postgres de développement local pour NerdWare.
|
|
# docker compose up -d
|
|
# Puis depuis apps/server : bun run db:migrate && bun run db:seed
|
|
services:
|
|
postgres:
|
|
image: postgres:17-alpine
|
|
container_name: nerdware-postgres
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: nerdware
|
|
POSTGRES_PASSWORD: nerdware
|
|
POSTGRES_DB: nerdware
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- nerdware-pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U nerdware -d nerdware"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
volumes:
|
|
nerdware-pgdata:
|