Netjack is a local-network Blackjack game with a server-authoritative rules engine, a realtime client, and a shared lobby flow for hosts and players.
It is built for LAN sessions, classroom play, and small trusted networks. It is not a public gambling service.
| Feature | Description |
|---|---|
| Lobby flow | Host-and-join flow with short lobby codes |
| Rules | Server-authoritative turn validation and Blackjack logic |
| Actions | Split and double-down support |
| Realtime | Live lobby chat and round event log |
| Stats | Round summary and admin stats endpoint |
| Workspace | npm workspaces split into client and server |
Netjack exists because the game should feel quick, local, and social without requiring a hosted backend.
The project focuses on:
- one host machine
- one shared local network
- a short code instead of account sign-in
- simple rules that stay consistent on the server
The result is a lightweight Blackjack table that works in the room, not in a cloud account.
- Start the root dev command.
- The server listens on port
3001and the client on port5173. - One player hosts a lobby and gets a 6-character code.
- Other players join from the same LAN.
- The server validates every move and broadcasts state updates to the client.
| Layer | Technologies |
|---|---|
| Frontend | React 18, Vite 5, TypeScript, Tailwind CSS |
| Backend | Node.js 20, Express 4, Socket.IO 4, TypeScript, Vitest |
| Tooling | npm workspaces, concurrently |
- Node.js
20.x - npm
9+ - a shared local network for host and players
npm ci
npm run devThen open:
- Client: http://localhost:5173
- Server: http://localhost:3001
Safe environment templates are included in the repo:
| Template | Purpose |
|---|---|
| .env.server.example | Server environment variables |
| .env.client.example | Client environment variables |
Recommended setup:
- Copy server values into a local server env file or shell session.
- Copy client values into
client/.env.local. - Keep secrets out of git.
Security defaults:
- the admin endpoint is off unless
ADMIN_ENABLED=true - CORS is restricted to
CLIENT_URLS - no default admin credentials are baked into runtime
- Start the app with
npm run dev. - On the host machine, create a lobby.
- Share the 6-character code with other players.
- Join from another device on the same network.
- Play rounds and use chat or round history as needed.
For local network testing, the host IP can be found with:
# macOS
ipconfig getifaddr en0
# Linux
hostname -I
# Windows (PowerShell)
ipconfigUseful commands:
npm run check
npm run test
npm run build
npm run ciWorkspace-specific commands:
npm run dev -w server
npm run dev -w client
npm run test -w server
npm run check -w client- tighten mobile layout behavior for cramped LAN sessions
- improve admin visibility for round diagnostics
- add more round-history and analytics views
- keep the rules engine and UI aligned as the game evolves

