A webpage where user can browse theaters information, view movie show times, and book tickets for their preferred show times.
This webpage is built with python, html, css, and sqlite3 to power the page.
Additionally, it used Flask framework, Flask-SQLAlchemy dealing with database, Flask-login, and Jinja syntax to function.
Bootstrap 5 is used in the html.
To run the website on your local machine, follow these steps:
-
Make sure you have the latest version of python installed.
-
Navigate your way to where the project folder is and make sure you're in the folder where main.py is.
-
Run this command in the terminal not Python environment.
pip install -r requirements.txt
This will install all necessary python package to run this program.
In terminal type:
export FLASK_APP=main
Then type:
flask run
Once the server is running, you can access the website at http://127.0.0.1:5000.
Or you could just press the url that showed up in the prompt when you run the program in the terminal.
Cinema3000 offers the following features:
User can register through the register page.
After successfully logging in, the database will record the new user and update the user.csv file.
Check if the user email is in the database or not. Then verify the password.
After logging out, the page will redirect to login page.
The database contains existing accounts. Here are a list of them if you wish to log in using them.
More information except for passwords can be found in user.csv
.
Password | First Name | |
---|---|---|
blackbeard@gmail.com | 12345678 | Edward |
gentleman@gmail.com | 12345678 | Stede |
nathanfoad@gmail.com | 12345678 | Lucius |
daughter@gmail.com | 12345678 | Alma |
nathanfoad@gmail.com | 12345678 | Lucius |
cs50@gmail.com | 12345678 | John |
Of course you can also register a new account.
The home page users can redirect themselves to Theater Page, Current Movies Page, or My Bookings Page by clicking buttons or using navigation tab.
- Browse theaters: User can browse through theater characteristics, including name, number of seats, as well as current movies available for each theater.
- Search movie show times and book tickets:
- Search show times:
- Select the desired date user wish to watch movies and click "Search" button.
- Book tickets:
- Click "Book" button of user's preferred show times.
- Afterward, user will be redirected to another page to select a desired number of tickets. Click "Buy Ticket" after choosing the number.
- Special features
- If there's not enough ticket, the page will reject the transaction and show warning message.
- Search show times:
- Check booking history: Users can check their booking history, accessing booking information.
Cinema3000
├── website
│ ├── instance
│ │ └── database.db
│ ├── static
│ │ ├── user.csv
│ │ ├── theater.csv
│ │ ├── movie.csv
│ │ ├── booking.csv
│ │ ├── screening.csv
│ │ ├── styles.css
│ │ └── image
│ │ ├── booking.png
│ │ ├── movie.png
│ │ └── movie-theater.png
│ ├── templates
│ │ ├── layout.html
│ │ ├── register.html
│ │ ├── login.html
│ │ ├── home.html
│ │ ├── theater.html
│ │ ├── movies.html
│ │ ├── ticket.html
│ │ └── booking.html
│ ├── __init__.py
│ ├── auth.py
│ ├── models.py
│ └── views.py
├── main.py
├── requirements.txt
├── README.md
├── database.dbml
└── LICENSE.txt
Cinema3000
: The name of the project.
website
: A directory contains all the code and files related to the web application.
instance
: A directory contains a SQLite database.
static
: This directory contains all the static files used by the web application, including CSS stylesheets, images, and CSV files.
templates
: This directory contains all the HTML templates used to render the web pages of the application.
__init__.py
: a special file that makes the website
directory a python package.
auth.py
: A file contains code for user authentication and registration.
models.py
: A file contains code for defining and interacting with the database models.
views.py
: A file contains the application logic for handling requests and rendering templates.
main.py
: The main Python script that starts the web server and runs the application.
requirements.txt
: A file lists all the Python packages required by the application.
README.md
: The file contains information on how to set up, run the application, web application features, and more.
database.dbml
: This file is a database model diagram that shows the relationships between the database tables.
LICENSE.txt
: This file contains the license under which the project is released.
This picture shows table relationship in the database.db
.
This project is licensed under the MIT License - see the LICENSE file for details.
The methods my code used is inspired by the flask tutorials by Tech with Tim and Flask SQLAlchemy tutorials by Pretty Printed