No description
- JavaScript 80.4%
- CSS 9.2%
- HTML 8.6%
- Makefile 1.4%
- Dockerfile 0.4%
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> |
||
|---|---|---|
| .claude | ||
| src | ||
| tests | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| CLAUDE.md | ||
| docker-compose.yml | ||
| Dockerfile | ||
| Makefile | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| vitest.config.js | ||
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
Using Docker (Recommended)
- Clone the repository:
git clone <repository-url>
cd BingOfTheRing
- Create environment file:
cp .env.example .env
# Edit .env and set your admin credentials
- Build and run:
make build
make up
- Access the application:
- Main app: http://localhost:3000
- Admin interface: http://localhost:3000/admin
Local Development
- Install dependencies:
make install
# OR
npm install
-
Create
.envfile with required variables (see.env.example) -
Run development server:
make dev
# OR
npm run dev
Usage
Creating a Game (Admin)
- Navigate to http://localhost:3000/admin
- Login with your admin credentials
- Click "Create New Game"
- Enter a game ID and phrases (one per line)
- Set grid dimension (e.g., 5 for 5x5 grid)
- Submit the form
Playing a Game
- Navigate to http://localhost:3000/{gameId}
- You'll be automatically assigned a unique grid
- Click tiles to mark them as completed
- When you complete the grid, enter your username
- View the leaderboard at http://localhost:3000/{gameId}/leaderboard
Makefile Commands
make build- Build Docker imagemake up- Start container (detached)make down- Stop containermake logs- View container logsmake shell- Open shell in containermake dev- Run in development mode with hot reloadmake test- Run testsmake install- Install dependencies locallymake 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 usernameADMIN_PASSWORD- Admin login passwordSESSION_SECRET- Secret for session encryptionPORT- Server port (default: 3000)
Data Storage
All data is stored in JSON files in the data/ directory:
data/games/{gameId}.json- Game definitionsdata/grids/{gameId}/{gridId}.json- Player gridsdata/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