Issue #3 · Database Schema

Los Mas Que Saben del Genero

Typed Postgres foundation for the reggaeton trivia platform.

The full Drizzle schema, initial SQL migration, database trigger, and local seed data are now in place so auth, gameplay, payments, and leaderboard work can build on the real data model.

Core commands

pnpm dev
pnpm build
pnpm db:migrate
pnpm db:seed
curl http://localhost:3000/api/health

What this slice wires

  • Strict TypeScript config and App Router layout
  • Tailwind theme seeded from the PRD design system
  • shadcn/ui aliases and component manifest
  • All 9 core Postgres tables modeled in Drizzle
  • Initial SQL migration with indexes, check constraint, and trigger
  • Local seed script for a test user, admin user, and 10 questions
  • Sentry server bootstrap with a dev startup test capture
  • Coolify-friendly health check and container build path

Environment checklist

NEXT_PUBLIC_APP_URL
APP_TIMEZONE
DATABASE_URL
RESEND_API_KEY
SESSION_SECRET
STRIPE_SECRET_KEY
STRIPE_PUBLISHABLE_KEY
STRIPE_WEBHOOK_SECRET
STRIPE_PRICE_BASIC
STRIPE_PRICE_POPULAR
STRIPE_PRICE_UNLIMITED
NEXT_PUBLIC_POSTHOG_KEY
NEXT_PUBLIC_POSTHOG_HOST
SENTRY_DSN

Current stack

Next 16, React 19, Tailwind 4, TypeScript 5.9, and shadcn-ready foundations aligned to current stable releases.

Database wiring

Drizzle and Postgres now define the production data model, initial migration path, and seed data needed for the next backend slices.

Ops baseline

Sentry startup capture, `/api/health`, and a standalone Docker build keep local and Coolify environments pointed at the same runtime path.