Giphy Integration is a REST API that allows users to search for GIFs using the Giphy API, save their favorite GIFs, and manage user authentication via OAuth2.
- Docker
- Docker Compose
- Git
To build and run the application, follow these steps:
-
Clone the repository:
git clone git@github.com:dleloutre/giphy-integration.git cd giphy-integration -
Copy the environment configuration file:
cp ./src/.env.example ./src/.env
-
Build and run the Docker containers:
docker-compose up -d --build
-
Install the dependencies:
docker exec -it app composer install -
Set the appropriate permissions for the storage directory:
docker exec -it app chmod -R 777 storage -
Generate the application key:
docker exec -it app php artisan key:generate -
Run the database migrations:
docker exec -it app php artisan migrate -
Install Passport:
docker exec -it app php artisan passport:install -
Seed the database:
docker exec -it app php artisan db:seed
Once the installation is complete, the application should be running and accessible via the configured URL. Don't forget to add your Giphy api key to the .env file. Use the provided endpoints to interact with the API.
The following endpoints are available in the Giphy Integration API:
- Endpoint:
/api/login - Method: POST
- Description: Authenticates the user and provides an OAuth2 token.
- Endpoint:
/api/gifs/search - Method: GET
- Description: Searches for GIFs based on the provided keyword.
- Authorization: Required
- Endpoint:
/api/gifs/{gifId} - Method: GET
- Description: Retrieves a GIF by its ID.
- Authorization: Required
- Endpoint:
/api/users/{userId}/favorite-gifs - Method: POST
- Description: Saves a GIF to the user's favorites.
- Authorization: Required
For detailed API documentation, refer to the Postman Collection.
To run the tests, use the following command:
docker exec -it app php artisan testThe following diagrams are included to illustrate the application flow and data relationships:





