A competitive multiplayer coding platform where developers battle head-to-head in algorithmic challenges. Built for the Kiroween Hackathon 2025.
- Node.js 18+
- pnpm (
npm install -g pnpm) - Docker Desktop (must be running)
# 1. Install dependencies
pnpm install
# 2. Start Docker containers + seed database
pnpm setup
# 3. Start backend (Terminal 1)
pnpm dev:backend
# 4. Start frontend (Terminal 2)
pnpm dev:frontend| Password | Username | |
|---|---|---|
| player1@test.com | player1@test.com | Player_1 |
| player2@test.com | player2@test.com | Player_2 |
- Open http://localhost:3000
- Login with
player1@test.comin one browser - Login with
player2@test.comin another browser (or incognito) - Both players click "Find Match" to battle each other!
- Real-time 1v1 Code Battles - Compete head-to-head with live opponent progress
- AI Code Coach - Get hints and guidance powered by Gemini AI
- Power-ups System - Use strategic power-ups for competitive advantage
- Phantom Mode - Stealth coding to hide your progress from opponents
- Ghost Race - Race against recordings of top players
- Skill Tree - Track and develop your coding abilities
- Leaderboard - Global rankings with ELO-based rating system
| Layer | Technologies |
|---|---|
| Frontend | Next.js 14, React 18, TypeScript, TailwindCSS, Monaco Editor |
| Backend | Node.js, Express, TypeScript, Socket.io |
| Database | PostgreSQL, Redis |
| AI | Google Gemini API |
| Infrastructure | Docker, Railway |
phantom/
├── .kiro/ # Kiro specs, steering docs, vibe coding
│ ├── specs/ # Feature specifications
│ ├── steering/ # Project guidelines
│ └── vibe-coding/ # Development session logs
├── backend/ # Express.js API + WebSocket server
│ └── src/
│ ├── db/ # Database migrations & seeds
│ ├── services/ # Business logic
│ ├── routes/ # REST API endpoints
│ └── websocket/ # Real-time handlers
├── frontend/ # Next.js application
│ └── src/app/ # App router pages
├── scripts/ # Development utilities
└── docker-compose.yml # Local PostgreSQL & Redis
Backend (backend/.env) and frontend (frontend/.env.local) are auto-created from examples on first run.
Optional: Add GEMINI_API_KEY to backend/.env for AI features. Get one free at https://aistudio.google.com/apikey
Phantom supports two code execution backends for running user-submitted code:
| Backend | Best For | Requirements | How It Works |
|---|---|---|---|
| Docker (Default) | Development | Docker Desktop running | Runs code in isolated containers locally |
| Judge0 | Production | API key from RapidAPI | Uses Judge0 Cloud API for scalable execution |
Development (Docker):
- Code runs in isolated Docker containers on your machine
- No external API keys needed
- Full control over execution environment
- Set
EXECUTION_BACKEND=docker(default)
Production (Judge0):
- Code runs on Judge0 Cloud infrastructure
- No Docker needed in production
- Automatic scaling and security sandboxing
- Set
EXECUTION_BACKEND=judge0and addJUDGE0_API_KEY - Get free API key: https://rapidapi.com/judge0-official/api/judge0-ce
The system automatically falls back to Docker if Judge0 is unavailable or misconfigured
pnpm install # Install all dependencies
pnpm setup # Start Docker + run migrations + seed
pnpm dev:backend # Start backend server (port 3001)
pnpm dev:frontend # Start frontend server (port 3000)
pnpm stop # Stop Docker containersPort in use:
lsof -ti:3001 | xargs kill -9 # Backend
lsof -ti:3000 | xargs kill -9 # FrontendReset database:
docker-compose down -v
pnpm setupMIT - See LICENSE file