This Rails app was designed to allow users to search for they're favorite and/or upcoming movies and allow them to keep track of those movies.
Live Demo can be found here.
This app was created by running rails new blockbooster
, which prepared the application to perform as a web app. Json which allows us to parse and generate JSON. Rest Client a simple HTTP and REST client for Ruby which was used to send get request to the movie api's server. Devise allows me to store a user's password securely through a hashing algorithm.
To get started with this application, fork and clone the respository to your hard drive. CD
into the project folder and run bundle install
. Once the gems have been installed, run rake db:setup
to establish and seed the database. Make sure you have postgreSQL installed and already running. Run rails start
once the database has been set up to host the backend on your local server. The api used can be found at The Movies Db which was beginner friendly and allowed for free access to their robust api.
There are 4 models which Task Haven utilizes:
The Favorite
model is a join table between a User
instance and a Movie
instance. A movie can be added to a users favorites through the click of a button. This creates a Favorite
instance which is shown in when the star on the navigation bar is clicked.
The Movie
model handles all of the movies which are gotten from The Movies Db api. They are split by domestic and foreign films. Each category is further split depending on today's date. If a film is after today's date then they are shown apart of the upcoming films section and vice versa.
The User
model handles all aspects of user accounts, including login/signup, and editing information. The Devise gem handles the password encyption in the app.