Heroflix API
Heroflix is a platform for watching movies online. Heroflix built with Flutter and Laravel. The available feature is only CRUD for movies and users. This API is used to retrieve the list of movies, add new movie, update movie, delete movie, and many more.
Live demo : Not available yet.
Source Code : Available on my GitHub repository.
Preview : Video
Features
- Register
- Login
- Logout
- Get Authenticated User
- List Movies
- Show Movie
- Create Movie
- Update Movie
- Delete Movie
Tech Stack
Prerequisites
Installation
Clone the repository.
1git clone https://github.com/raprmdn/api-heroflix.git
bash
Install the dependencies.
1composer install
bash
Copy the .env.example
file to .env
and set the database connection.
1cp .env.example .env
bash
Generate the application key.
1php artisan key:generate
bash
Run the database migrations.
1php artisan migrate
bash
Usage
Run the development server.
1php artisan serve
bash
api-heroflix.test
on your browser instead.
API Documentation
Register
Register a new user.
Request :
- Method : POST
- Endpoint :
/api/register
- Headers :
- Content-Type : application/json
- Accept : application/json
- Body :
1{ 2 "name": "string", 3 "email": "string", 4 "password": "string", 5 "password_confirmation": "string" 6}
json
Login
Login a user.
Request :
- Method : POST
- Endpoint :
/api/login
- Headers :
- Content-Type : application/json
- Accept : application/json
- Body :
1{ 2 "email": "string", 3 "password": "string", 4 "device_name": "mobile" 5}
json
Logout
Logout a user.
Request :
- Method : POST
- Endpoint :
/api/logout
- Headers :
- Content-Type : application/json
- Accept : application/json
- Authorization : Bearer
{token}
Get Authenticated User
Get the authenticated user.
Request :
- Method : GET
- Endpoint :
/api/me
- Headers :
- Content-Type : application/json
- Accept : application/json
- Authorization : Bearer
{token}
List Movies
Get the list of movies.
Request :
- Method : GET
- Endpoint :
/api/movies
- Headers :
- Content-Type : application/json
- Accept : application/json
- Authorization : Bearer
{token}
Show Movie
Get a movie.
Request :
- Method : GET
- Endpoint :
/api/movies/track/{track_id}
- Headers :
- Content-Type : application/json
- Accept : application/json
- Authorization : Bearer
{token}
Create Movie
Create a new movie.
Request :
- Method : POST
- Endpoint :
/api/movies/create
- Headers :
- Content-Type : application/json
- Accept : application/json
- Authorization : Bearer
{token}
- Body :
1{ 2 "title": "string", 3 "description": "string", 4 "age_restricted": "string", 5 "release_year": "string", 6 "season": "string", 7 "genre": "string", 8 "thumbnail": "string", 9 "staring": "string", 10 "director": "string" 11}
json
Update Movie
Update a movie.
Request :
- Method : PUT
- Endpoint :
/api/movies/{track_id}
- Headers :
- Content-Type : application/json
- Accept : application/json
- Authorization : Bearer
{token}
- Body :
1{ 2 "track_id": "string", 3 "title": "string", 4 "description": "string", 5 "age_restricted": "string", 6 "release_year": "string", 7 "season": "string", 8 "genre": "string", 9 "thumbnail": "string", 10 "staring": "string", 11 "director": "string" 12}
json
Delete Movie
Delete a movie.
Request :
- Method : DELETE
- Endpoint :
/api/movies/{track_id}
- Headers :
- Content-Type : application/json
- Accept : application/json
- Authorization : Bearer
{token}