What I owned
Owned both frontend (Next.js 16 App Router, React 19) and backend (Node.js with PostgreSQL). Built the team-builder with 100-credit budget validation, captain/vice-captain selection, the live stats engine that scores per-ball events from match feeds, and the on-chain reward distribution flow. Cluster-mode PM2 deployment for both apps on a Hostinger VPS behind nginx, with horizontal scaling on the backend during match peaks.
Constraints
- Real-time scoring under 5-second latency from match event to leaderboard update
- Mobile-first — primary device is a mid-range Android on patchy 4G
- On-chain reward distribution must be auditable
- Fair Play verification visible to users without crypto literacy
Process
- 01
Domain modeling
Match events, scoring rules, booster economy, and reward tiers documented before any code.
- 02
Live scoring engine
Event ingestion from match data feeds, scoring rules engine, per-team score calculation, and leaderboard recomputation.
- 03
Team builder UX
100-credit budget validation in the browser, captain/VC role enforcement, position constraints, and undo/redo.
- 04
On-chain rewards
Reward distribution recorded on-chain with public transaction records, surfaced as a Fair Play badge.
- 05
Production deploy
PM2 cluster mode, nginx reverse proxy, Postgres replication, monitoring.
Approach
Picked Next.js 16 App Router for the frontend because RSC kept the client bundle small even on the team-builder, which is the heaviest interactive surface. Backend in Node.js + PostgreSQL because the scoring engine is read-heavy and the on-chain integration is asynchronous. PM2 cluster mode for both apps, nginx for TLS and routing.
Deliverables
- Player draft and team-builder with budget validation
- Live scoring engine with per-event ingestion
- Captain and vice-captain multipliers
- Booster economy (6 per season)
- Leaderboard with seasonal rankings
- On-chain reward distribution
- Mobile-optimized PWA shell
Outcomes
- Live in production handling cricket league traffic
- Sub-5-second scoring latency under load
- Two PM2 cluster apps online with multi-day uptime
- Fair Play verification surfaces on-chain rewards directly to users
What it feels like
The team-builder feels instantaneous, the live leaderboard updates within seconds of a wicket, and the Fair Play badge on every reward distribution makes the trust story tangible to users who are not crypto-native.