Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Laravel Movies application. All request to The Movie Database API was made using my own Laravel Wrapper. tmdb-laravel-wrapper

Notifications You must be signed in to change notification settings

joslmt/laravel-movies-tmdb-application

Repository files navigation

movies-tmdb

What is

It's a simple web develop with Laravel 8 that uses The Movie Database API to get detailed data about movies, The Movie Database it's a big web with a lot of thousands movies, series and much more such as actors information.

Some features are, if you're log, you'll could add or remove whatever movies to favourites, in your profile user there're a list of fav movies added.

Also you can see more details about a concret movie by clicking it, details like available videos or an extensive overview.

Project purpose

The main purpose of movies-tmdb was, and are, learn deeper concepts about Laravel like testing, routes, request, how it works or how to do a correct deploy, but the initial idea to do this project was to test my own Laravel API wrapper joslmt/tmdb-laravel-wrapper .

What uses

Screenshots

Some pictures about movies-tmdb web.

moviesFounded

moviesFounded

movieDetails

movieDetails

How to install

Clone the repository and install project dependencies with :

git clone git@github.com:joslmt/movies-tmdb.git

composer install

How to configure

There're a few things to keep in mind after clone and installing dependencies. It's require a new .env, on a Linux terminal, within the main project path, do:

cp .env.example .env

That will create a new .env file with the content of .env.example .

But it's not over, all Laravel projects have an own key, so let's generate one:

php artisan key:generate

Now it's time to configure the database, the project uses MySQL , within .env complete the information relative to your database.

   DB_CONNECTION=mysql
   DB_HOST=
   DB_PORT=3306
   DB_DATABASE=
   DB_USERNAME=
   DB_PASSWORD=

Getting a valid API key from The Movie Database

To get your api key, that makes posible to do request to TMDB, just go to The Movie Database and follow the steps, like register and generate a key.

Testing

It's recommended to have a few tests to ensure the project features and to feel confident with superficial or deeper changes done on the project.

Why test with SQLite

It's just because run faster than testing with MySQL like database, but after all the movies-tmdb also supports testing without uses testing environment file.

Just type the follow to execute all available tests with MySQL.

php artisan test

How to configure

We need another .env file, because the previous .env uses MySQL like database and the project tests uses SQLite, it's necessary a few changes.

cp .env.example .env.testing

Then, create a SQLite database and replace all things relative to database connections with :

touch database/database.sqlite
DB_CONNECTION=sqlite
DB_DATABASE=/absolute/path/to/database.sqlite

Using SQLite it's only necessary two environment variables to make it works.

How to execute

To execute test on a Laravel project we usually use the follow artisan command :

php artisan test

But now we've a new .env just for testing purposes, we do :

php artisan test --env=testing

And we want to filter what test to run, for some reason.

php artisan test --filter FilterTest --env=testing

License

The movies-tmdb is open-sourced software licensed under the MIT license.

About

Laravel Movies application. All request to The Movie Database API was made using my own Laravel Wrapper. tmdb-laravel-wrapper

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published