This is a RESTful API for managing a movie catalog.
- Symfony - PHP framework
- MySQL - Database management system
- Docker - Containerization platform
- PHPUnit - Testing framework
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
To run this project, you'll need the following software installed on your machine:
- Docker
- Docker Compose
- Clone this repository to your local machine.
git clone https://github.com/weslleyrichardc/movie-database-api.git
- Navigate into the project directory.
cd movie-database-api
- (Optional) Create the .env.local file for local changes.
cp .env .env.local
- (Optional) Create the docker-compose.override.yml file for local changes.
cp docker-compose.yml docker-compose.override.yml
- Build and start the Docker containers.
docker compose up -d --build
- Install dependencies with Composer:
docker compose exec php composer install
- Create the database.
docker compose exec php bin/console doctrine:database:create
- Create all the tables using the migrations.
docker compose exec php bin/console doctrine:migrations:migrate
- (Optional) Load some test data.
docker compose exec php bin/console doctrine:fixtures:load
You should now be able to access the API at localhost.
- /api/categorias - GET
- /api/categorias - POST
- Request Body
name
- string
- Request Body
- /api/categorias/{id} - GET
- /api/categorias/{id} - PUT
- Request Body
name
- string
- Request Body
- /api/categorias/{id} - DELETE
- /api/filmes - GET
- /api/filmes - POST
- Request Body
title
- stringyear
- stringdirector
- stringsynopsis
- string
- Request Body
- /api/filmes/{id} - GET
- /api/filmes/{id} - PUT
- Request Body
title
- stringyear
- stringdirector
- stringsynopsis
- string
- Request Body
- /api/filmes/{id} - DELETE
To run the automated tests, execute the following command from the project root:
docker-compose exec php vendor/bin/phpunit