Spades Online is a real-time, 4-player multiplayer implementation of the classic Spades card game. The platform ships a complete Node.js + Express server, a WebSocket game engine, Redis-backed presence and pub/sub, PostgreSQL persistence, and a hash-based browser client — all in a single repository with no build step required.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Antonelli-Tech-Solutions/spades/llms.txt
Use this file to discover all available pages before exploring further.
Quickstart
Run the server locally in under 5 minutes with PostgreSQL and Redis.
Environment Variables
Full reference for every configuration option the server reads at startup.
Architecture Overview
Understand how the HTTP server, WebSocket layer, Redis, and PostgreSQL fit together.
API Reference
Complete HTTP and WebSocket API documentation with request/response schemas.
What’s Inside
Spades Online is a production-ready platform, not a toy demo. Every layer is covered by unit and integration tests, and the codebase is structured for straightforward self-hosting or cloud deployment.Game Engine
Full Spades ruleset: bidding, Blind Nil with card exchange, trick resolution, bag penalties, and win/loss detection.
Social Layer
Friends system with presence badges (online / in-game / offline), in-app invites, and player blocking.
Table Lobby
Public, friends-only, and private tables with open, friends-only, and invite-only join policies.
Real-Time Events
WebSocket pub/sub via Redis so every server instance can broadcast to any connected client.
Bot Players
Bots fill empty seats on demand and replace disconnected players mid-game automatically.
Anti-Cheat
All bids and card plays are validated server-side before any state mutation occurs.
Platform at a Glance
| Layer | Technology |
|---|---|
| Server | Node.js 18+ · Express · ES Modules |
| Real-time | WebSocket (ws) — shares HTTP port or dedicated via WS_PORT |
| Session / Presence / Pub-Sub | Redis |
| Persistent storage | PostgreSQL |
| Web client | Vanilla JS SPA (hash-based router, no build step) |
Install dependencies
Clone the repository and run
npm install. No build toolchain required — the server runs directly from source.Provision infrastructure
Start a PostgreSQL instance and a Redis instance. Export
DATABASE_URL and REDIS_URL.Run database migrations
Apply the five SQL migration files in
db/migrations/ to create the players, profiles, friendships, blocks, and password-reset tables.