This is a dockerized MVC application based on Laravel. The main goals were:
- Code that is clean, readable and easy to maintain.
- Organisation of an MVC project.
- Recognize and implement all the patterns/principles possible.
- Code documentation and organization.
- Ensure that the code is tested and ready to deploy to production.
-
API entry endpoint
- verb:
GET
- url:
/api
- description: Returns all the endpoints available in this API.
- verb:
-
List superheroes
- verb:
GET
- url:
/api/superheroes
- description: Returns all superheroes in the database, including all relationships
- verb:
-
Search superheroes
- verb:
GET
- url:
/api/superheroes?name={name-here}
- description: The "superheroes list" endpoint can also handle a search functionality. It was only implemented a search by hero name (real or character) and by publisher.
- verb:
-
Show superheroes details
- verb:
GET
- url:
/api/superheroes/{id}
- description: Show a superhero details
- verb:
-
Update superheroes details
- verb:
PUT
- url:
/api/superheroes/{id}
- description: Edit a superhero details
- verb:
- Docker
- Docker-compose
-
Clone repository to <PATH_TO_REPO_ROOT>
-
Boot and run the docker instance by running the following commands:
docker-compose build
docker-compose up
- Set up and populate the database
docker-compose exec <php_image_name> php artisan migrate:fresh --seed
# e.g.
# docker-compose exec app vendor/bin/phpunit
- Access the API by
http://localhost:8888/api
docker-compose exec <php_image_name> vendor/bin/phpunit
# e.g.
# docker-compose exec app vendor/bin/phpunit