A full-stack movie ticket booking application built with React (frontend) and Node.js/Express (backend) with MongoDB database.
- User Authentication - JWT-based login/register system
- Movie Browsing - Browse movies with search and filtering
- Interactive Seat Selection - Visual seat map with real-time availability
- Booking Management - View and cancel bookings
- Dark/Light Theme - Complete theme support throughout the app
- Responsive Design - Works perfectly on all devices
- Netflix-style UI - Modern, sleek interface
- Node.js (v18.x or higher)
- MongoDB (local or cloud instance)
- npm or yarn package manager
-
Clone and Setup Backend:
cd backend npm install -
Configure Environment:
cp .env.example .env
Update
.envwith your MongoDB connection string and JWT secret:MONGODB_URI=mongodb://localhost:27017/cineflix JWT_SECRET=your-super-secret-jwt-key PORT=5000
-
Seed Database (Optional):
npm run seed
-
Start Backend:
npm run dev
-
Setup Frontend:
cd ../frontend npm install -
Configure Frontend Environment: Update API URL in
src/config.jsor set environment variable:REACT_APP_API_URL=https://moviehold-production-22ae.up.railway.app/api
-
Start Frontend:
npm start
-
Open Browser: Navigate to
http://localhost:3000
-
Build for Production:
cd frontend npm run build -
Deploy to Netlify:
- Connect your GitHub repository to Netlify
- Set build command:
npm run build - Set publish directory:
build - Add environment variable:
REACT_APP_API_URL=https://moviehold-production-22ae.up.railway.app/api
-
Alternative Manual Deploy:
netlify deploy --prod --dir=build
-
Deploy to Render:
- Connect your GitHub repository to Render
- Select "Web Service"
- Set runtime:
Node.js - Build command:
npm install - Start command:
npm start - Add environment variables:
MONGODB_URI(your MongoDB connection string)JWT_SECRET(your JWT secret)PORT(set to 10000 for Render)
-
MongoDB Setup:
- Use MongoDB Atlas (free tier available)
- Or deploy MongoDB on Railway/Railway
- Frontend:
https://cineflix-movie-booking.netlify.app - Backend:
https://moviehold-production-22ae.up.railway.app - MongoDB:
mongodb+srv://...(Atlas cluster)
movie-booking-system/
βββ frontend/ # React application
β βββ public/
β βββ src/
β β βββ components/ # Reusable components
β β βββ pages/ # Page components
β β βββ context/ # React contexts
β β βββ App.js
β βββ package.json
β βββ netlify.toml
βββ backend/ # Express.js API
β βββ models/ # Mongoose models
β βββ routes/ # API routes
β βββ middleware/ # Custom middleware
β βββ seed.js # Database seeder
β βββ server.js # Main server file
βββ README.md
Backend (.env):
MONGODB_URI=mongodb://localhost:27017/cineflix
JWT_SECRET=your-super-secret-jwt-key
PORT=5000
NODE_ENV=developmentFrontend (.env):
REACT_APP_API_URL=https://moviehold-production-22ae.up.railway.app/api- User - Authentication and user data
- Movie - Movie information
- Showtime - Theater and show timing data
- Booking - User bookings with seat information
- JWT-based authentication with refresh tokens
- Password hashing with bcrypt
- Protected routes and middleware
- Movie CRUD operations
- Image upload support
- Genre categorization
- Visual seat map with real-time availability
- Row and seat validation
- Booking conflict prevention
- Real-time seat availability
- Booking confirmation with reference numbers
- Booking cancellation support
- Password hashing with bcryptjs
- JWT token authentication
- Input validation and sanitization
- Rate limiting on API endpoints
- CORS configuration
- Bootstrap 5 integration
- Mobile-first approach
- Touch-friendly seat selection
- Adaptive layouts
- Complete dark/light mode implementation
- CSS custom properties (variables)
- Theme persistence in localStorage
- Smooth transitions
- Optimized React components
- Database indexing for queries
- Efficient state management
- Lazy loading support
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/me- Get current user
GET /api/movies- Get all moviesGET /api/movies/:id- Get movie by ID
GET /api/movies/:movieId/showtimes/:showtimeId- Get showtime details
POST /api/bookings- Create bookingGET /api/bookings/my-bookings- Get user bookingsDELETE /api/bookings/:id- Cancel booking
Frontend:
npm start # Start development server
npm run build # Build for production
npm test # Run tests
npm run eject # Eject from CRABackend:
npm start # Start production server
npm run dev # Start development server with nodemon
npm run seed # Seed database with sample data- Database Connection: Ensure MongoDB is running and connection string is correct
- Port Conflicts: Make sure ports 3000 (frontend) and 5000 (backend) are available
- Environment Variables: Check that all required environment variables are set
Enable debug logging by setting:
DEBUG=cineflix:*ISC License - see LICENSE file for details
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
For support and questions, please open an issue in the GitHub repository.
Built with β€οΈ using React, Node.js, Express, and MongoDB