Skip to content

Repository files navigation

Kout Game (Project Starter)

This is a starter full-stack Bahraini Kout multiplayer project using Node.js, Express, Socket.IO, and a React + Vite client.

What is included

  • 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)

Run (backend + client)

npm install
cd client && npm install

In terminal 1:

npm run dev

Backend starts at http://localhost:3000.

In terminal 2:

npm run client

Client starts at http://localhost:5173 (default Vite port).

Health endpoint:

curl http://localhost:3000/health

PowerShell quick start (Windows)

From project root:

.\run-dev.ps1

This opens two PowerShell windows:

  • backend on 3000
  • client on 5173 with host 0.0.0.0

Optional custom ports:

.\run-dev.ps1 -ServerPort 3000 -ClientPort 5173

PowerShell firewall helper (Windows)

Use an elevated PowerShell window in project root:

Open firewall ports (default 3000, 5173):

.\manage-firewall-ports.ps1 -Action open

Remove firewall rules for those ports:

.\manage-firewall-ports.ps1 -Action remove

Custom ports:

.\manage-firewall-ports.ps1 -Action open -Ports 3000,5173,8080

Host on your own PC (LAN/Internet)

1) Install and build

npm install
cd client && npm install && npm run build
cd ..

2) Run server and client

Terminal 1 (backend):

npm run dev

Terminal 2 (frontend dev server, reachable from network):

cd client
npm run dev -- --host 0.0.0.0 --port 5173

3) Ports to open

  • 3000/tcp (required): backend API + Socket.IO
  • 5173/tcp (optional): Vite dev frontend for remote testing

If hosting through router/NAT, forward external port 3000 to your PC local IP on 3000.

4) What users should connect to

  • Server URL inside the app should be:
    • http://YOUR_PUBLIC_IP:3000 (internet users), or
    • http://YOUR_LAN_IP:3000 (same local network).

Health test:

curl http://YOUR_PUBLIC_IP:3000/health

5) WSL2 note (important)

If 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=3000

Also allow Windows Firewall inbound rule for TCP 3000 (and 5173 if needed).

Notes

  • 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages