A retro arcade website built with Next.js 14, TypeScript, Tailwind CSS, and Drizzle ORM (SQLite). Includes a T-Rex Runner (Chrome Dino-style) mini-game and leaderboards.
- Next.js 14 (App Router)
- TypeScript
- Tailwind CSS (retro theme: dark bg, neon green/orange)
- Drizzle ORM + SQLite (@libsql/client — pure JS, no native build)
- Lucide React (icons)
- Press Start 2P (Google Fonts) for pixel-style typography
- Node.js 18+
- npm or yarn
If you previously had better-sqlite3 installed (or get native compile errors):
- Remove
better-sqlite3and@types/better-sqlite3frompackage.jsonif they’re still there. This project uses @libsql/client only. - Delete
node_modulesandpackage-lock.json(or run the script below) so npm doesn’t try to reinstall/recompile the old native package. - Run a fresh install:
npm run clean-installOtherwise:
npm install
npm run devOpen http://localhost:3000.
- The app auto-creates the SQLite database and tables on first run (in
./data/pixeldash.db). - It auto-seeds the T-Rex Runner game if no games exist.
- No manual migration or seed step is required for local development.
# Generate Drizzle migrations (if you change schema)
npm run db:generate
# Push schema to DB (alternative to auto-migrate)
npm run db:push
# Seed T-Rex game (if you cleared the DB)
npm run db:seed
# Open Drizzle Studio to inspect data
npm run db:studiosrc/
├── app/ # App Router pages and API
├── components/ # Header, footer, game cards, leaderboard, name prompt, T-Rex UI
├── db/ # Drizzle schema, connection, seed
├── games/trex-runner/# T-Rex Runner game logic (canvas, obstacles, collision)
├── hooks/ # usePlayerName (sessionStorage)
├── lib/ # utils, constants
└── types/ # Shared TypeScript types
- Homepage: Grid of games with thumbnails and links to
/games/[slug]. - Game page: Canvas area, leaderboard (top 10), score submit, "Back to Arcade".
- Name prompt: Shown once per browser session (sessionStorage). New tab = new prompt.
- T-Rex Runner: Jump (Space or tap), avoid obstacles, submit score on game over.
- Leaderboard: Top 10 per game, relative time; refreshes after new score.
- SQLite on Vercel: The app uses @libsql/client (pure JavaScript), so it works on Vercel without native build tools. The DB path is
/tmp/pixeldash.dbin serverless. For production at scale, you can point the client at Turso or use Vercel Postgres. - Ensure environment is set (e.g.
VERCEL=1is set automatically on Vercel).
MIT