Skip to content
Felipe Tovar edited this page Feb 24, 2020 · 3 revisions

TheMovieDBftovaro Wiki

Welcome, here you are going to find details about the API, how to use it. Lets begin!.

About

This is an API where you can store movies that are published in TheMovieDB.

Once the movies are stored in our DB, you can easily search and filter the movies.

Installation

First of all, this app was created with Ruby 2.6.4 and Rails 6.0.2.1. We use Postgresql as DB so get that ready before anything, also, we use Node 10.14.1.

After you have cloned the project, go inside the folder and run bundle install, then rails db:create db:migrate db:seed.

Once done, you can start the server with rails s

Auth Token

Before you start using the API, you should know how the requests works here:

First, we use the credentials introduced in Rails 5.2, so you need to have locally a master.key and a credentials.yml, so run rails credentials:edit and add the following tokens:

name token
app_token SMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
moviedb_api_key 5517d20e44bcd2f06c1e1b4f3d986c8b

That should be enough, for more info you can read here: Crendentials

In frontend we have the token hardcoded in a class, I know that is not pretty but I didn't have time to stored in a different way.

You have to send a header like X-Api-Key: SMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c always with each request you do to the server.

Find more about how to use the endpoints here

Testing

This project uses Rspec for testing, we have models, controllers, and services tests, don't forget to check them out!.

To run the tests just run rspec spec

Deployment

This API is currently online and deployed in Heroku and can be used by anybody.

URL: https://moviedbftovaro.herokuapp.com/

Clone this wiki locally