A browser-based retro arcade game hub built with Vite + React 18 + TypeScript. Pick a game from the neon-lit landing page and play it in a CRT-framed canvas β no backend, runs entirely in the browser.
| Game | Status | Controls |
|---|---|---|
| Tetris | β Available | β β move Β· β rotate Β· β soft drop Β· Space hard drop Β· C hold Β· P pause Β· Enter start |
| Snake | β Available | β β β β or WASD move Β· P pause Β· Enter start |
Prerequisites: Node.js 18+, npm
# Clone the repo
git clone <repo-url>
cd arcade
# Install dependencies
npm install
# Start the dev server
npm run devOpen http://localhost:5173 in your browser.
npm run build # Type-check + production build (output: dist/)
npm run preview # Serve the production build locally| Layer | Choice |
|---|---|
| Build / Dev server | Vite 5 |
| UI Framework | React 18 + TypeScript |
| Routing | React Router v6 |
| Game rendering | HTML5 Canvas API |
| Styling | CSS Modules + CSS custom properties |
| Font | Press Start 2P (Google Fonts) |
src/
βββ main.tsx # App entry point
βββ App.tsx # Route declarations
βββ styles/
β βββ globals.css # Reset + base styles
β βββ theme.css # CSS vars: neon palette, animations, CRT effects
βββ components/
β βββ ArcadeScreen # CRT bezel wrapper component
β βββ GameCard # Landing page game card
βββ pages/
β βββ LandingPage # Game selector page
βββ games/
βββ registry.ts # Central list of all games
βββ tetris/ # Tetris implementation
βββ constants.ts
βββ TetrisEngine.ts # Pure game logic (no React)
βββ useTetris.ts # React hook: game loop + input
βββ TetrisPage.tsx # Canvas + HUD layout
βββ TetrisPage.module.css
See plan/ARCHITECTURE.md for the full architecture decision record.
- Create
src/games/<name>/with engine, hook, page, and constants files. - Add a
GameEntrytosrc/games/registry.tsβ the card appears automatically. - Add a
<Route>insrc/App.tsx. - Create
feature/<NAME>.mdand updatefeature/INDEX.md.
Full checklist in AGENTS.md.
Commit Messages β Conventional Commits
<type>(<optional scope>): <short description>
| Type | When to use |
|---|---|
feat |
New feature or game |
fix |
Bug fix |
chore |
Tooling, deps, config, cleanup |
style |
CSS / visual-only changes |
refactor |
Code restructure, no behaviour change |
docs |
Documentation only |
perf |
Performance improvement |
test |
Adding or fixing tests |
<type>/<short-kebab-description>
Examples: feat/snake-game Β· fix/tetris-rotation-wallkick Β· chore/upgrade-dependencies
See feature/INDEX.md for a log of all implemented features.