A full-featured ticketing application for cultural events, festivals, and workshops with real-time seat booking, admin controls, and live updates.
- User Authentication - Email/password with JWT
- Event Management - Multiple sessions per event
- Seat Selection - Interactive seat map with VIP/General sections
- Real-time Updates - Live seat availability via WebSocket
- Booking Flow - Hold seats → Confirm booking
- Admin Dashboard - Create events, manage sessions, view analytics
- Role-based Access - User vs Admin permissions
- Backend: Node.js, Express, Prisma, MySQL, Socket.IO
- Frontend: React, React Query, React Router, Socket.IO Client
- Node.js 18+
- MySQL database
Create a MySQL database and update the connection string.
cd server
npm install
cp .env.example .env # Edit with your DATABASE_URL and JWT_SECRET
npx prisma migrate dev --name init
npm run db:seed
npm run devcd client
npm install
npm run dev- Frontend: http://localhost:5173
- Backend API: http://localhost:3001
- Admin: admin@example.com / admin123
- User: user@example.com / user123
POST /api/auth/register- Register new userPOST /api/auth/login- LoginGET /api/auth/me- Get current user
GET /api/events- List all eventsGET /api/events/:id- Event details with sessions
GET /api/sessions/:id- Session detailsGET /api/sessions/:id/seats- Seat map with availability
POST /api/bookings/hold- Hold seats (5 min)POST /api/bookings/:id/confirm- Confirm bookingPOST /api/bookings/:id/cancel- Cancel bookingGET /api/bookings/my- User's bookings
POST /api/admin/events- Create eventPUT /api/admin/events/:id- Update eventDELETE /api/admin/events/:id- Delete eventPOST /api/admin/sessions- Create session with seatsGET /api/admin/bookings- All bookingsGET /api/admin/analytics- Dashboard analytics
/server
/prisma
schema.prisma # Database schema
seed.js # Sample data
/src
index.js # Express + Socket.IO server
/routes # API routes
/middlewares # Auth middleware
/utils # Prisma client
/client
/src
App.jsx # Main app with routing
/pages # Page components
/components # Reusable components
/hooks # Custom hooks (auth, socket)
/services # API client
- User selects seats on the seat map
- Click "Hold Seats" → Creates PENDING bookings (5 min hold)
- Timer countdown shows remaining hold time
- Click "Confirm & Pay" → Updates to CONFIRMED status
- Real-time updates broadcast to all users viewing the session
MIT