Skip to content

muzykaVP/movie-house

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎥MOVIE HOUSE🎥

A RESTful cinema project, where you can search movies and their sessions, add movie tickets to a shopping cart and purchase them later as a user. As admin, you can manage data records located in a remote database.

✨Features✨

  • Register as a user
  • Login/logout as a admin/user
  • General rights for user and admin:
    • Display all available cinema halls/movie sessions/movies
  • User rights:
    • Display your orders/shopping cart
    • Create new order
    • Update shopping cart
  • Admin rights:
    • Display user by his email
    • Add new cinema hall/movie session/movie
    • Delete movie sessions
    • Update movie sessions
  • User input validations for register/login
  • Sensitive data encryption

🧬Project structure🧬

N-tier architecture with Spring

Project built by using N-tier architecture divides application into logical layers:

  • Frontend Framework: Frontend framework sends a request to the server it reaches our controller.
  • @RestController: Separates the UI from the backend logic. The controller has a service component autowired which can help him return the request.
  • @Service: Interacts with data through an autowired repository and contains the business logic.
  • @Repository: Interacts with the chosen way to persist data. Another name for this layer is the data access layer.
  • Data tier: data store/retrieve layer.

DB structure

img.png

👩‍💻Technologies👩‍💻

  • Apache Maven
  • JDK 17
  • MySQL 8
  • Tomcat 9
  • JPA, Hibernate
  • Spring Core, Spring Web, Spring Security

🛠Setup guide🛠

First of all fork this repository. Clone it and create new project from version control in IntelliJ IDEA.

To run this project locally on your computer, you need to make sure you have the following components installed:

Application configuration

Create a new MySQL connection

Using MySql Workbench create a new connection by following this guide.

Create a new DB

To create a new DB follow this guide. You don't need to create a new tables in DB, Hibernate will do it for you.

Connect DB to project

To connect the created database to the project follow this guide. Fill in the fields with the values that you specified when creating the connection in MySql Workbench. Also you need to edit fields in file db.properties according to previously entered values.

db.driver= YOUR_DRIVER
db.url= YOUR_DATABASE_URL
db.user= YOUR_USER_NAME
db.password= YOUR_PASSWORD

Tomcat server setup

For TomCat server setup follow this configuration guide.

🚀You are ready to go!🚀

To test application functionality with different access rights its better to use Postman, where you can send API requests to controllers end-points and get responses.

You can register as user or log in as default user without registration if you enter:

or log in as admin entering:

List of available end-points:

  • POST: /register - all
  • GET: /cinema-halls - user/admin
  • GET: /movie-sessions/available - user/admin
  • GET: /movies - user/admin
  • POST: /cinema-halls - admin
  • POST: /movies - admin
  • POST: /movie-sessions - admin
  • PUT: /movie-sessions/{id} - admin
  • DELETE: /movie-sessions/{id} - admin
  • GET: /users/by-email - admin
  • GET: /orders - user
  • POST: /orders/complete - user
  • PUT: /shopping-carts/movie-sessions - user
  • GET: /shopping-carts/by-user - user

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages