Skip to content

Microservices ticketing system using TypeScript, NATS streaming, MongoDB per service, Redis queues, Docker, Kubernetes & Stripe.

Notifications You must be signed in to change notification settings

InsideAmber/tickhub

Repository files navigation

🎟️ Ticketing App – Event-Driven Microservices Platform

A production-style microservices application for buying and selling event tickets — inspired by platforms like StubHub and Ticketmaster.

Built to demonstrate scalable backend architecture, event-driven communication, and cloud-native deployment using modern engineering best practices.


🚀 Key Features

  • User authentication and authorization
  • Ticket creation, updates, and listings
  • Order locking to prevent double booking
  • Automatic order expiration using background jobs
  • Secure payments with Stripe
  • Real-time data synchronization via events
  • Optimistic concurrency control for consistency

🧩 Microservices Overview

Service Responsibility
Auth Service User signup, signin, JWT authentication
Tickets Service Create & manage tickets
Orders Service Handle order lifecycle
Expiration Service Auto-expire unpaid orders
Payments Service Stripe payment processing
Client (Next.js) Server-side rendered frontend

Each service owns its own database following the database-per-service pattern.


🔄 Event-Driven Architecture

All services communicate asynchronously using NATS Streaming Server.

Core Events

  • ticket:created
  • ticket:updated
  • order:created
  • order:cancelled
  • order:expired
  • payment:created

Benefits

  • Loose coupling between services
  • Horizontal scalability
  • Reliable data synchronization

🛠 Tech Stack

Backend & Messaging

  • TypeScript
  • Node.js, Express
  • MongoDB + Mongoose
  • NATS Streaming Server

Background Jobs

  • BullJS
  • Redis

Payments

  • Stripe API

DevOps & Cloud

  • Docker
  • Kubernetes (local + GCP)
  • Ingress NGINX

Testing

  • Jest
  • Supertest
  • mongodb-memory-server

Code Sharing

  • Private NPM packages for reusable logic

📐 Engineering Best Practices

  • Strong typing with TypeScript
  • Event-driven microservices architecture
  • Database-per-service pattern
  • Optimistic concurrency control
  • Test-first development
  • Centralized error handling
  • Reusable shared libraries
  • Clean and scalable folder structure
  • Cloud-native deployment

🎯 What This Project Demonstrates

  • Real-world microservices system design
  • Asynchronous service communication
  • Distributed data consistency
  • Background job processing
  • Secure payment workflows
  • Production-grade DevOps practices

Releases

No releases published

Packages

No packages published