Multiplayer bingo webapp with custom phrase grids and leaderboards.
- JavaScript 78%
- CSS 10.2%
- HTML 10%
- Makefile 1.5%
- Dockerfile 0.3%
Players removed by heartbeat timeout can now rejoin active games with preserved tile selections. Frontend auto-attempts rejoin on 404, with a manual rejoin UI as fallback. Stale timeout increased from 60s to 180s to survive browser background tab throttling. |
||
|---|---|---|
| .claude | ||
| examples | ||
| 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