No description
  • JavaScript 80.4%
  • CSS 9.2%
  • HTML 8.6%
  • Makefile 1.4%
  • Dockerfile 0.4%
Find a file
François Schmidts 814271e458 feat(game): add draft phase and lifecycle
Implement three-state game lifecycle (draft -> active -> stopped)
with collaborative phrase editing via SSE-synced draft page.

- Add sseManager and lockManager services for real-time sync
- Add phrase CRUD API with per-game async mutex
- Add draft page for collaborative phrase editing
- Replace createGame/updateGame with granular operations
- Add admin launch/stop controls with status badges
- Route by game status: draft->editor, active->grid, stopped->leaderboard
- Treat legacy games without status field as active

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 17:54:29 +01:00
.claude feat(game): add draft phase and lifecycle 2026-02-20 17:54:29 +01:00
src feat(game): add draft phase and lifecycle 2026-02-20 17:54:29 +01:00
tests feat(game): add draft phase and lifecycle 2026-02-20 17:54:29 +01:00
.dockerignore Initial commit: BingOfTheRing multiplayer bingo webapp 2026-02-12 20:58:49 +01:00
.env.example Initial commit: BingOfTheRing multiplayer bingo webapp 2026-02-12 20:58:49 +01:00
.gitignore Initial commit: BingOfTheRing multiplayer bingo webapp 2026-02-12 20:58:49 +01:00
CLAUDE.md feat(game): add draft phase and lifecycle 2026-02-20 17:54:29 +01:00
docker-compose.yml Initial commit: BingOfTheRing multiplayer bingo webapp 2026-02-12 20:58:49 +01:00
Dockerfile Initial commit: BingOfTheRing multiplayer bingo webapp 2026-02-12 20:58:49 +01:00
Makefile switching from docker-compose to docker compose 2026-02-12 21:00:22 +01:00
package-lock.json feat: implement adaptive grid sizing with center FREE space 2026-02-12 21:09:21 +01:00
package.json Initial commit: BingOfTheRing multiplayer bingo webapp 2026-02-12 20:58:49 +01:00
README.md switching from docker-compose to docker compose 2026-02-12 21:00:22 +01:00
vitest.config.js Initial commit: BingOfTheRing multiplayer bingo webapp 2026-02-12 20:58:49 +01:00

BingOfTheRing

A multiplayer bingo webapp where players compete to complete custom phrase grids. Each player receives a unique randomly-ordered grid, and the first to complete it wins. Results are tracked on a leaderboard.

Features

  • Multiplayer Bingo: Multiple players can play the same game with different randomized grids
  • Custom Phrases: Create games with any phrases you want
  • Real-time Leaderboard: Track who completed the game and when
  • Admin Interface: Create and manage bingo games
  • Persistent Storage: All data stored in JSON files, no database required
  • Dockerized: Easy deployment with Docker and Docker Compose

Requirements

  • Docker and Docker Compose (for containerized deployment)
  • OR Node.js 20+ (for local development)

Quick Start

  1. Clone the repository:
git clone <repository-url>
cd BingOfTheRing
  1. Create environment file:
cp .env.example .env
# Edit .env and set your admin credentials
  1. Build and run:
make build
make up
  1. Access the application:

Local Development

  1. Install dependencies:
make install
# OR
npm install
  1. Create .env file with required variables (see .env.example)

  2. Run development server:

make dev
# OR
npm run dev

Usage

Creating a Game (Admin)

  1. Navigate to http://localhost:3000/admin
  2. Login with your admin credentials
  3. Click "Create New Game"
  4. Enter a game ID and phrases (one per line)
  5. Set grid dimension (e.g., 5 for 5x5 grid)
  6. Submit the form

Playing a Game

  1. Navigate to http://localhost:3000/{gameId}
  2. You'll be automatically assigned a unique grid
  3. Click tiles to mark them as completed
  4. When you complete the grid, enter your username
  5. View the leaderboard at http://localhost:3000/{gameId}/leaderboard

Makefile Commands

  • make build - Build Docker image
  • make up - Start container (detached)
  • make down - Stop container
  • make logs - View container logs
  • make shell - Open shell in container
  • make dev - Run in development mode with hot reload
  • make test - Run tests
  • make install - Install dependencies locally
  • make clean - Remove data directory (with confirmation)

Project Structure

BingOfTheRing/
├── src/
│   ├── server.js              # Express server entry point
│   ├── routes/                # Route handlers
│   ├── middleware/            # Custom middleware
│   ├── services/              # Business logic
│   ├── utils/                 # Utility functions
│   └── public/                # Frontend files
├── data/                      # Persistent data storage
│   ├── games/                 # Game definitions
│   └── grids/                 # Player grids
├── tests/                     # Vitest test files
├── Dockerfile                 # Container definition
├── docker-compose.yml         # Docker compose configuration
└── Makefile                   # Development commands

Environment Variables

See .env.example for all required environment variables:

  • ADMIN_USERNAME - Admin login username
  • ADMIN_PASSWORD - Admin login password
  • SESSION_SECRET - Secret for session encryption
  • PORT - Server port (default: 3000)

Data Storage

All data is stored in JSON files in the data/ directory:

  • data/games/{gameId}.json - Game definitions
  • data/grids/{gameId}/{gridId}.json - Player grids
  • data/admin.json - Admin credentials (created automatically)

The data/ directory is mounted as a Docker volume for persistence.

Testing

Run tests with:

make test
# OR
npm test

License

MIT