A browser-based MMO where your convenience store is a front for reality-stabilizing rituals
๐ฎ Status: MVP Complete (56/56 tasks, 5 sprints) | ๐ Deployment: Docker-ready | ๐ Test Coverage: 60%+ (92 tests) | ๐ Security: Audit complete, roadmap available
- Docker & Docker Compose
- (Or: Node 20+, PostgreSQL 16, Redis 7)
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose downAccess Points:
- ๐ Game: http://localhost:3000
- ๐ง API: http://localhost:3001
- ๐ค Admin: http://localhost:3000/admin
# Install dependencies
npm install
# Set up database
cd apps/server
npm run prisma:migrate
npm run prisma:generate
# Start server
npm run dev
# Start web (in another terminal)
cd apps/web
npm run dev- Create Account at http://localhost:3000/login
- Move around with WASD or Arrow keys
- Click NPCs (customers) to start serving them
- Scan items in the register UI
- Check IDs for restricted items (21+ only)
- Earn currency & XP by completing transactions
- Chat with other players (Enter to focus)
- Press F1 for full keybinds list
NPC Types:
- ๐ฆ Normal - Patient, average pay
- ๐ง Impatient - Low patience, bonus XP if served quickly
- ๐ช Underage - Tries to buy restricted items, deny for XP
- ๐ฅ Karen - Very impatient, complains, high pay
- ๐ท Glitch - Weird requests, pays 2x
Progression:
- Level up by earning XP
- Unlock abilities and skills
- Earn currency to buy items
- Join franchises (guilds)
- Capture territory nodes
Frontend:
- Next.js 14 (App Router)
- Phaser 3 (2D game engine)
- React + TailwindCSS
- Zustand (state)
- Socket.io Client
Backend:
- Node.js 20 + TypeScript
- Express (REST API)
- Socket.io (WebSockets)
- PostgreSQL 16 (Prisma ORM)
- Redis 7 (cache)
Infrastructure:
- Docker Compose
- Multi-stage builds
- Hot-reload in dev
- Health checks
legacy-code-mmo/
โโโ apps/
โ โโโ web/ # Next.js frontend
โ โโโ server/ # Node.js backend
โ โโโ admin/ # Admin portal (in progress)
โโโ packages/
โ โโโ types/ # Shared TypeScript types
โ โโโ constants/ # Game balance & config
โโโ docs/ # Design documents
โโโ docker-compose.yml
- 20 TPS server tick rate (50ms intervals)
- Server-authoritative - prevents cheating
- Client-side prediction - smooth movement
- Event-driven systems - NPCs, Combat, Skills
Phase A: Foundation
- โ Player movement & multiplayer
- โ WebSocket real-time sync
- โ Auth & JWT tokens
- โ Docker deployment
Phase B: Core Loop
- โ NPC spawning (5 types)
- โ Scanning/register UI
- โ Currency & XP system
- โ Player HUD (level, XP, currency)
- โ Text chat
Server-Side Complete (UI in progress):
- โ Combat system (4 roles, 12+ abilities)
- โ Skill system (10 skills)
- โ Inventory & equipment
- โ Crafting (Mixology + Synthesis)
- โ Player market
- โ Franchise/guild system
- โ Housing system
- โ Territory control
- โ Daily quests
- ๐จ Combat UI (abilities, cooldowns)
- ๐จ Inventory UI
- ๐จ Crafting UI
- ๐จ Skills progression UI
- ๐จ Market UI
- ๐จ Housing decoration UI
- ๐จ Franchise management UI
- ๐จ Daily quests tracker
- ๐ Tutorial system
- ๐ First dungeon "The Back Room"
- ๐ Additional dungeons & raids
- ๐ Load testing & optimization
- ๐ Comprehensive test suite
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run specific test suite
npm test -- NPCSystem
# Coverage report
npm run test:coverageCurrent Coverage: 60%+ (92 tests passing)
# Root
npm install # Install all dependencies
npm run dev # Start all dev servers
npm run build # Build all apps
npm test # Run all tests
# Server (apps/server/)
npm run dev # Start dev server with hot-reload
npm run build # Build production
npm run prisma:migrate # Run migrations
npm run prisma:studio # Open Prisma Studio
# Web (apps/web/)
npm run dev # Start Next.js dev server
npm run build # Build production
npm run lint # Run ESLintCreate .env files in each app:
apps/server/.env:
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/legacy_code_mmo
REDIS_URL=redis://localhost:6379
JWT_SECRET=your-secret-key-change-in-production
PORT=3001
NODE_ENV=development
CLIENT_URL=http://localhost:3000apps/web/.env.local:
NEXT_PUBLIC_SERVER_URL=http://localhost:3001
NEXT_PUBLIC_ADMIN_PASSWORD=admin123
NEXT_TELEMETRY_DISABLED=1Core Documentation:
- CLAUDE.md - Project status & quick start
- ARCHITECTURE.md - System design & technical overview
- CONVENTIONS.md - Coding standards
Pre-Launch Roadmaps:
- SECURITY_ROADMAP.md - 2 CRITICAL + 5 MEDIUM security issues & fixes
- TESTING_IMPROVEMENTS.md - P0 tests needed (20-25 hours)
- CODE_QUALITY_ROADMAP.md - Refactoring opportunities (12-16 hours)
Game Design & Features:
- GAME_STATUS.md - Feature completion status
- BACK_ROOM_DESIGN.md - First dungeon design
- PLAYTESTING_GUIDE.md - Testing procedures
Operations:
- DEPLOYMENT.md - Docker & production setup
- PERFORMANCE_TESTING.md - Load testing & optimization
Genre: Incremental MMO + Corporate Horror Theme: Mundane retail โ Eldritch cosmic horror Target: 2-100 concurrent players Sessions: 5-15 minute bursts (office-friendly)
Core Loop:
- Serve NPC customers at register
- Earn currency & XP
- Level up & unlock abilities
- Explore dungeons with other players
- Craft items & trade
- Join franchise & capture territory
Security Audit Results (2026-02-14):
- 1 CRITICAL issue identified (race condition). (Note: missing admin auth has been resolved)
- 5 MEDIUM issues identified (rate limiting, JWT expiry, logging, etc.)
- See SECURITY_ROADMAP.md for details & fixes
Test Coverage Gaps:
- Socket handlers: ~70% (need 90%+)
- Database operations: ~85% (need 95%+)
- See TESTING_IMPROVEMENTS.md for P0 tests
Code Quality Improvements:
- Rate limiting scattered across files (need consolidation)
- Time units inconsistent (ms vs seconds)
- See CODE_QUALITY_ROADMAP.md for refactoring plan
This is a learning/demonstration project. Contributions welcome!
Key Areas:
- Additional NPC types
- More abilities & skills
- Dungeon content
- UI/UX improvements
- Performance optimization
- Test coverage
MIT License - See LICENSE file for details
Built with Claude Code during an overnight development session. A demonstration of rapid game development with AI assistance.
Technologies:
- Next.js, React, TypeScript
- Phaser 3, Socket.io
- PostgreSQL, Redis, Prisma
- Docker, TailwindCSS
# Build production images
docker-compose -f docker-compose.prod.yml build
# Start production stack
docker-compose -f docker-compose.prod.yml up -d
# View logs
docker-compose -f docker-compose.prod.yml logs -f
# Stop
docker-compose -f docker-compose.prod.yml down- Build apps:
npm run build - Set up PostgreSQL database
- Run migrations:
npm run prisma:migrate - Start server:
npm startinapps/server - Serve web: Use your preferred static host (Vercel, Netlify, etc.)
- Issues: File on GitHub
- Questions: Check docs/ folder
- Admin Access: Default password
admin123(CHANGE IN PRODUCTION!)
Happy coding! May your customers be patient and your transactions profitable. ๐ฐ๐ฎ