The Cinema Management System is a web-based platform designed to handle the complete management of a cinema, including users, movies, schedules, and ticket reservations. The system provides different roles—Admin, Manager, and Customer—each with specific functionalities to ensure a seamless cinema experience.
Admins have the highest level of control and can:
- Manage users, movies, actors, and cinemas.
- Change user roles.
- Add new movies, actors, cinemas, and schedules.
- Delete any resource, including users, movies, or cinemas.
- Perform all actions available to Managers.
Managers handle operational tasks like:
- Adding schedules for movies in cinemas.
- Assigning movies to cinemas.
- Managing auditoriums in cinemas.
Customers can:
- View available schedules and movies.
- Reserve and cancel tickets.
- Manage their accounts, including charging balance and changing passwords.
- View their ticket history.
- All users must authenticate and obtain a Bearer token to make API requests.
- Java 8 or higher.
- A MySQL database set up.
- Maven (to manage dependencies).
- Clone the repository:
git clone https://github.com/Mehrnaz-Sahebi/Cinema-Management-System.git
- Navigate into the project directory:
cd movie-reservation-system
- Set up the MySQL database:
- Go to
src/main/resources/application.properties
and configure the database connection. You will need to add your database URL, username, and password. - Example:
spring.datasource.url=jdbc:mysql://localhost:3306/movie_reservation_system spring.datasource.username=root spring.datasource.password=yourpassword
- Build the project using Maven:
mvn clean install
- Run the application:
mvn spring-boot:run
- Access the Application
- Use an HTTP client (e.g., Postman) to send requests.
The following HTTP requests detail how to interact with the Movie Reservation System based on user roles.
- POST: Authenticate and receive a Bearer token (using
phoneNumber
andpassword
): - Endpoint:
/auth
- Example request body:
{
"phoneNumber": "1234567890",
"password": "yourpassword"
}
Note: Include the Bearer token in the
Authorization
header for all subsequent requests:Authorization: Bearer <your_token_here>
- POST: Register a new user by providing
id
,firstName
,lastName
,email
, andpassword
. By default, the user role will be customer. - Endpoint:
/sign-up
- Example request body:
{
"id": "user123",
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"password": "yourpassword"
}
Note: After signing up, the user role is set to customer by default. This role can be changed:
- By an Admin via the
change-role
endpoint (detailed below).- Manually in the database by updating the
role
field for the user.
-
POST: (Add Resources)
- Endpoint:
/admin/add-movie
- Endpoint:
/admin/add-actor
- Endpoint:
/admin/add-cinema
- Endpoint:
-
PUT: (Add Actors to Movies and Modify User Roles)
-
- Endpoint:
/admin/add-actor-to-movie/{movieTitle}
- Endpoint:
/admin/change-role/{userPhoneNumber}/{role}
- Endpoint:
-
DELETE: (Delete Resources)
- Endpoint:
/admin/delete-user/{phoneNumber}
- Endpoint:
/admin/delete-movie/{movieTitle}
- Endpoint:
/admin/delete-actor/{firstName}/{lastName}
- Endpoint:
/admin/delete-cinema/{cinemaName}
- Endpoint:
-
POST: (Add Schedules and Resources)
- Endpoint:
/manager/add-schedule
- Endpoint:
/manager/add-auditorium
- Endpoint:
-
PUT: (Modify Cinemas)
- Endpoint:
/manager/add-movie-to-cinema/{movieTitle}/{cinemaName}
- Endpoint:
/manager/add-auditorium-to-cinema/{auditoriumName}/{cinemaName}
- Endpoint:
-
GET: (View Tickets and Schedules)
- Endpoint:
/customer/my-tickets
- Endpoint:
/customer/schedules-for-date
- Endpoint:
/customer/schedules-for-cinema/{cinemaName}
- Endpoint:
/customer/schedules-for-movie/{movieTitle}
- Endpoint:
/customer/all-schedules
- Endpoint:
-
POST: (Reserve Tickets)
- Endpoint:
/customer/reserve-ticket/{scheduleId}
- Endpoint:
-
PUT: (Manage Account)
- Endpoint:
/customer/change-password/{oldPass}/{newPass}
- Endpoint:
/customer/charge-account/{amount}
- Endpoint:
-
DELETE: (Cancel Tickets)
- Endpoint:
/customer/cancel-ticket/{ticketId}
- Endpoint:
- Spring Boot: The framework used to build the backend REST API.
- Hibernate: Used for ORM to map Java objects to MySQL database tables.
- Spring Security (OAuth2): Manages authentication and authorization, including OAuth2 for secure login.
- MySQL: The relational database used to store user data, movies, schedules, etc.
This project is licensed under the MIT License. See the LICENSE file for details.
- Mehrnaz Sahebi GitHub Profile