Competitive Coding Meets Monopoly — a real-time multiplayer game that combines the classic Monopoly board with LeetCode-style coding challenges. Solve problems to earn money, buy properties, and challenge opponents to code duels instead of paying rent.
- Frontend: React 18 + TypeScript + Vite + Tailwind CSS (
client/) - Backend: Node.js + Express + Socket.io (
server/) - Database: MongoDB via Mongoose, with an in-memory fallback store if MongoDB isn't connected
- Code Execution: Judge0 API (via RapidAPI), with a client-side JS fallback when no key is set
- Auth: username-only (no email/password) — the backend find-or-creates a player profile keyed by username and persists stats
# 1. Start MongoDB (Docker — persistent volume)
docker run -d --name codeopoly-mongo -p 27017:27017 -v codeopoly-mongo-data:/data/db mongo:7
# 2. Backend
cd server && npm install && npm run dev # http://localhost:5001
# 3. Frontend (new terminal)
cd client && npm install && npm run dev # http://localhost:3000Then open http://localhost:3000 → pick a username → create/join a game.
CodeOpoly/
├── client/ # Vite React frontend
│ └── src/
│ ├── components/
│ ├── pages/
│ ├── hooks/
│ ├── services/
│ └── data/
└── server/ # Express + Socket.io backend
└── src/
├── models/ # Mongoose schemas
├── routes/
├── socket/
└── utils/
- Real-time multiplayer (2–4 players) over Socket.io
- 40-space Monopoly board with tech-themed properties
- Solve coding problems to buy properties
- Code duels: challenge a property owner to avoid paying rent
- Property upgrades (houses/hotels), Debug Hell (jail with bug-fixing), Chance/Community Chest events
- Node.js 18+ and npm
- MongoDB (local or Atlas) — optional, falls back to an in-memory store if not connected
- A RapidAPI account for Judge0 code execution
cd server && npm install
cd ../client && npm installserver/.env
PORT=5001
MONGODB_URI=mongodb://localhost:27017/codeopoly
CLIENT_URLS=http://localhost:3000
RAPIDAPI_KEY=your-rapidapi-key-here
JUDGE0_API_URL=https://judge0-ce.p.rapidapi.com# Terminal 1
cd server && npm run dev
# Terminal 2
cd client && npm run devClient → Server: join-game, roll-dice, buy-property, challenge-duel,
submit-duel-code, end-turn, get-game-state
Server → Client: joined-game, player-joined, dice-rolled, landed-on-space,
property-bought, duel-started, duel-progress, duel-ended, turn-ended, game-state
See DEPLOYMENT.md.
MIT