api routes
Fact16 Controller Domain Suites
Case Study
Updated: 2026-05-09A full-stack, enterprise-grade event management platform powering event discovery, organizer workflows, multi-tiered ticketing, QR-code check-in with duplicate-scan prevention, automated payment verification, interactive Leaflet maps, and comprehensive moderation with ban and appeal processing built with React 19, Express 5, Prisma 7, PostgreSQL, and Redis.
Repository Links:
api routes
Fact16 Controller Domain Suites
database tables
Fact14 Prisma Models
checkin mechanism
FactQR Code + Atomic Duplicate Guard
email templates
FactHTML Transactional Templates
roles
FactAdmin, Organizer, Staff, Attendee
Using Prisma database transactions with unique constraints and optimistic lock guards ensures that multiple gate scanners cannot validate the same ticket twice during peak gate ingress.
Trade-off: Requires gate staff scanning devices to maintain active internet connectivity for real-time validation.
Separating permissions across Admin, Organizer, Staff, and Attendee ensures staff can only validate tickets, organizers manage events, and admins control platform payouts and bans.
Trade-off: Increases JWT payload and requires token verification on all protected API routes.
Clear schema relations across users, events, ticket types, orders, check-ins, reviews, moderation reports, and appeals ensure data consistency and simplified migrations.
Trade-off: Complex analytical reporting requires raw SQL aggregations or dedicated summary tables.
Managing high-throughput live events requires coordinating real-time ticket sales, fraud prevention, fast QR-code gate check-in without duplicate entry, and rigorous administrative moderation for community safety.
Built DEMS using a decoupled React 19 + Vite frontend and Express 5 backend with Prisma ORM and PostgreSQL. Designed atomic transaction check-in flows preventing duplicate ticket scanning, integrated Leaflet for geolocation mapping, built an interactive QR camera scanner using jsqr, implemented automated email confirmations with Nodemailer, and established moderation pipelines supporting user bans and appeal workflows.
Delivered a complete end-to-end event platform with 16 controller suites, robust RBAC, automated analytics with CSV exports, and sub-200ms QR verification.
| Dimension | Selected Option | Impact | Compromise |
|---|---|---|---|
| Check-in Validation | Server-Authoritative Atomic Prisma Transactions | Eliminates duplicate ticket entry and gate fraud | Requires reliable internet connectivity at gate scanners |
| Data Layer | Prisma ORM with PostgreSQL | Type-safe database queries and automated schema migrations | Slight overhead compared to raw SQL queries |
| Mapping | Open-source Leaflet + OpenStreetMap | Zero API cost and zero vendor lock-in for geolocation display | Requires custom client-side coordinate clustering |
Failure Path & Recovery Invariants
If payment gateway verification experiences network timeouts, webhook reconciliation endpoints safely re-verify transaction status before ticket issuance to avoid double-charging.
Implement an offline-first signed QR token verification protocol with local cryptographic public-key validation for network-denied event venues.
Introduce Redis-based BullMQ background workers for asynchronous high-volume ticket PDF rendering.