Skip to content

samvbk/red-cinema

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎬 Red Cinema β€” Movie Reservation System

A full-stack, production-grade cinema ticketing platform β€” book seats, manage theatres, and browse films with a Netflix-inspired UI.

Backend Frontend Language Database Auth License


πŸ“– Table of Contents


🌟 Overview

Red Cinema is a complete movie reservation system with:

  • πŸ” JWT-based authentication with role-based access control (User, Theatre Admin, Super Admin)
  • πŸŽ₯ TMDB-integrated movie catalog with posters, genres, and director metadata
  • πŸͺ‘ Interactive seat maps with real-time concurrency safety (ReentrantLock)
  • πŸ–₯️ Cinematic UI β€” hero billboards, animated seat grids, and a glassmorphic admin dashboard
  • 🐳 Docker-ready β€” one docker-compose up starts everything in production mode

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Client Browser                     β”‚
β”‚            Next.js 14 App Router (port 3000)           β”‚
β”‚   Zustand Β· React Query Β· Framer Motion Β· Tailwind CSS β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚  HTTP / REST (JWT Bearer)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Spring Boot 3.3 API (port 8080)           β”‚
β”‚         Spring Security Β· JWTFilter Β· JPA / Hibernate  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚  JDBC
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          PostgreSQL 16 (prod) / H2 (dev)               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ›  Tech Stack

Layer Technology
Frontend Next.js 14, TypeScript, Tailwind CSS, Framer Motion
Backend Spring Boot 3.3, Java 21, Spring Security
Auth JWT (jjwt 0.12.6) β€” 15-min access tokens
Database PostgreSQL 16 (prod) Β· H2 in-memory (dev)
ORM Spring Data JPA / Hibernate
State Zustand (client) Β· TanStack React Query (server)
Build Maven (backend) Β· npm (frontend)
Container Docker + Docker Compose
Testing JUnit 5 Β· Mockito Β· MockMvc (backend)

πŸ“ Project Structure

red-cine/
β”œβ”€β”€ backend/          # Spring Boot REST API
β”‚   β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ docker-compose.yml
β”‚   β”œβ”€β”€ pom.xml
β”‚   └── README.md     ← Backend deep-dive
β”‚
β”œβ”€β”€ frontend/         # Next.js 14 App Router
β”‚   β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ next.config.js
β”‚   β”œβ”€β”€ tailwind.config.ts
β”‚   └── README.md     ← Frontend deep-dive
β”‚
└── README.md         ← You are here

πŸš€ Quick Start

Prerequisites

Tool Version
Java 21+
Maven 3.9+
Node.js 18+
Docker 24+ (optional, for PostgreSQL)

1 β€” Start the Backend

cd backend

# Dev mode (H2 in-memory, no Docker needed)
./mvnw spring-boot:run
# API β†’ http://localhost:8080
# H2 console β†’ http://localhost:8080/h2-console

# OR Production mode (PostgreSQL via Docker)
cp .env.example .env     # fill in secrets
docker-compose up --build

2 β€” Start the Frontend

cd frontend

npm install

# Copy environment config
cp .env.local.example .env.local
# Set: NEXT_PUBLIC_API_URL=http://localhost:8080

npm run dev
# App β†’ http://localhost:3000

Default Super-Admin Credentials (dev)

Field Value
Username superAdmin
Password superPassword@123
Email superadmin@redcinema.com

πŸ” Authentication & Roles

The backend issues a signed JWT on login/signup. The frontend stores it in a secure HTTP-only cookie (rc_token) and attaches it as a Bearer token on every API call via an Axios interceptor.

Role Capabilities
ROLE_USER Browse movies, book & cancel own reservations
ROLE_THEATRE_ADMIN All of USER + manage shows for their assigned theatre
ROLE_SUPER_ADMIN Full CRUD β€” movies, theatres, users, shows

Next.js Middleware (src/middleware.ts) enforces role-based routing before any page renders.


⚑ Key Features

πŸŽ₯ Movie Browsing

  • Auto-rotating Hero Billboard (5 featured films, 8 s interval)
  • Horizontal scroll rows with drag support and fade-out edges
  • Movie card hover expansion β€” synopsis, genre pills, and a booking CTA

πŸͺ‘ Seat Booking

  • Interactive seat grid grouped by row (SINGLE / COUPLE / SOFA types)
  • Live availability from ShowSeat.seatStatus
  • ReentrantLock on the server prevents race-condition double-booking
  • Floating Framer Motion cart with real-time total; graceful 409 toast on conflict

πŸ”‘ Admin Dashboards

  • Super Admin β€” movie & theatre CRUD, revenue stats, user management
  • Theatre Admin β€” show scheduling for their assigned venue

🎬 TMDB Integration

  • Auto-fills director, genres, and poster when creating/updating a movie

πŸ“‘ API Overview

Resource Public Endpoints Protected Endpoints
Auth POST /auth/login, /auth/signup β€”
Movies GET /api/movies/all, …/{id} POST / PUT / DELETE (SUPER_ADMIN)
Theatres GET /api/theatres/all, …/{id} POST / PUT / DELETE / admin (role-guarded)
Shows GET /api/shows/** POST / PUT / DELETE (THEATRE_ADMIN+)
Reservations β€” POST reserve, PUT cancel (USER+)
Users β€” Full CRUD (SUPER_ADMIN only)

πŸ“š Documentation

For deeper technical details, see the individual READMEs:

Directory README What's inside
backend/ πŸ“„ Backend README API reference, auth flow, concurrency model, Docker setup, test coverage
frontend/ πŸ“„ Frontend README Design system, component map, state management, environment config

Built with ❀️ using Spring Boot & Next.js · © 2026 Red Cinema

About

🎬 Full-stack movie reservation system β€” Next.js 14 + Spring Boot 3.3 + PostgreSQL. JWT auth, interactive seat maps, role-based access control, and a Netflix-inspired UI.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors