Web stateless app that supports user authentication, authorization, and CRUD operations with app entities built using Spring and Hibernate frameworks. Allows users to send HTTP requests by endpoints(GET, POST, PUT, DELETE) depending on their role.
Application users can have USER or ADMIN roles. USER role assigns automatically to every newly registered user. Below you can observe a list of all endpoints in the app. Each endpoint is presented in the format: http request method, endpoint, role required for access, description.
- POST: /register - (all) - register a new user.
- GET: /cinema-halls - (user/admin) - get all cinema halls.
- POST: /cinema-halls - (admin) - add new cinema hall.
- GET: /movies - (user/admin) - get all the movies in the cinema.
- POST: /movies - (admin) - add new movie to cinema.
- GET: /movie-sessions/available - (user/admin) - get available movies sessions by date.
- POST: /movie-sessions - (admin) - add new movie session.
- PUT: /movie-sessions/{id} - (admin) - update movie session.
- DELETE: /movie-sessions/{id} - (admin) - delete movie session.
- GET: /orders - (user) - get list of orders for user.
- POST: /orders/complete - (user) - complete order and clear user`s shopping cart.
- PUT: /shopping-carts/movie-sessions - (user) - creates ticket for movies session and adds it to current user`s shopping cart.
- GET: /shopping-carts/by-user - (user) - get shopping cart of current user.
- GET: /users/by-email - (admin) - get user by email.
This is a diagram of the application provided to help you understand how it works:
⚪ Java 17
⚪ Spring Web MVC, Spring Security, Hibernate
⚪ MySQL 8.0, Tomcat 9.0.76, Maven
⚪ config - config classes required by Spring, Hibernate
⚪ controller - http controllers
⚪ dao - classes for CRUD operation with database
⚪ dto - classes for providing information in http requests and responses
⚪ exception - custom exceptions
⚪ lib - custom validators for email and password confirmation
⚪ model - entity classes used in the application
⚪ service - classes that provide business logic
⚪ util - utility classes
⚪ db.properties - contains database configuration
⚪ pom.xml - contains maven configuration
⚪ checkstyle.xml - contains checkstyle rules
- Install JDK 17, Tomcat 9.0.50, MySQL, Tomcat
- Clone the repository to local device
- Add Your database configuration to
resources/db.properties
file
- Configure Tomcat
- Build and run the app
- You can use email "[email protected]" and password "admin123" fot authentication as Admin or register new user
- You can test endpoints in Postman