How priyanshuvijay1402/seatlock-event-ticket-booking-system works
SeatLock is an event-ticket booking application centered on competing for seats safely: users browse events, hold seats, then confirm payment to create bookings. The API supports direct and queued hold processing, selectable database locking strategies, Redis coordination and real-time seat updates, and background hold expiry. Admins can create seat maps and inspect booking integrity; a ticket-drop simulation exercises the workflow and reports correctness and latency. The graph follows documented capabilities and sampled wiring; unsampled route and worker internals are represented only where the README supports them.
Main entry points: App.tsx React app · app.ts Express app · service.ts Booking orchestration · api.ts API client
Components 25
Web client
- React app
frontend/src/App.tsx - API client
frontend/src/api.ts - Event browsing
frontend/src/pages/EventsPage.tsx - Seat selection
frontend/src/pages/EventPage.tsx - Checkout
frontend/src/pages/CheckoutPage.tsx - My bookings
frontend/src/pages/MyBookingsPage.tsx - Admin console
frontend/src/pages/AdminPage.tsx
HTTP API
- Express app
backend/src/http/app.ts - Authentication routes
backend/src/http/routes/auth.ts - Event routes
backend/src/http/routes/events.ts - Hold routes
backend/src/http/routes/holds.ts - Admin routes
backend/src/http/routes/admin.ts
Booking domain
- Booking orchestration
backend/src/booking/service.ts - Lock strategies
backend/src/booking/pessimistic.ts - Mock payment
backend/src/booking/payment.ts - Event and integrity service
backend/src/booking/adminService.ts
Coordination and state
- Checkout queue
backend/src/queue/checkoutQueue.ts - Queue worker and sweeper
backend/src/worker.ts - Redis coordination
backend/src/redis/seatEvents.ts
Admin and simulation
- Ticket-drop simulation
backend/src/sim/ticketDrop.ts - Simulation CLI
backend/src/scripts/ticketDrop.ts
Other components
- Ticket buyer
- Admin user
- PostgreSQL
- Redis
Connections 37
- Ticket buyer → React app: uses
- Admin user → React app: uses
- React app → Event browsing: routes to
- React app → Seat selection: routes to
- React app → Checkout: routes to
- React app → My bookings: routes to
- React app → Admin console: routes to
- Event browsing → API client: requests events
- Seat selection → API client: requests seats
- Checkout → API client: confirms hold
- My bookings → API client: requests bookings
- Admin console → API client: requests admin
- API client → Express app: sends requests
- Express app → Authentication routes: dispatches auth
- Express app → Event routes: dispatches events
- Express app → Hold routes: dispatches holds
- Express app → Admin routes: dispatches admin
- Authentication routes → PostgreSQL: reads/writes users
- Event routes → PostgreSQL: reads event data
- Event routes → Redis coordination: uses seat map updates
- Hold routes → Booking orchestration: invokes booking operations
- Hold routes → Checkout queue: enqueues checkout
- Admin routes → Event and integrity service: invokes admin operations
- Admin routes → Ticket-drop simulation: runs simulation
- Booking orchestration → Lock strategies: selects strategy
- Booking orchestration → Mock payment: charges/refunds
- Booking orchestration → PostgreSQL: reads/writes bookings
- Booking orchestration → Redis coordination: publishes seat changes
- Event and integrity service → PostgreSQL: creates/checks records
- Checkout queue → Redis: stores jobs
- Checkout queue → Queue worker and sweeper: consumed by
- Queue worker and sweeper → Booking orchestration: expires holds
- Queue worker and sweeper → PostgreSQL: sweeps hold state
- Redis coordination → Redis: caches/publishes
- Ticket-drop simulation → Express app: drives HTTP workflow
- Ticket-drop simulation → Event and integrity service: checks integrity via API
- Simulation CLI → Ticket-drop simulation: runs