Netjack is a real-time multiplayer Blackjack game for local networks, built with a TypeScript monorepo (client + server) and Socket.IO.
| Feature | |
|---|---|
| π | Host-and-join lobby flow with 6-character lobby codes |
| π‘οΈ | Server-authoritative Blackjack rules and turn validation |
| βοΈ | Split and double-down support |
| π | Round stats and event log |
| π¬ | Realtime lobby chat |
| π | Optional admin stats endpoint (disabled by default) |
| Layer | Technologies |
|---|---|
| Frontend | React 18, Vite 5, TypeScript, Tailwind CSS |
| Backend | Node.js 20, Express 4, Socket.IO 4, TypeScript, Vitest |
| Monorepo | npm workspaces |
- Node.js
20.xβ see .nvmrc - npm
9+
npm ci # install all workspace dependencies
npm run dev # start client + server in watch mode| Service | URL |
|---|---|
| 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 template values into your shell env or a local server env file.
- Copy client template values into
client/.env.local. - Keep secrets out of git.
- Admin endpoint (
/admin/stats) is off unlessADMIN_ENABLED=true.- No default admin credentials are baked into server runtime.
- CORS is restricted to the
CLIENT_URLSallowlist (comma-separated origins).
Run from the repository root:
| Command | Description |
|---|---|
npm run dev |
Start client + server in watch mode |
npm run check |
Workspace type checks |
npm run test |
Run all workspace tests |
npm run build |
Production builds for all packages |
npm run ci |
check + test + build |
Workspace-specific:
npm run dev -w server
npm run dev -w client
npm run test -w server
npm run check -w client- Start the app with
npm run dev. - Open the client on the host machine.
- Other devices on the same network can connect at
http://<host-ip>:5173. - Create or join a lobby using the 6-character code.
Find your host IP:
# macOS
ipconfig getifaddr en0
# Linux
hostname -I
# Windows (PowerShell)
ipconfigBuild all packages:
npm run buildStart backend from built output:
npm run start -w serverServe the client/dist output with your preferred static host.
Netjack/
βββ client/ # React + Vite frontend
βββ server/ # Node.js + Express + Socket.IO backend
βββ .github/workflows/ # CI pipeline
βββ README.md
See CONTRIBUTING.md, CODE_OF_CONDUCT.md, and SECURITY.md.