cinema-webapp-java-servlet

Cinema Web Application with Java Servlet API :movie_camera:

The Final task of the EPAM external course

This project is a web application implementation of a cinema WebApp using Java Servlet API. In a nutshell, there are movies and their sessions, which you can search for using filters, then select needed one, choose seats and buy tickets. But first, you should sign up/in. After purchase, you can find your tickets on the user ticket page and download them in PDF format. Admin can add/remove new movies and movie sessions as well.

Content :bookmark_tabs:

Introduction :wave:

The system is an online showcase of a single-screen cinema.

There are 3 roles:
The system includes:

Technologies :computer:

How to install/run :gear:

  1. Fork this repository.
  2. Clone the repository on your machine
  3. Make sure you have at least v.10.0.26 of Apache Tomcat Server (may be downloaded from this link) and MySQL Server at least v.8.0.29
  4. Using MySQL Workbench (or another tool), import the database schema and data dump from file cinema-webapp-java/src/sql/cinema_db_{DATE}.sql. IMPORTANT: if the dates and times of the sessions are outdated they will no longer be shown on the session page, so in such case, you need to change the dates of the sessions manually.
  5. If needed, change the Database name and credentials in file cinema-webapp-java/src/main/resources/db.properties
  6. Also be aware of the log files will be saved to E:\\logs folder, so you can change the path in file cinema-webapp-java-servlet/src/main/resources/log4j.properties
  7. Add Tomcat Configuration and Run the app. How to run the project right after downloading:
  8. After running, point your browser to http://localhost:8090/cinema-webapp-java-servlet/.

What was implemented :wrench:

Entity–relationship model of the database :triangular_flag_on_post:

There are entities: Film, Genre, Session, Seat, Ticket, User, and its Role.

View of the database schema

Demonstration :tv:

Firstly, the site is multilingual: Ukrainian and English versions. Everything has been translated, except errors and database data. The user lang option is stored in a cookie file.

Multilang demo

This is the main page where you can see a list of current films. Films list is paginated just like sessions and user tickets are.

Main page demo

The next stop is the Schedule page, where you can see a session schedule and choose which one to buy. Sorting and filtering options help you with that, which are implemented using SQL queries.

Schedule page demo

But only authorized users can buy a ticket, so you have to sign up first. There are backend and frontend (partly) validations, and Google reCaptcha is also used. All fields, except phone number, are required.

Sign up demo

If Google reCaptcha wasn’t checked - the server return error.

Google reCaptcha demo

Let’s try to log out and sign in again. Cookie files save the user role and user id what lets the user stay signed in.

Login and logout demo

After choosing a session, you pick wanted remained seats and then confirm your purchase.

Buy ticket demo

You also may download the ticket in PDF format. (Sending via email wasn’t implemented)

Download PDF ticket demo

Tests :hammer:

Tests were written using the Mockito and JUnit frameworks. More than 50% of code lines are covered.

test coverage

Author :raising_hand_man:

You can get in touch with me on my LinkedIn Profile: LinkedIn Link

You can also follow my GitHub Profile to stay updated about my latest projects: GitHub Follow

If you liked the repo then kindly support it by giving it a star ⭐