The Cinema Fake Web App is a full-stack platform for managing and booking movies at an imaginary cinema. This project combines a robust PHP backend with an elegant frontend, based on a custom template that I created from scratch.
- HTML/CSS (with SASS)
- JavaScript
- Swiper.js (JavaScript library)
- Bootstrap 5
- Custom Template (For details on the template, click here)
- PHP OOP
- Package management with NPM and Composer
- Docker (for application containerization)
- User authentication (login/signup/logout)
- Dynamic display of movies and theaters on the index page
- Dynamic display of details for individual movies and theaters
- Booking ("Book Now") with dynamic display of movies, theaters, available shows (date and time), and seats
- Dynamic management of available seats
- Dynamic cart with the ability to remove items
- Dynamic checkout with order preparation and user data (authentication required)
- Payment confirmation with generation of a fictitious ticket in PDF format and email delivery
- Success page with cart clearing
- "Book Now" feature on the index page that redirects to the booking page after selecting a movie and theater
- Generic contact form implemented with PHPMailer
- Dynamic display of the user page, with user information and order history, and the ability to modify user data
- Admin functionalities
If you choose to open the app with Docker, make sure to install the latest version of Docker Desktop
- Start Docker Desktop.
- Clone the Repository: Clone the project repository into your local environment. For example:
git clone https://github.com/pantaleoflavio/BackendTemplateCinema /path/to/htdocs/
- Make sure to create a .env file, or use the one included in this repository and modify it as follows:
DB_HOST=db
DB_NAME=cinema
DB_USER=root
DB_PASS=
SMTP_HOST=hostYouWillUseForEmailTesting
SMTP_USERNAME=your_email@email.com
SMTP_PASSWORD=your_password
SMTP_PORT=587
SMTP_RECIPIENT=your_destination_email@email.com
- On your terminal, mount and start the Docker container. For the first use, you can use these commands:
docker-compose build
docker-compose up
For subsequent uses, to maintain smooth app performance and better efficiency, I recommend this command:
docker-compose down -v; if ($?) { docker-compose build; if ($?) { docker-compose up } }
- After building the Docker Container, run:
cd BackendTemplateCinema
docker exec -it cinema bash
composer install
npm install
This way the Composer and Npm dependencies will be installed directly into the Container, without having to have the various programs installed.
- Open a browser of your choice and navigate to
http://localhost:8080/
for the main application page andhttp://localhost:8081/
for database management.
Ensure that the cinema database exists or is populated; if not, you can open http://localhost:8081/
, click on the cinema
database, click on import
, and import the cinema.sql
file found in the main directory of this project.
- Log in with these credentials:
email: john@dean.com
password: password
or you can create a new user with the signup
feature (if you want to test the Admin dashboard, remember to change the new user's role
in the database).
- Node.js and NPM: Useful for managing front-end dependencies and compiling SASS or other task runners.
- XAMPP: Provides a local environment with PHP, Apache server, and MariaDB database, facilitating the execution and testing of the app.
- Composer: To manage the PHP dependencies of the project.
- Start XAMPP: Start the Apache and MySQL services from the XAMPP Control Panel to have a local server and database operational.
- Clone the Repository: Clone the project repository into your local environment. If your Apache server points to a directory other than htdocs, make sure to clone the project into the correct directory.
git clone https://github.com/pantaleoflavio/BackendTemplateCinema /path/to/htdocs/
- Install Dependencies:
In the main project directory, run the following command to install the front-end dependencies via NPM:
cd /path/to/htdocs/BackendTemplateCinema
npm install
composer install
- Database Configuration:
- Access
http://localhost/phpmyadmin
from your browser. - Import the provided
cinema.sql
file from the project to structure your database.
- Configure the .env File:
- Rename the
.env.exampe
to.env
in the main project directory - Modify the .env file with your specific configurations.
- Start the Application: Open your browser and navigate to http://localhost/BackendTemplateCinema/ to start exploring the app.
- To configure email sending, make sure the SMTP variables in your .env file are set correctly. There is no need to modify the code files directly for this configuration.
This project follows an MVC architecture, with a focus on the OOP approach to organize the application logic. The front-end is based on a custom template that I developed, allowing for a unique and interactive presentation of cinema content.
Additionally, the necessary configuration for using a Docker container has been added.