Case study
Rewriting a Live-Scoring Tournament Platform
A production platform covered by 128 tests, deployed through a pipeline that typechecks, migrates, tests and audits dependencies first.
- Project
- Pigeon Premier League
- Industry
- Sports / Real-time platform
- Role
- Built and deployed the rewrite
- TypeScript
- NestJS 11
- Prisma 6
- PostgreSQL
- React 18
- Vite 6
- Tailwind CSS
- TanStack Query v5
- Socket.IO
- pg-boss
- JWT
- Passport
- Nginx
- PM2
- GitHub Actions
The context
Pigeon Premier League runs endurance pigeon racing tournaments, with race-day time capture, live leaderboards and a permission-scoped admin panel.
The problem
The legacy system carried 17 documented correctness and security defects.
My responsibility
- Built and deployed the full rewrite: live leaderboards, race-day time capture and a permission-scoped admin panel
- Designed a three-process architecture: API, pg-boss worker and an Nginx-served SPA
- Bridged WebSocket JSON deltas across processes through PostgreSQL LISTEN/NOTIFY
- Covered the platform with 128 tests and a GitHub Actions pipeline that auto-deploys over SSH
Architecture
- Event capturedRace-day time capture
- Database NOTIFYPostgreSQL LISTEN/NOTIFY, across processes
- Socket broadcastSocket.IO, JSON deltas
- Live UI updateLeaderboard
Key decisions
PostgreSQL alone, no Redis or broker
The API, the pg-boss worker and the SPA run on PostgreSQL alone. pg-boss keeps its job queue in the same database, so there's no second system to operate.
LISTEN/NOTIFY as the cross-process bridge
WebSocket JSON deltas cross between processes through PostgreSQL LISTEN/NOTIFY, so live updates stay in sync.
A pipeline that gates every deploy
GitHub Actions typechecks, migrates, tests and audits dependencies before it auto-deploys over SSH.
Technical challenges
1.17 documented defects in the legacy system
The old system's correctness and security defects were documented first, then the platform was rewritten rather than patched, with tests covering the new one.
2.Live updates across separate processes
With the API and the worker in separate processes, a change in one has to reach sockets held by another. LISTEN/NOTIFY carries the deltas between them without adding Redis or a broker.
Results
- Replaced a legacy system that carried 17 documented correctness and security defects
- 128 tests in a GitHub Actions pipeline that typechecks, migrates, tests, audits dependencies and auto-deploys over SSH
- Live leaderboards on PostgreSQL alone, with no Redis or external broker to run