nerdware/apps/server/package.json
AyoubBenziza 9fe30feec5 feat(server): Drizzle + PostgreSQL schema + Open Trivia DB seed
- 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>
2026-06-10 12:24:17 +02:00

38 lines
989 B
JSON

{
"name": "@nerdware/server",
"version": "0.0.1",
"type": "module",
"private": true,
"scripts": {
"dev": "bun --watch src/index.ts",
"start": "bun src/index.ts",
"test": "bun test",
"build": "bun build ./src/index.ts --target bun --outdir dist",
"lint": "eslint",
"format": "prettier --write \"**/*.ts\"",
"typecheck": "tsc --noEmit",
"db:generate": "drizzle-kit generate",
"db:migrate": "bun src/db/migrate.ts",
"db:seed": "bun src/db/seed.ts",
"db:studio": "drizzle-kit studio"
},
"dependencies": {
"@fastify/cors": "^11",
"@nerdware/shared": "workspace:*",
"drizzle-orm": "^0.45",
"fastify": "^5",
"postgres": "^3.4",
"socket.io": "^4.8.1"
},
"devDependencies": {
"@eslint/js": "^10",
"@types/bun": "latest",
"@types/node": "^24",
"drizzle-kit": "^0.31",
"eslint": "^10",
"globals": "^17",
"pino-pretty": "^13",
"typescript": "~6",
"typescript-eslint": "^8"
}
}