Backend API server for QuickShow movie ticket booking platform. Built with Node.js, Express, and MongoDB.
🎨 Frontend Repository: https://github.com/Sw-apnil/bookshowui
- 🎥 Movie & Show Management with TMDB integration
- 🎫 Real-time seat booking system
- 💳 Stripe payment processing
- 🔐 Clerk authentication with role-based access
- ⚡ Background jobs with Inngest (emails, reminders, auto-cleanup)
- 📧 Email notifications via Resend
- Node.js + Express 5
- MongoDB + Mongoose
- Clerk - Authentication
- Stripe - Payments
- Inngest - Background jobs
- Resend - Email service
- TMDB API - Movie data
npm installCreate .env file:
# Database
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/quickshow
# Clerk Authentication
CLERK_PUBLISHABLE_KEY=pk_test_xxxxx
CLERK_SECRET_KEY=sk_test_xxxxx
# Inngest
INNGEST_EVENT_KEY=your_key
INNGEST_SIGNING_KEY=your_signing_key
# TMDB API
TMDB_API_KEY=your_tmdb_bearer_token
# Stripe
STRIPE_PUBLISHABLE_KEY=pk_test_xxxxx
STRIPE_SECRET_KEY=sk_test_xxxxx
STRIPE_WEBHOOK_SECRET=whsec_xxxxx
# Email
RESEND_API_KEY=re_xxxxx
SENDER_EMAIL=onboarding@resend.devDevelopment:
npm run serverProduction:
npm startServer runs on http://localhost:3000
server/
├── configs/ # Database & email config
├── controllers/ # Business logic
├── inngest/ # Background jobs
├── middleware/ # Auth middleware
├── models/ # Mongoose schemas
├── routes/ # API endpoints
└── server.js # Entry point
User - Clerk ID, name, email, image
Movie - TMDB data (title, overview, poster, etc.)
Show - Movie reference, datetime, price, occupied seats
Booking - User, show, amount, seats, payment status
GET /api/show/all- All showsGET /api/show/:movieId- Shows for a moviePOST /api/booking/create- Create bookingGET /api/booking/seats/:showId- Occupied seats
GET /api/user/bookings- User's bookingsPOST /api/user/update-favorite- Add/remove favoriteGET /api/user/favorites- Get favorites
GET /api/admin/is-admin- Check admin statusGET /api/admin/dashboard- Analytics dataGET /api/admin/all-shows- All showsGET /api/admin/all-bookings- All bookingsGET /api/show/now-playing- Fetch TMDB moviesPOST /api/show/add- Create new show
POST /api/stripe- Stripe webhooksPOST /api/inngest- Inngest events
| Job | Trigger | Action |
|---|---|---|
| User Sync | Clerk webhooks | Create/update/delete users |
| Auto Cleanup | 10 min after booking | Release unpaid seats |
| Booking Email | Payment success | Send confirmation |
| Show Reminders | Every 8 hours | Email users before shows |
| New Show Alert | Show added | Notify all users |
- Clerk middleware validates all requests
- Admin middleware checks
user.privateMetadata.role === "admin" - Set admin role in Clerk Dashboard → User → Metadata
- Client creates booking → Returns Stripe checkout URL
- User pays on Stripe → Webhook updates
isPaid = true - Inngest sends confirmation email
- If unpaid after 10 min → Auto-release seats
vercel --prodConfigure webhooks after deployment:
- Clerk:
https://your-domain.com/api/inngest - Stripe:
https://your-domain.com/api/stripe
Set all .env variables in your hosting platform's dashboard.
MongoDB Connection Error
→ Check MONGODB_URI and IP whitelist
Clerk Auth Failed
→ Verify publishable and secret keys match
Stripe Webhook Failed
→ Check webhook secret matches Stripe dashboard
Emails Not Sending
→ Verify Resend API key and sender email
express- Web frameworkmongoose- MongoDB ODM@clerk/express- Authstripe- Paymentsinngest- Background jobsresend- Emailsaxios- TMDB API calls
💡 Tip: Test Stripe webhooks locally using Stripe CLI before production deployment!