Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

tiagogmfreire/make_magic

Repository files navigation

Make Magic API

Backend API for managing Harry Potter characters.

Built with PHP 7.4 and Lumen 8.x.

Configuration

You need a PHP development as described in Lumen documentation with composer installed.

Then run the follow commands in your terminal:

composer install
cp env.example .env
php artisan key:generate

Edit the .env file with your database configuration (you may use the postgres service from the included docker-compose)

With the database configuration done run the migrations with:

php artisan migrate

For local development there is a run.sh script with the following command to run the PHP localserver:

php -S localhost:80 -t public

Docker

There is a docker image based on the official PHP image and a docker-compose.yml file.

Docker-compose

The included docker-compose file has a postgres service based on the official image that you can use by defining the variables POSTGRES_DB, POSTGRES_USER and POSTGRES_PASSWORD in the .env file and then running :

docker-compose up -d postgres

Testing

There are Unit and Integration testing scripts in the /tests folder using Lumen's PHPUnit native integration.

You can run them using the a phpunit.sh shell script that calls the PHPUnit file from the vendor folder.

API Documentation

You can generate the documentation with Swagger UI by running the following:

php artisan swagger-lume:generate

The HTML Swagger UI documentation will be available in both "/" and "/api/docs" routes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published