Skip to content

erickgnclvs/flask-movie-app

Repository files navigation

Flask Movie App

Flask Movie App is a simple movie search application built using Flask and the TMDB API. It allows users to search for movies and series by title and displays information such as the titles's release year, genre and plot. The app also allows users to register, login, change password, and add or remove movies/series from their favorites list.

This project was created as a final project for the Harvard CS50 course.

You can view a video demo of the project:

MY VIDEO SNAPSHOT

Installation

To install the dependencies, run:

pip install -r requirements.txt

Usage

To start the application, run:

python app.py

This will start the Flask development server. You can then access the application by navigating to http://localhost:5000 in your web browser.

Dependencies

Flask Movie App requires the following dependencies:

  • Flask==2.2.2
  • Flask-Session==0.4.0
  • Flask-SQLAlchemy==3.0.2
  • Jinja2==3.1.2
  • MarkupSafe==2.1.1
  • requests==2.28.1
  • SQLAlchemy==1.4.42
  • tmdbsimple==2.9.1
  • Werkzeug==2.2.2

These dependencies are listed in the requirements.txt file and can be installed using pip.

User Functions

Flask Movie App offers the following functions to users:

  • Register: Users can register for an account to use the app.
  • Login: Users can log in to their account.
  • Change Password: Users can change their password after logging in.
  • Search Movies: Users can search for movies by title using the search bar on the home page.
  • Add to Favorites: Users can add movies to their favorites list by clicking on the heart icon.
  • Remove from Favorites: Users can remove movies from their favorites list by clicking on the red heart icon.

App structure:

/home /register /login /forgotpassword /changepassword /search /favorites /add /delete /logout

Pseudocode

This is how I started developing it.


initiate frameworks
initiate api - tmdbsimple
initiate database - sqlalchemy
initiate session - flask session

/home - display a search box redirecting users to /search
if user is logged in:
 /home
else:
 /login
 if user has signed up:
  /home
 else:
  /register

/register - display a form for registering
form with name, username, thing you love most(secretanswer), password and password confirmation
insert data in database
if succesful:
 /home
else:
 error

/login - display a form for loggin in
form with username and password
check database to match data
if succesful:
 /home
else:
 error

/search - display the results of the search with a add button redirecting to /add
grab data from forms
search through movies API for terms
if search finds result:
 display them
else:
 error

/favorites - display favorites each with a delete button redirecting to /delete
search data from database
if found:
 display favorites
else:
 error

/add - add movie to database
grab data from movie brought by /search
try:
 add data in favorites
 /favorites
except:
 error

/delete - delete movie from database
grab data from movie brough by /favorites
try:
 delete data from favorites
except:
 error

/changepassword - in navbar user will have a button that redirects here
display a form asking for old password, newpassword and newpassword confirmation
if data match database data:
 success!
 /home
else:
 error

/logout - in navbar user will have a button that redirects here
disconnect user
/home

About

my first project made from scratch

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published