AI Rupak Event Management App is a full-stack, scalable concert/event booking platform with:
- High-traffic handling using queueing
- Secure Stripe payments
- Time-bound ticket reservation
- Real-time booking state
- Mobile-first frontend (Expo + React Native)
- Backend designed for production-scale concurrency
The system is designed to later support:
- Admin analytics
- QR-based attendance scanning
- Fraud prevention
- Event demand surge handling
Mobile App (Expo / React Native)
|
| REST APIs (JWT Auth)
β
Node.js Backend (Express)
|
| Prisma ORM
β
MongoDB Atlas
|
| Redis
β
Queue + Locks + Expiry
|
| Stripe Webhooks
β
Payment Confirmation
- Separation of Concerns (Controller / Service / Data)
- Idempotency-first design (Payments, Booking, Webhooks)
- Optimistic UI with backend truth
- Fail-safe concurrency
- Stateless APIs + Redis for state
| Category | Technology |
|---|---|
| Framework | Expo (React Native) |
| Language | TypeScript |
| Routing | Expo Router |
| State | Zustand |
| Server State | TanStack React Query |
| Styling | Tailwind (NativeWind) |
| Payments | @stripe/stripe-react-native |
| Category | Technology |
|---|---|
| Runtime | Node.js |
| Framework | Express.js |
| ORM | Prisma |
| Database | MongoDB Atlas |
| Cache | Redis |
| Auth | JWT (Access + Refresh) |
| Payments | Stripe API + Webhooks |
| Logging | Winston |
| Validation | Custom Middleware |
| Rate Limiting | Express Middleware |
backend/
βββ controllers/ # HTTP layer (req/res)
βββ services/ # Business logic
βββ routes/ # API versioning
βββ middlewares/ # Auth, validation, rate limit
βββ prisma/ # DB schema + seed
βββ config/ # Redis, Stripe, Logger
βββ utils/ # JWT, helpers
βββ webhooks/ # Stripe webhook handler
βββ index.js # App bootstrap
β Controllers are thin β Services are reusable β No DB logic inside controllers
concertapp/
βββ app/ # Expo Router pages
βββ api/ # Backend API wrappers
βββ components/ # Reusable UI
βββ providers/ # QueryClient, Stripe
βββ stores/ # Zustand global stores
βββ constants/ # Theme & configs
β API logic isolated β No direct axios in screens β Clean separation of UI & logic
-
User logs in / signs up
-
Backend issues:
- Access Token (short-lived)
- Refresh Token (stored)
-
Access token attached to every API request
-
Middleware validates token
-
Role-based access possible (future admin)
- User selects tickets
- Stored in Zustand (
bookingStore)
Why Queue? To prevent overselling and DB race conditions.
Flow:
User β joinQueue
Redis assigns position
Polling queue status
Only ACTIVE users can book
Redis keys used:
queue:concert:{id}active:concert:{id}
-
Only allowed if:
- Queue status =
active - Seats available
- Queue status =
-
Booking created with:
status = pendingexpiresAt = now + 5 min
β Seats temporarily locked β Booking auto-expires
Frontend β createPaymentIntent
Backend β Stripe PaymentIntent
Backend β Save payment record
Frontend β Stripe Payment Sheet
User pays
Stripe β Webhook
Backend β Confirm booking
- Booking is NOT confirmed on frontend
- Only webhook confirms booking
- Prevents fraud & replay attacks
Stripe β payment_intent.succeeded
β
Verify signature
β
Find payment + booking
β
Mark payment = succeeded
β
Confirm booking
β
Reduce available seats
β Idempotent β Safe retries β Production-grade
-
Booking has
expiresAt -
Frontend countdown timer
-
Backend validates expiry before payment
-
Expired bookings:
- Release seats
- Removed from Redis
- Marked
EXPIRED
| State Type | Tool |
|---|---|
| UI State | React state |
| Cart | Zustand |
| Server Data | React Query |
| Auth | Zustand + Secure Store |
| State | Storage |
|---|---|
| Queue | Redis |
| Bookings | MongoDB |
| Payments | MongoDB |
| Locks | Redis TTL |
-
Backend:
- Central error middleware
- Typed error messages
-
Frontend:
- Graceful alerts
- Retry logic
- Optimistic rollback
- Controllers = transport
- Services = logic
- Prisma = persistence
- Stripe webhooks
- Queue activation
- Booking expiration
- DB constraints
- Redis locks
- Unique indexes
- Webhook idempotency
- JWT-based auth
- Rate limiting
- Stripe signature verification
- No trust on frontend confirmation
- Redis-based concurrency control
- Stateless backend
- Redis for hot paths
- Queue-based booking
- Payment webhook isolation
Can scale to:
- 100K+ concurrent users
- Flash-sale events
- Multi-admin scanning
- Admin dashboard
- QR attendance scanning
- Event analytics
- Revenue reports
- Fraud detection
- Offline scan sync