Real-Time Multiplayer Stickman Fighting โ Phaser 3, Socket.IO & Next.js
Features ยท Architecture ยท Tech Stack ยท Getting Started
StickMan Arena is a real-time multiplayer stickman fighting game. Two players, one arena, last stickman standing wins. Built as a three-package workspace: a Phaser 3 client, an Express + Socket.IO game server, and a shared package for types and validation โ so client and server can never disagree on the game contract.
- โ๏ธ 1v1 Arena Fights โ real-time stickman combat with a friend
- ๐ Socket.IO Realtime โ authoritative server with live position sync
- ๐ฆ Shared Contracts โ types, constants, and validation shared between client & server
- ๐ฎ Phaser 3 Rendering โ 60 FPS canvas gameplay
- ๐งช Tested Server โ Vitest suite on the game server
- ๐ Deployable Anywhere โ client on Vercel, server on Railway
flowchart LR
subgraph Client [Client โ Next.js + Phaser 3]
A[Game Scene]
B[Input Controller]
end
subgraph Server [Server โ Express + Socket.IO]
C[Game Rooms]
D[Physics / State Sync]
E[Validation]
end
subgraph Shared [Shared Workspace]
F[Types ยท Constants ยท Validation]
end
A --> C
B --> C
C -->|State Broadcast| A
F -.-> A
F -.-> C
E -.-> F
stickman-arena/
โโโ client/ # Next.js 14 + Phaser 3 (deploys to Vercel)
โโโ server/ # Express + Socket.IO (deploys to Railway)
โโโ shared/ # Types, constants, validation (workspace package)
Design principle: all gameplay contracts (message schemas, constants, input validation) live in shared and are imported by both ends โ a type error anywhere in the pipeline is caught at compile time.
| Layer | Technology |
|---|---|
| Client | Next.js 14 ยท React 18 ยท Phaser 3.88 |
| Realtime | Socket.IO 4.8 (client + server) |
| Server | Express 4.21 ยท uuid |
| Shared | TypeScript workspace package |
| Testing | Vitest (server) |
| Deployment | Vercel (client) ยท Railway (server) |
- Node.js 20+
- npm workspaces enabled (default)
# 1. Clone
git clone https://github.com/Manthan-13521/StickmanArena-Game.git
cd StickmanArena-Game
# 2. Install all workspaces
npm install
# 3. Build shared types (required before server/client)
npm run build --workspace=shared
# 4. Start both in dev mode
npm run devOpen http://localhost:3000 for the client. The game server runs on port 3001.
| Variable | Where | Purpose |
|---|---|---|
PORT |
server | Server port (default 3001) |
NEXT_PUBLIC_SERVER_URL |
client | WebSocket server URL |
- Spectator mode
- Power-ups & arenas selection
- Matchmaking + ranked ELO
- Mobile touch controls
- Replay / spectator camera
Contributions welcome โ fork, build the workspaces, and open a PR.
All rights reserved.
ยฉ 2026 Manthan Jaiswal โ Built with Phaser 3, Socket.IO & Next.js.