This is a starter full-stack Bahraini Kout multiplayer project using Node.js, Express, Socket.IO, and a React + Vite client.
- Room lifecycle: create room, join room, start game
- Core game state scaffold based on
instruction.md - Deck creation (32 cards including joker, as documented)
- Bidding flow (5-8)
- Trump selection
- Trick play with suit-following + joker/trump behavior (joker can be played anytime)
- Hand scoring with bid success/failure logic
- Browser client for room/game actions over Socket.IO
- Seat-based lobby with team selection (South/North vs East/West)
- Anticlockwise turn flow using fixed seat order
- Card UI formatted by rank + suit symbols
- Eats goal indicator (8 circles per team)
npm install
cd client && npm installIn terminal 1:
npm run devBackend starts at http://localhost:3000.
In terminal 2:
npm run clientClient starts at http://localhost:5173 (default Vite port).
Health endpoint:
curl http://localhost:3000/healthFrom project root:
.\run-dev.ps1This opens two PowerShell windows:
- backend on
3000 - client on
5173with host0.0.0.0
Optional custom ports:
.\run-dev.ps1 -ServerPort 3000 -ClientPort 5173Use an elevated PowerShell window in project root:
Open firewall ports (default 3000, 5173):
.\manage-firewall-ports.ps1 -Action openRemove firewall rules for those ports:
.\manage-firewall-ports.ps1 -Action removeCustom ports:
.\manage-firewall-ports.ps1 -Action open -Ports 3000,5173,8080npm install
cd client && npm install && npm run build
cd ..Terminal 1 (backend):
npm run devTerminal 2 (frontend dev server, reachable from network):
cd client
npm run dev -- --host 0.0.0.0 --port 51733000/tcp(required): backend API + Socket.IO5173/tcp(optional): Vite dev frontend for remote testing
If hosting through router/NAT, forward external port 3000 to your PC local IP on 3000.
- Server URL inside the app should be:
http://YOUR_PUBLIC_IP:3000(internet users), orhttp://YOUR_LAN_IP:3000(same local network).
Health test:
curl http://YOUR_PUBLIC_IP:3000/healthIf backend runs inside WSL2, Windows may need port forwarding to WSL IP:
$ip=(wsl hostname -I).Trim().Split(' ')[0]
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=3000 connectaddress=$ip connectport=3000Also allow Windows Firewall inbound rule for TCP 3000 (and 5173 if needed).
- This is an initial foundation. A full production game should add persistence, reconnect logic, and private per-player hand views.
- Current room state is broadcast as-is for speed of development; production should hide opponents' cards.