An open API service indexing awesome lists of open source software.

https://github.com/lakshay1341/cineticket

CineTicket is an enterprise-grade Spring Boot application that provides a comprehensive solution for movie enthusiasts. It seamlessly integrates movie reviews with theater seat reservations, offering a complete platform for users to discover movies, share opinions, and book seats for upcoming shows.
https://github.com/lakshay1341/cineticket

api-development authentication backend bcrypt itextpdf java jwt-authentication movie-review movie-ticket-booking-system mysql postman-collection rest-api s3-bucket spring-boot spring-data-jpa spring-security stripe-payments swagger

Last synced: 9 months ago
JSON representation

CineTicket is an enterprise-grade Spring Boot application that provides a comprehensive solution for movie enthusiasts. It seamlessly integrates movie reviews with theater seat reservations, offering a complete platform for users to discover movies, share opinions, and book seats for upcoming shows.

Awesome Lists containing this project

README

          

# 🎬 CineTicket - Movie Review & Reservation System

[![Java](https://img.shields.io/badge/Java-17-4a4e69?style=for-the-badge&logo=openjdk&logoColor=white)](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
[![Spring Boot](https://img.shields.io/badge/Spring_Boot-3.2.3-4a4e69?style=for-the-badge&logo=spring&logoColor=white)](https://spring.io/projects/spring-boot)
[![MySQL](https://img.shields.io/badge/MySQL-8.0-4a4e69?style=for-the-badge&logo=mysql&logoColor=white)](https://www.mysql.com/)
[![JWT](https://img.shields.io/badge/JWT-0.12.6-4a4e69?style=for-the-badge&logo=jsonwebtokens&logoColor=white)](https://github.com/jwtk/jjwt)
[![Stripe](https://img.shields.io/badge/Stripe-22.0.0-4a4e69?style=for-the-badge&logo=stripe&logoColor=white)](https://stripe.com/)
[![License](https://img.shields.io/badge/License-MIT-4a4e69?style=for-the-badge&logo=opensourceinitiative&logoColor=white)](LICENSE)

**A modern, secure, and scalable RESTful API for movie reviews and theater seat reservations**

🌐 **[Live Demo: https://cineticket.onrender.com](https://cineticket.onrender.com)**

[Overview](#-overview) •
[Features](#-key-features) •
[Demo](#️-frontend-demo) •
[Architecture](#-architecture) •
[Installation](#-installation) •
[API Reference](#-api-reference) •
[Security](#-security) •
[Documentation](#-documentation) •
[Contributing](#-contributing) •
[Contact](#-contact)

## 📋 Overview

**CineTicket** is an enterprise-grade Spring Boot application that provides a comprehensive solution for movie enthusiasts. It seamlessly integrates movie reviews with theater seat reservations, offering a complete platform for users to discover movies, share opinions, and book seats for upcoming shows.

Built with modern Java and Spring technologies, this API implements industry best practices including JWT authentication, role-based access control, Stripe payment integration, PDF receipt generation, email notifications, rate limiting, and comprehensive API documentation.

The system is deployed and fully functional at [https://cineticket.onrender.com](https://cineticket.onrender.com).

## 🖥️ Frontend Demo

| ![Admin Dashboard](docs/gifs/admin.gif) | ![User Experience](docs/gifs/user.gif) |
|:---:|:---:|
| **👨‍💼 Admin Dashboard** | **🧑‍💻 User Experience** |
| *Manage movies, theaters, showtimes, and view reservation data* | *Browse movies, read reviews, select seats, and complete the reservation process* |

## ✨ Key Features

| 🎬 **Movie Platform** | 🎟️ **Reservation System** | 🔒 **Enterprise Security** |
|:---|:---|:---|
| • Browse & search movies
• Rate & review movies
• Manage user reviews
• Movie recommendations | • Theater management
• Showtime scheduling
• Seat selection & booking
• Stripe payment integration
• PDF receipt generation
• Email notifications | • JWT authentication
• Role-based access control
• Rate limiting protection
• Secure transactions |
### 🌟 Advanced Features

| 💳 **Payment Processing** | 📧 **Email Notifications** | 🎫 **Reservation Management** |
|:---|:---|:---|
| • Stripe integration
• Checkout sessions
• Webhook handling
• Receipt generation | • Confirmation emails
• PDF attachments
• Branded templates | • Interactive seat selection
• Status tracking
• Concurrent booking protection |

## 🏗️ Architecture

### Technology Stack

- **Backend**: Java 17, Spring Boot 3.2.3, Spring Data JPA
- **Database**: MySQL 8.0
- **Security**: Spring Security, JJWT 0.12.6
- **API Documentation**: Swagger OpenAPI 3.0
- **Payment Processing**: Stripe API 22.0.0
- **PDF Generation**: iText 5.5.13.3
- **Email Service**: Spring Mail
- **Utilities**: Lombok, Resilience4j, MessageSource
- **Testing**: JUnit 5, Mockito

## 🔍 Installation

### Prerequisites

- Java 17 or higher
- Maven 3.6+
- MySQL 8.0+

### Quick Start Guide

1. **Clone the repository**

```bash
git clone https://github.com/lakshay1341/Movie-Review-System-API.git
cd Movie-Review-System-API
```

2. **Configure the database**

```sql
CREATE DATABASE moviereviewdbupdated;
```

3. **Configure application properties**

Update `src/main/resources/application.properties` with your database credentials, JWT configuration, and Stripe API keys.

> **⚠️ Security Note**: Generate a secure JWT secret using `openssl rand -base64 64` and never commit it to version control.

4. **Set up environment variables**

Create a `.env` file based on the provided `.env.example` with your configuration.

```bash
# Copy the example file
cp .env.example .env

# Edit the .env file with your actual values
# For security, generate a new JWT secret:
openssl rand -base64 64
```

5. **Build and run the application**

```bash
mvn clean install
mvn spring-boot:run
```

6. **Access the application**

- API: [http://localhost:8080](http://localhost:8080)
- Swagger UI: [http://localhost:8080/swagger-ui/index.html](http://localhost:8080/swagger-ui/index.html)

### Default Credentials

The system automatically creates two users on startup:

| Role | Username | Password |
|-------|----------|----------|
| Admin | `admin` | `password` |
| User | `user` | `password` |

## 🔥 API Reference



View Complete Collection

### API Categories


Authentication: 2 Endpoints
Movies: 6 Endpoints
Reviews: 4 Endpoints



Theaters: 6 Endpoints
Showtimes: 7 Endpoints
Seats: 2 Endpoints



Reservations: 6 Endpoints

### 🔑 Authentication



Method
Endpoint
Description
Access




POST
/api/v1/auth/register
Register new user
Public


POST
/api/v1/auth/login
Get JWT token
Public

### 🎬 Movies



Method
Endpoint
Description
Access




GET
/api/v1/movies
Get all movies
Public


GET
/api/v1/movies?search={query}
Search movies
Public


GET
/api/v1/movies/{id}
Get movie by ID
Public


POST
/api/v1/movies
Add movie
Admin


PUT
/api/v1/movies/{id}
Update movie
Admin


DELETE
/api/v1/movies/{id}
Delete movie
Admin

### ⭐ Reviews



Method
Endpoint
Description
Access




POST
/api/v1/reviews/movies/{movieId}
Add review
User Admin


GET
/api/v1/reviews/my-reviews
Get user reviews
User Admin


PUT
/api/v1/reviews/{reviewId}
Update review
Owner Admin


DELETE
/api/v1/reviews/{reviewId}
Delete review
Owner Admin

### 🏛️ Theaters



Method
Endpoint
Description
Access




GET
/api/v1/theaters
Get all theaters
Public


GET
/api/v1/theaters/{id}
Get theater by ID
Public


GET
/api/v1/theaters/search?location={location}
Search theaters
Public


POST
/api/v1/theaters
Add theater
Admin


PUT
/api/v1/theaters/{id}
Update theater
Admin


DELETE
/api/v1/theaters/{id}
Delete theater
Admin

### 📅 Showtimes



Method
Endpoint
Description
Access




GET
/api/v1/showtimes?date={date}
Get showtimes by date
Public


GET
/api/v1/showtimes/movies/{movieId}
Get showtimes by movie
Public


GET
/api/v1/showtimes/theaters/{theaterId}
Get showtimes by theater
Public


GET
/api/v1/showtimes/available
Get available showtimes
Public


POST
/api/v1/showtimes
Add showtime
Admin


PUT
/api/v1/showtimes/{id}
Update showtime
Admin


DELETE
/api/v1/showtimes/{id}
Delete showtime
Admin

### 💺 Seats



Method
Endpoint
Description
Access




GET
/api/v1/seats/showtimes/{showtimeId}
Get all seats
Public


GET
/api/v1/seats/showtimes/{showtimeId}/available
Get available seats
Authenticated

### 🎟️ Reservations



Method
Endpoint
Description
Access




POST
/api/v1/reservations
Create reservation
Authenticated


GET
/api/v1/reservations/my-reservations
Get user reservations
Authenticated


GET
/api/v1/reservations/{id}
Get reservation by ID
Owner Admin


DELETE
/api/v1/reservations/{id}
Cancel reservation
Owner Admin


GET
/api/v1/reservations
Get all reservations
Admin


GET
/api/v1/reservations/reports/revenue
Get revenue report
Admin

## 🔒 Security

| **Security Features** | **Authentication Flow** |
|:---|:---|
| • **JWT Authentication**: Secure token-based authentication
• **Password Encryption**: BCrypt encoding (strength 12)
• **Role-Based Access Control**: User/admin permissions
• **Rate Limiting**: 100 requests per minute
• **Concurrent Access Control**: Pessimistic locking
• **Transactional Operations**: Data integrity
• **Secure Payments**: Stripe integration
• **Environment Variables**: Secure credential management | 1. User registers or logs in with credentials
2. Server validates credentials and returns a JWT token
3. Client includes JWT in Authorization header
4. Server validates token and grants access based on roles

**Example Header:**
`Authorization: Bearer eyJhbGciOiJIUzUxMiJ9...` |

## 📖 Documentation

### API Documentation

| **Swagger UI** | **Postman Collection** |
|:---|:---|
| Interactive API documentation with request/response examples

• [Local Development](http://localhost:8080/swagger-ui/index.html)
• [Production](https://cineticket.onrender.com/swagger-ui/index.html)
• [OpenAPI Specification](https://cineticket.onrender.com/api-docs) | Complete API testing suite with environments

[![Run in Postman](https://img.shields.io/badge/Postman-Run%20in%20Postman-4a4e69?style=for-the-badge&logo=postman&logoColor=white)](https://me3333-6732.postman.co/workspace/4f28700f-ee89-485e-a928-767cd44234f9)

*Also available in `docs/postman` directory* |

### Response Format

All API responses follow a consistent format:

```json
{
"success": true,
"message": "operation.success.message",
"data": {"Response data here"}
}
```

### Postman Collection Features

- **Complete API Coverage**: All endpoints from authentication to reservations
- **Environment Variables**: Pre-configured for development and testing
- **Authentication Handling**: Automatic JWT token management
- **Test Scripts**: Response validation and environment variable extraction
- **Request Examples**: Sample payloads for all operations

## 💻 Contributing

Contributions are welcome! Here's how you can contribute:

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

## 🔗 Related Links

- 🎬 **Original Problem Statement**: [roadmap.sh](https://roadmap.sh/projects/movie-reservation-system/solutions?u=658efb1fae22c12523f4de17)
- 🌐 **Live Demo**: [https://cineticket.onrender.com](https://cineticket.onrender.com)
- 📚 **API Documentation**: [https://cineticket.onrender.com/swagger-ui/index.html](https://cineticket.onrender.com/swagger-ui/index.html)

## 👨‍💻 Contact

**Lakshay Chaudhary**
📧 Email: [lakshaychaudhary2003@gmail.com](mailto:lakshaychaudhary2003@gmail.com)
💼 GitHub: [lakshay1341](https://github.com/lakshay1341)

---


⭐ Star this repository if you find it helpful!



Built with ❤️ by Lakshay Chaudhary