Multiplayer Blackjack App

A multiplayer blackjack game where players can join rooms and play together against the dealer.

Features

  • Multiplayer gameplay - Multiple players in the same room
  • Room-based system - Join or create game rooms
  • Real-time updates via polling (no websockets needed)
  • Turn-based play - Players take turns in order
  • Automatic dealer play when all players are done
  • SQLite backend for game state persistence
  • Clean, responsive interface

How to Play

  1. Enter a room name to join or create a game
  2. Wait for other players to join
  3. When it's your turn, choose Hit or Stand
  4. Try to get as close to 21 as possible without going over
  5. After all players finish, dealer plays automatically
  6. Winners are determined and a new round can begin

Technical Architecture

  • Backend: Hono API with SQLite database
  • Frontend: Vanilla JavaScript with polling for updates
  • State Management: All game state stored in SQLite
  • Real-time: 2-second polling for game updates

File Structure

├── backend/
│   ├── database/
│   │   ├── migrations.ts    # Database schema
│   │   └── queries.ts       # Database operations
│   ├── routes/
│   │   ├── game.ts         # Game API endpoints
│   │   └── static.ts       # Static file serving
│   └── index.ts            # Main Hono app
├── frontend/
│   ├── components/
│   │   └── Game.js         # Game component logic
│   ├── index.html          # Main interface
│   ├── script.js           # Frontend entry point
│   └── style.css           # Styling
├── shared/
│   └── types.ts            # Shared type definitions
└── README.md