Skip to content

A project in Software Engineering course. Online Movie Tickets Booking website with Admin and User platform. Read more in docs

Notifications You must be signed in to change notification settings

longtoZ/CineMin

Repository files navigation

CineMin - Cinema Ticket Booking System

A comprehensive, full-stack cinema management and ticket booking platform built with modern web technologies. The system provides a seamless experience for customers to browse movies and book tickets, while offering administrators powerful tools to manage cinema operations.

Overview

CineMin is a complete cinema booking solution consisting of three main components:

  • User Frontend - Customer-facing web application for browsing movies, selecting showtimes, and booking tickets. Find more in user-frontend/README.md
  • Admin Frontend - Administrative dashboard for managing movies, showtimes, bookings, and business analytics. Find more in admin-frontend/README.md
  • Backend API - RESTful API server handling business logic, authentication, and data management. Find more in backend/README.md

Key Features

For Customers

  • Browse current and upcoming movies with detailed information
  • Search and filter movies by genre, rating, and release date
  • View cinema locations and available showtimes
  • Interactive seat selection with real-time availability
  • Multiple payment methods support
  • Apply discount vouchers during checkout
  • Digital tickets with QR codes
  • User profile and booking history management
  • Cinema reviews and ratings

For Administrators

  • Real-time dashboard with business metrics and KPIs
  • Movie management (CRUD operations)
  • Showtime scheduling and management
  • Cinema room configuration and seat layout management
  • Booking oversight and management
  • User account management
  • Promotion and voucher creation
  • Revenue and performance analytics
  • Detailed business reports

Technology Stack

Frontend

  • Framework: React 19.x
  • Language: TypeScript 5.9.x
  • Build Tool: Vite 7.x
  • Routing: React Router DOM 7.x
  • State Management: Redux Toolkit, TanStack Query (React Query)
  • UI Framework: Tailwind CSS 4.x
  • Form Management: React Hook Form with Zod validation
  • Charts: Recharts
  • Icons: Lucide React, React Icons

Backend

  • Runtime: Node.js
  • Database: PostgreSQL (via Neon DB)
  • ORM: Prisma
  • Authentication: JWT + Passport.js (Google OAuth)
  • Caching: Redis
  • API Architecture: RESTful

Project Structure

CineMin/
├── user-frontend/          # Customer-facing web application
│   ├── src/
│   ├── public/
│   ├── Dockerfile
│   └── README.md           # User frontend documentation
├── admin-frontend/         # Administrative dashboard
│   ├── src/
│   ├── public/
│   ├── Dockerfile
│   └── README.md           # Admin frontend documentation
├── backend/                # RESTful API server
│   ├── src/
│   ├── prisma/
│   ├── docs/
│   ├── Dockerfile
│   └── README.md           # Backend API documentation
├── backup/                 # Database backups
├── docker-compose.yaml     # Docker orchestration configuration
├── DOCKER_SETUP.md        # Docker setup guide
└── README.md              # This file

Prerequisites

  • Node.js: 18+ (recommended: 20+)
  • npm: 9+
  • Docker: 20.10+ (for containerized deployment)
  • Docker Compose: 2.0+ (for multi-container setup)
  • PostgreSQL: 14+ (if running without Docker)
  • Redis: 6+ (if running without Docker)

Quick Start with Docker (Recommended)

The easiest way to run the entire application is using Docker Compose:

# Start all services (backend, user-frontend, admin-frontend, redis)
docker-compose up --build

# Or run in background
docker-compose up --build -d

# Stop all services
docker-compose down

Access the applications:

For detailed Docker setup instructions, see DOCKER_SETUP.md.


Manual Setup (Alternative)

If you prefer to run services individually without Docker:

1. Backend Setup

The backend requires Redis and Node.js to run. Follow these steps:

  1. Run Redis using Docker:

    docker pull redis:latest
    docker run -d --name cinemin-redis -p 6379:6379 redis
  2. Configure environment variables:

    Create a .env file in the backend directory with required configuration (see backend README for details).

  3. Install dependencies and run:

    cd backend
    npm install
    npm run dev

The backend API will be available at http://localhost:3000.

For complete backend documentation, see backend/README.md.

2. User Frontend Setup

The user-facing frontend requires Node.js to run:

cd user-frontend
npm install
npm run dev

The user frontend will be available at http://localhost:5173.

For complete user frontend documentation, see user-frontend/README.md.

3. Admin Frontend Setup

The admin dashboard requires Node.js to run:

cd admin-frontend
npm install
npm run dev

The admin dashboard will be available at http://localhost:5174.

For complete admin frontend documentation, see admin-frontend/README.md.

Documentation

Each component has detailed documentation in its respective directory:

Architecture

The application follows a three-tier architecture:

Presentation Layer

  • User Frontend: React-based SPA for customer interactions
  • Admin Frontend: React-based dashboard for administrative operations

Application Layer

  • Backend API: Node.js RESTful API with layered architecture
    • Routes Layer: API endpoint definitions
    • Controllers Layer: Request/response handling
    • Services Layer: Business logic
    • Database Layer: Prisma ORM for data access

Data Layer

  • PostgreSQL: Primary relational database
  • Redis: Caching and session management

Development Workflow

  1. Setup: Clone the repository and install dependencies
  2. Environment: Configure environment variables for each service
  3. Database: Run Prisma migrations to set up the database schema
  4. Development: Start services using Docker Compose or individually
  5. Testing: Run tests for each component
  6. Building: Build production-ready artifacts
  7. Deployment: Deploy using Docker containers

API Authentication

The system uses JWT-based authentication:

  • User Authentication: Email/password or Google OAuth
  • Admin Authentication: Role-based access control
  • Token Management: Automatic token refresh and validation
  • Security: Rate limiting, input validation, and XSS protection

Database

The application uses PostgreSQL with Prisma ORM:

  • Schema Management: Version-controlled migrations
  • Type Safety: Auto-generated TypeScript types
  • Query Optimization: Efficient queries with proper indexing
  • Backup: Regular database backup procedures (see backup directory)

Deployment

Using Docker (Production)

# Build and start all services
docker-compose -f docker-compose.prod.yml up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

Manual Deployment

  1. Build each frontend application
  2. Configure Nginx or similar web server
  3. Set up Node.js environment for backend
  4. Configure PostgreSQL and Redis
  5. Set environment variables
  6. Run database migrations
  7. Start the backend server
  8. Serve frontend static files

Performance

  • Code Splitting: Route-based lazy loading in frontends
  • Caching: Redis for frequently accessed data
  • Query Optimization: Database indexing and efficient queries
  • CDN Ready: Static assets can be served via CDN
  • Rate Limiting: API rate limiting to prevent abuse

Security

  • Authentication: JWT tokens with secure storage
  • Authorization: Role-based access control (RBAC)
  • Input Validation: Server-side validation with Zod
  • SQL Injection Prevention: Prisma ORM parameterized queries
  • XSS Protection: Input sanitization
  • CORS: Configured cross-origin resource sharing
  • HTTPS: SSL/TLS encryption support
  • Rate Limiting: Protection against brute force attacks

Browser Support

All modern browsers are supported:

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is part of a Software Engineering Course.

Support

For issues and questions:

  • Check the documentation in each component's README
  • Review the API documentation for endpoint details
  • Create an issue in the repository

Built for CineMin

About

A project in Software Engineering course. Online Movie Tickets Booking website with Admin and User platform. Read more in docs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published