Simple example of concept web app that follows RESTful API rules and supports user authentication, authorization as well as various CRUD operations, the application also has a division of beneficiaries into roles (USER and ADMIN). Created using Spring & Hibernate.
- Data access layer (DAO).
- Application layer (service).
- Presentation layer (controllers).
User (at first you must register - when registering, a basket associated with the user will be automatically created):
- GET: /orders (display all the orders)
- GET: /shopping-carts/by-user (display the contents of the current user's shopping)
- POST: /orders/complete (complete the current order)
- PUT: /shopping-carts/movie-sessions (add movie session to the shopping cart)
Admin:
- POST: /cinema-halls (add new cinema hall)
- POST: /movies (add new movie)
- POST: /movie-sessions (add new movie session)
- PUT: /movie-sessions/{id} (update movie session with specified id)
- DELETE: /movie-sessions/{id} (delete movie session by id)
- GET: /users/by-email (find user by email)
User and Admin:
- GET: /cinema-halls (display all the cinema halls)
- GET: /movies (display all the movies)
- GET: /movie-sessions/available (display all the available movie sessions)
- Java 17
- Hibernate 5.6.14.Final
- Spring Core 5.3.20
- Spring Web 5.3.20
- Spring Security 5.6.10
- MySQL 8.0.33
- Apache TomCat 9.0.76
- Maven 4.0
- Clone this project from GitHub;
- Install Apache Tomcat version 9.x.x.;
- Install Postman for sending requests;
- Create an empty database using your Database Management Systems;
- In the db.properties change YOUR_URL, YOUR_USERNAME and YOUR_PASSWORD values to the ones you specified when installing MySQL, also change JDBC_DRIVER;
- Add Tomcat configuration;
- Run the project and enjoy !