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.
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 .
- Laravel 8 with the last available version at the moment Laravel .
- Laravel Breeze for handle authentication features, Laravel Breeze .
- My custom Laravel wrapper package joslmt/tmdb-laravel-wrapper, to get information about The Movie Database API .
- "brianium/paratest" package to run parallel test.
Some pictures about movies-tmdb web.
Clone the repository and install project dependencies with :
git clone git@github.com:joslmt/movies-tmdb.git
composer install
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=
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.
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.
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
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.
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
The movies-tmdb is open-sourced software licensed under the MIT license.