Back to Projects

Ticketing Platform

System Architect & Full-Stack Developer • 6 Months • SaaS Product

Ready MVP

Active Development

Awaiting Launch

#Fintech#Ticketing#High Concurrency#System Architecture
Ticketing Platform Banner

Overview

A high-concurrency ticketing platform focused on transactional integrity, secure M-Pesa payments, and role-based access control.

About the Project

IkoPurrty is a SaaS ticketing platform built to handle high-traffic event sales where data consistency and financial correctness are non-negotiable. The core engineering challenge was guaranteeing inventory integrity during flash sales while preserving a smooth user experience.

The system leverages Next.js Server Components for fast reads, paired with a hybrid authentication model that balances security, performance, and UX in a serverless environment.

Key Deliverables & Features

  • High-concurrency ticket reservation engine
  • M-Pesa Express & C2B automated webhook reconciliation
  • Role-based access control (RBAC) & multi-tenant event management
  • Stateless hybrid JWT session authentication
  • Real-time event analytics dashboard

Architecture & Engineering

  • Strict Layered Architecture separating framework, services, and data access.
  • Unit of Work (UoW) pattern for transactional integrity across repositories.
  • Pessimistic Locking (SELECT … FOR UPDATE) to prevent ticket overselling.
  • Hybrid Authentication Strategy for secure mutations and fast server-side reads.
  • Decoupled Checkout Flow using asynchronous webhooks and compensating transactions.

Key Challenges

Concurrency & Overselling

Problem During high-demand ticket releases, simultaneous checkout requests caused race conditions that could oversell inventory.

Solution Implemented pessimistic locking at the database level within a strict Unit of Work transaction boundary. Inventory rows are locked during reservation, mathematically guaranteeing that tickets cannot be oversold regardless of traffic spikes.

Authentication in Stateless Server Components

Problem Next.js Server Components are stateless and cannot perform side effects like setting cookies, making traditional token refresh strategies unreliable.

Solution Designed a hybrid session model using a long-lived Session JWT for read operations and a short-lived Access Token for mutations. This allowed uninterrupted server rendering while keeping write operations secure and revocable.

Designing for Future De-coupling

Problem Although the system was initially delivered as a Next.js monolith for speed, future plans included splitting the admin dashboard or migrating backend logic to a dedicated service. Tight coupling to the framework would make this difficult.

Solution Enforced a framework-agnostic service layer. All business logic lives in pure TypeScript services that depend only on repositories and DTOs. Next.js Server Actions act purely as adapters, making the entire backend core portable to Express or other runtimes with minimal refactoring.

Strategic Scoping vs. the 'Everything App' Trap

Problem The original vision combined ticketing, music streaming, and merchandise e-commerce into a single initial release, risking scope creep and architectural brittleness.

Solution Defined a phased delivery roadmap with ticketing as the core revenue driver. While only Phase 1 was implemented, the database schema and authentication model were designed to be domain-agnostic, allowing future expansion into music and merchandise without a rewrite.

Project Links

Technologies Used

frontend

Next.js (App Router)TypeScriptTailwind CSSZod

backend

Node.jsTSyringe (IoC)Server Actions

database

PostgreSQLPrisma ORMRedis

devops

VercelNeonGitHub Actions