A massively multiplayer real-time pixel war game where players join clans to conquer a pixelated world map.
Open setup.html in your web browser - Beautiful step-by-step installation guide!
# Linux/Mac
bash install.sh
# Windows
install.batnpm run install-all
npm startThen open: http://localhost:5173
๐ Having issues? See TROUBLESHOOTING.md or START_HERE.md
- ๐ฏ Real-time gameplay: Place 1 pixel every 30 seconds
- โ๏ธ Clan warfare: Join or create clans with unique colors
- ๐ฎ Custom wars: Create your own war with customizable parameters
- ๐ Live statistics: Real-time tracking of territory, momentum, and activity
- ๐ Invitation system: Share wars and clan invites via unique codes
- โก Optimized performance: Chunked canvas loading, WebSocket updates, Redis caching
- ๐ฑ Responsive design: Works on desktop and mobile browsers
# Install dependencies
npm install
# Start Redis
docker-compose up -d
# Start development servers
npm run devVisit http://localhost:5173 to play!
- Node.js + TypeScript - Server runtime
- Express - Web framework
- Socket.io - Real-time WebSocket communication
- Redis - In-memory data store (no database!)
- JWT - Authentication
- React + TypeScript - UI framework
- HTML5 Canvas - High-performance map rendering
- Zustand - State management
- Vite - Lightning-fast build tool
- Socket.io Client - Real-time updates
WorldWar/
โโโ packages/
โ โโโ backend/ # Node.js API server
โ โ โโโ src/
โ โ โ โโโ config/ # Redis configuration
โ โ โ โโโ routes/ # API endpoints
โ โ โ โโโ services/ # Business logic
โ โ โ โโโ websocket/ # WebSocket handlers
โ โ โ โโโ index.ts # Server entry
โ โ โโโ package.json
โ โ
โ โโโ frontend/ # React web app
โ โโโ src/
โ โ โโโ api/ # API client
โ โ โโโ components/ # React components
โ โ โโโ pages/ # Page components
โ โ โโโ stores/ # Zustand stores
โ โ โโโ hooks/ # Custom hooks
โ โโโ package.json
โ
โโโ docs/ # Documentation
โ โโโ INSTALLATION.md # Setup guide
โ โโโ DEVELOPMENT.md # Dev guide
โ โโโ API.md # API documentation
โโโ docker-compose.yml # Redis service
โโโ README.md
- Installation Guide - Setup and deployment
- Development Guide - Architecture and workflow
- API Documentation - REST and WebSocket API
- Place 1 pixel every 30 seconds
- Claim neutral pixels or convert enemy pixels
- Cannot change your own clan's pixels
- Duration: 1-168 hours (1 hour to 7 days)
- Map Sizes: Small (1500x1000), Medium (3000x1500), Large (4500x2250)
- Clans: 2-16 clans per war
- Adjacency Rule: (Optional) Pixels must be adjacent to clan territory
- Clan with most territory at war end wins
- Live tracking of:
- Territory percentage
- Momentum (pixels/minute)
- Efficiency (conversion rate)
- Active players
# 1. Clone repository
git clone <repository-url>
cd WorldWar
# 2. Install dependencies
npm install
# 3. Start Redis (Docker)
docker-compose up -d
# 4. Copy environment files
cp packages/backend/.env.example packages/backend/.env
cp packages/frontend/.env.example packages/frontend/.env
# 5. Start dev servers
npm run devFrontend: http://localhost:5173
Backend: http://localhost:3000
npm run build
npm start- Register a user account
- Create a new war with 2+ clans
- Open multiple browser windows/tabs
- Join different clans in each window
- Start the war
- Place pixels and watch real-time updates!
- WebSocket broadcasts pixel placements to all connected clients
- Automatic stats refresh every 10 seconds
- Instant visual feedback
- Map divided into 64x64 pixel chunks
- Only loads visible chunks
- Optimized for large maps (up to 4500x2250 pixels)
- Server-side enforcement (30s default)
- Redis-based with TTL
- Client receives countdown updates
- Optional rule requiring pixels adjacent to clan territory
- Prevents isolated pixel spam
- First pixel always allowed
- War replay/timelapse system
- Permanent user profiles & statistics
- War seasons with global leaderboards
- Custom map shapes (not just rectangles)
- Power-ups and special pixels
- Mobile PWA with touch controls
- Discord bot integration
- War templates and presets
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - feel free to use for your own projects!
Redis connection error?
redis-cli ping # Should return PONGPort already in use?
# Change PORT in packages/backend/.env
# Change port in packages/frontend/vite.config.tsModule not found?
rm -rf node_modules packages/*/node_modules
npm install- Open an issue on GitHub
- Check the documentation
- Review closed issues for solutions
Built with โค๏ธ for the pixel art community