Skip to content

Repository files navigation

πŸ•ΉοΈ Arcade Hub

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.


Games

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

Getting Started

Prerequisites: Node.js 18+, npm

# Clone the repo
git clone <repo-url>
cd arcade

# Install dependencies
npm install

# Start the dev server
npm run dev

Open http://localhost:5173 in your browser.

Other commands

npm run build      # Type-check + production build  (output: dist/)
npm run preview    # Serve the production build locally

Tech Stack

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)

Project Structure

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.


Adding a New Game

  1. Create src/games/<name>/ with engine, hook, page, and constants files.
  2. Add a GameEntry to src/games/registry.ts β€” the card appears automatically.
  3. Add a <Route> in src/App.tsx.
  4. Create feature/<NAME>.md and update feature/INDEX.md.

Full checklist in AGENTS.md.


Contributing

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

Branch Naming

<type>/<short-kebab-description>

Examples: feat/snake-game Β· fix/tetris-rotation-wallkick Β· chore/upgrade-dependencies


Feature History

See feature/INDEX.md for a log of all implemented features.

Releases

Packages

Contributors

Languages