Real-time, football-first social prediction and live auction draft platform. Combines live match tracking with a Bloomberg-style trading terminal aesthetic, enabling fantasy managers to participate in live player auctions with anti-snipe timers, WebSocket bid synchronization, and global leaderboard rankings.
| Dimension | Details |
|---|---|
| Domain | Fantasy Sports, Real-Time Auction Drafts & Social Prediction |
| Frontend | React 19 SPA + Vite + Tailwind CSS + Zustand state management |
| Backend | Node.js 20+ + Express 5 + Socket.IO 4.8 + Prisma ORM |
| Realtime Engine | WebSocket bid streams with Redis distributed locks and @socket.io/redis-adapter |
| Background Jobs | BullMQ task queues backed by Redis for draft ticketing and scoring |
| Security & Auth | Dual JWT + Refresh tokens, Argon2 hashing, Helmet, CSRF defenses, OWASP audited |
| Test Coverage | 194 collected tests across 64+ Vitest backend suites + Playwright E2E |
| License | MIT License |
- What It Does
- Screenshots
- Key Features
- Architecture
- Engineering Audit & Remediation
- Tech Stack
- Prerequisites
- Quick Start
- Configuration
- Project Structure
- API Reference
- WebSocket Events
- Testing
- Limitations
- Contributing
- Security
- License
Traditional fantasy sports applications often feel static, relying on passive waiver-wire claims or simple turn-based serpentine drafts. They lack the urgency, social banter, and tactical thrill of live auctions.
MatchMind transforms fantasy drafts into high-frequency auctions:
- Live Auction Bidding: Managers enter synchronized auction rooms to bid on players nominated algorithmically or by participants.
- Anti-Snipe Countdown: Bids submitted during the final seconds dynamically reset the countdown clock, preventing bot sniping and giving human bidders fair reaction time.
- Dynamic Bid Increments: Required bid deltas scale automatically according to current player valuation brackets.
- Hard Salary Caps & Roster Rules: Managers navigate a strict $100M budget to assemble a compliant 15-player squad (2 GK, 5 DEF, 5 MID, 3 FWD) with automated budget lockout.
- Real-Time Standings: Integrates match performance metrics into fantasy points with instantaneous Redis-cached global leaderboards.
| Landing Page | Authentication |
|---|---|
![]() |
![]() |
| Live draft room ticker and active leagues | Secure authentication with OAuth support |
Live auction terminal with anti-snipe countdown, player card bids, and team budget allocations.
- Distributed Auction Locking: Redis-backed distributed locks (
ioredis+async-mutex) ensure atomic bid registration and prevent double-spend or out-of-order race conditions. - Horizontal WebSocket Scaling: Socket.IO instances synchronize rooms and
broadcasts across multi-instance clusters via
@socket.io/redis-adapter. - Roster Budget Lockout: Enforces mathematical budget constraints; bids that would leave insufficient funds to fill remaining mandatory roster slots are rejected.
- AI-Powered Draft Insights: Optional Anthropic Claude integration generates real-time draft advisory hints and squad balance analysis.
- Resilient Background Processing: BullMQ orchestrates draft ticket creation, auction recovery runs, and periodic leaderboard recalculation without blocking HTTP threads.
flowchart TD
subgraph Client["Client Tier (React 19 SPA)"]
UI["Terminal Dashboard Views\n(Tailwind CSS)"]
State["Zustand Client Store"]
SocketClient["Socket.IO Client (ws)"]
UI --> State
State --> SocketClient
end
subgraph Gateway["Server Tier (Node.js & Express 5)"]
HTTP["Express REST Endpoints\n(Zod Input Validation)"]
SocketServer["Socket.IO Gateway Server"]
AuthMiddleware["JWT & Argon2 Guards"]
HTTP --> AuthMiddleware
end
Client -->|HTTP / HTTPS| HTTP
SocketClient -->|WebSocket| SocketServer
subgraph CoreServices["Domain Service Layer"]
AuctionEngine["Auction Engine & Anti-Snipe"]
DraftService["Draft Runner & Ticket Manager"]
ScoringService["Fantasy Points Calculator"]
AuthService["Token & Session Manager"]
end
AuthMiddleware --> AuthService
HTTP --> DraftService
SocketServer --> AuctionEngine
AuctionEngine --> ScoringService
subgraph DataStore["Infrastructure & Data"]
Postgres[("PostgreSQL 16\nPrisma ORM")]
RedisStore[("Redis 7\nPub/Sub & Distributed Locks")]
BullMQWorker["BullMQ Worker Tasks"]
end
AuctionEngine --> RedisStore
CoreServices --> Postgres
RedisStore --> BullMQWorker
MatchMind underwent a structured multi-volume engineering audit covering OWASP Top 10 vulnerabilities, concurrency edge-cases, and architecture cleanliness:
- Security Boundaries: Separated JWT signing secrets (
JWT_SECRET,JWT_REFRESH_SECRET,JWT_RESET_SECRET) to eliminate cross-token privilege escalation. - Data Layer Decoupling: Replaced raw in-memory JSON state with Prisma ORM repositories and PostgreSQL transactions.
- Circuit Breakers & Retries: Integrated Opossum circuit breakers on external sports APIs (SportRadar) and Stripe webhooks to isolate external outages.
| Component | Technology | Version | Purpose |
|---|---|---|---|
| Backend Runtime | Node.js | >=20.0.0 |
High-concurrency async runtime |
| Server Framework | Express | 5.2.x |
RESTful API routing and middleware |
| Realtime Gateway | Socket.IO | 4.8.x |
Real-time bidirectional WebSocket rooms |
| Frontend Framework | React | 19.x |
Modern reactive UI architecture |
| Build Tooling | Vite | 8.x |
High-speed frontend development and bundling |
| Styling | Tailwind CSS | 4.x |
Bloomberg terminal dark aesthetic |
| Database & ORM | PostgreSQL & Prisma | 16 / 7.10 |
Relational persistence and schema migrations |
| Cache & Realtime Hub | Redis & IORedis | 7 / 6.x |
Distributed locking, caching, and room adapters |
| Job Queue | BullMQ | 6.x |
Background processing and draft recovery |
| Validation & Schema | Zod | 3.x |
Strict request and socket payload typing |
| Testing | Vitest & Playwright | Latest | Unit, integration, and E2E browser test suites |
- Node.js 20+ and npm
- Docker & Docker Compose (for PostgreSQL and Redis services)
- Optional: Stripe test account (for billing flows)
- Optional: Anthropic API Key (for draft insights)
git clone https://github.com/themanoj-025/MatchMind.git
cd MatchMindSpin up local PostgreSQL and Redis containers:
docker compose up -d postgres rediscd backend
cp .env.example .env
npm install
npx prisma generate
npx prisma db push
npm run devExpected output:
[INFO] Server running on port 4000 in development mode
[INFO] Connected to PostgreSQL via Prisma
[INFO] Redis client connected at redis://localhost:6379
[INFO] Socket.IO server initialized with Redis adapter
The REST API will be active at http://localhost:4000.
In a separate terminal:
cd frontend
npm install
npm run devThe terminal interface will load at http://localhost:5173 (or http://localhost:3000).
All configuration variables are defined in backend/.env.example:
| Variable | Default | Secret? | Description |
|---|---|---|---|
PORT |
4000 |
No | Express HTTP server port |
REDIS_URL |
redis://localhost:6379 |
No | Redis connection URI for locks and Socket.IO |
JWT_SECRET |
"" |
Yes | 64-character secret for access tokens |
JWT_REFRESH_SECRET |
"" |
Yes | 64-character secret for refresh tokens |
JWT_RESET_SECRET |
"" |
Yes | 64-character secret for password reset tokens |
GOOGLE_CLIENT_ID |
"" |
Yes | Google OAuth Client ID |
GOOGLE_CLIENT_SECRET |
"" |
Yes | Google OAuth Client Secret |
SPORTRADAR_API_KEY |
"" |
Yes | Live sports fixture and statistics API key |
ANTHROPIC_API_KEY |
"" |
Yes | Anthropic Claude key for draft hints |
STRIPE_SECRET_KEY |
"" |
Yes | Stripe secret key for Pro subscription handling |
MatchMind/
├── backend/ # Node.js + Express + Socket.IO service
│ ├── prisma/ # Database schema and migration specifications
│ └── src/
│ ├── __tests__/ # Integration and boot verification suites
│ ├── config/ # Environment, schema, and tournament definitions
│ ├── middleware/ # Auth, CSRF, rate-limiting, circuit breakers
│ ├── repositories/ # Prisma database query abstractions
│ ├── routes/ # REST controllers (auth, auction, draft, rooms)
│ ├── services/ # Auction engine, lock manager, fantasy scoring
│ ├── socket/ # WebSocket handlers and room lifecycle
│ └── workers/ # BullMQ background task workers
├── frontend/ # React 19 + Vite + Tailwind client
│ ├── e2e/ # Playwright end-to-end specifications
│ ├── public/ # Static branding and icon assets
│ └── src/ # UI views, terminal layouts, Zustand stores
├── docs/ # Architectural audits and screenshot assets
├── tests/ # Python circuit breaker integration tests
├── docker-compose.yml # Container configuration for local development
└── README.md
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST |
/api/auth/register |
Public | Create new manager account |
POST |
/api/auth/login |
Public | Authenticate manager and issue token pair |
GET |
/api/rooms |
JWT | List active public and private draft rooms |
POST |
/api/rooms |
JWT | Create new custom auction room with salary cap |
GET |
/api/players |
JWT | Paginated list of available football players |
GET |
/api/leaderboard |
Public | Ranked global fantasy leaderboard |
GET |
/api/health |
Public | System liveness probe and database check |
Real-time bid synchronization communicates over Socket.IO channels:
| Event | Direction | Payload | Description |
|---|---|---|---|
auction:join |
Client -> Server | { roomId } |
Join room channel and retrieve current bid state |
auction:bid |
Client -> Server | { roomId, playerId, amount } |
Submit new bid with distributed lock check |
auction:bid_placed |
Server -> Client | { playerId, amount, bidderId, timer } |
Broadcast accepted bid and reset anti-snipe clock |
auction:player_sold |
Server -> Client | { playerId, winnerId, finalAmount } |
Broadcast player allocation and advance queue |
auction:timer_tick |
Server -> Client | { secondsRemaining } |
Synchronized countdown clock broadcast |
The testing suite contains 194 unit and integration tests written in Vitest alongside Playwright E2E browser tests:
# Run backend Vitest suite
cd backend
npm run test:ci
# Run frontend test suite
cd ../frontend
npm test
# Run Playwright E2E tests
npx playwright testAll test runs isolate database mutations using test database instances or temporary mock adapters.
- Single Redis Instance: In standard configurations, Redis handles locks, caching, and Socket.IO pub/sub; production deployments with high volume should use Redis Sentinel or a managed Redis Cluster.
- Event Loop Compute: Heavy aggregate score calculations are offloaded to BullMQ workers to ensure the main Express event loop remains unblocked.
- Sports Data Mocking: Without a live SportRadar API subscription, the platform uses seeded sample league catalogs and deterministic fixture schedules.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch:
git checkout -b feat/my-feature. - Verify formatting and linting:
npm run lintandnpm run typecheck. - Run test suites:
npm test. - Open a pull request against
main.
See CONTRIBUTING.md for detailed guidelines.
Please report vulnerabilities privately via GitHub Security Advisories or by contacting the maintainers. Never commit real API keys or credentials. See SECURITY.md for full policy.
This project is licensed under the MIT License.

