Flixflex is a RESTful API that allows users to register and login, and to browse different movies and Series, view details about them, watch their trailers, and manage favorites list. It is built using Laravel and the TMDb API.
To install Flixflex API, follow these steps:
- Clone the repository:
git clone https://github.com/abdimed/FlixFlex.git
- Install dependencies:
composer install
- Create a new
.env file: cp .env.example .env
- Generate an application key:
php artisan key:generate
- Create a new database and update the .env file with your database credentials
- Migrate the database:
php artisan migrate
- Seed the database with sample data:
php artisan db:seed
- Start the development server:
php artisan serve
Flixflex API has the following endpoints:
Registers a new user with the given details. The request body should contain the fields:
- username: (required)
- password: (required)
- password_confirmation: (required)
Logs in a user with the given credentials. The request body should contain the fields:
- username: (required)
- password: (required)
Returns a list of all titles.
Returns information about the title with the specified ID.
Searches for titles that match the given query. The query string should be provided as a parameter called keyword.
Returns the trailer URL for the title with the specified ID.
Returns a list of all titles that have been favorited by the authenticated user.
Adds the title with the specified ID to the authenticated user's list of favorites.
Removes the title with the specified ID from the authenticated user's list of favorites.
- To run tests use:
php artisan test
, Tests will run on memory using SQLITE. - I chose to create one model Called Title instead of movies or series, the Title records an enum column called
type
that contains the type of the title either movie or serie. - I used Laravel Sanctum for authenfication as it offers a simple way to authenticate.
- Name : Mohammed ABDI.
- Email : mohammed.abdi.dev@gmail.com
- GitHub: https://github.com/abdimed.
- LinkedIn: https://www.linkedin.com/in/mohammed-abdi-86847b1a1/