A real-time multiplayer browser-based MOBA game built with Phaser and Colyseus.
- Real-time multiplayer - Play with friends in real-time
- Browser-based - No downloads required, play instantly
- Team-based combat - Blue vs Red teams
- Real-time synchronization - Smooth player movement and state sync
- TypeScript - Type-safe development
- Node.js 18+
- npm or yarn
-
Clone the repository
git clone <repository-url> cd aramio
-
Install dependencies
npm install
-
Generate version file (required for first-time setup)
npm run gen
Note: This step is automatically run before
devandbuildcommands, but needs to be run manually for the first setup to avoid TypeScript errors. -
Start development servers
npm run dev
This will start:
- Client: http://localhost:3000 (Phaser game)
- Server: http://localhost:2567 (Colyseus server)
- Monitor: http://localhost:2567/colyseus (Colyseus monitor)
aramio/
├── src/
│ ├── client/ # Phaser game client
│ │ ├── main.ts # Game initialization
│ │ ├── scenes/ # Game scenes
│ │ ├── entity/ # Entity rendering and management
│ │ └── ui/ # HUD and UI components
│ ├── server/ # Colyseus server
│ │ ├── index.ts # Server setup
│ │ ├── rooms/ # Game rooms
│ │ ├── schema/ # Game state definitions
│ │ ├── game/ # Game logic and systems
│ │ │ ├── stateMachine/ # Game state management
│ │ │ ├── combatants/ # Player, bot, and minion logic
│ │ │ └── utils/ # Utility functions
│ │ └── shared/ # Shared types and utilities
│ ├── shared/ # Shared code between client and server
│ │ ├── types/ # TypeScript interfaces
│ │ └── utils/ # Shared utilities
│ └── Config.ts # Centralized game configuration
├── index.html # Main HTML file
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── vite.config.ts # Vite configuration
└── PROJECT_CONTEXT.md # Project context and notes
npm run gen- Generate version file from git commit hash (runs automatically before dev/build)npm run dev- Start both client and server in development modenpm run dev:client- Start only the client (Vite dev server)npm run dev:server- Start only the server (Colyseus)npm run build- Build for productionnpm run build:server- Build server onlynpm start- Start production servernpm test- Run unit tests
To test the production build (including static assets) locally:
-
Build the project:
npm run build
-
Start the production server:
npm start
-
Access the game:
- Game: http://localhost:2567
- Monitor: http://localhost:2567/colyseus
This serves the built client from dist/client/ and is useful for testing asset loading and production behavior.
- Frontend: Phaser 3.70 (Game engine)
- Backend: Colyseus 0.15 (Multiplayer framework)
- Language: TypeScript
- Build Tool: Vite
- Server: Express + WebSocket
- Testing: Jest
- GameScene: Main Phaser scene handling game rendering
- GameRoom: Colyseus room managing multiplayer state
- GameState: Schema defining synchronized game data
- EntityManager: Manages client-side entities and visual effects
- EntityRenderer: Handles rendering of game entities
- HUDRenderer: Displays player stats and UI
- CollisionUtils: Handles collision detection and resolution
- ✅ Real-time multiplayer connection
- ✅ Player movement synchronization
- ✅ Team assignment (Blue/Red)
- ✅ Basic health system
- ✅ Game state management
- ✅ Hot reloading development
- ✅ Turret system (defensive structures)
- ✅ Player respawning system with visual timer
- ✅ Combat system with attack radius indicators
- ✅ Experience and leveling system
- ✅ Minion spawning and AI
- ✅ Collision detection and resolution
- ✅ Visual feedback for XP gains and level-ups
- ✅ Centralized configuration management
- ✅ Projectile system with team-based colors
- ✅ Bot spawning and management
- ✅ Unit testing with Jest
PORT- Server port (default: 2567)
- Client: 3000
- Server: 2567
- Colyseus Monitor: 2567/colyseus
The project includes a comprehensive test suite:
npm test # Run all tests
npm test -- --watch # Run tests in watch mode
npm test -- --coverage # Run tests with coverage report- Unit Tests: Test individual game logic functions
- Integration Tests: Test game state interactions
- Configuration Tests: Ensure config values are properly applied
- Update
PROJECT_CONTEXT.mdwith your changes - Follow TypeScript best practices
- Test multiplayer functionality
- Add tests for new features
- Update documentation as needed
Port already in use:
# Kill process on port 2567
npx kill-port 2567
# Kill process on port 3000
npx kill-port 3000TypeScript errors about missing version file:
npm run genOther TypeScript errors:
npm run build:serverClient not connecting:
- Check server is running on port 2567
- Verify WebSocket connection in browser dev tools
- Check Colyseus monitor at http://localhost:2567/colyseus
Last updated: August 4th, 2025