This is a implementation of API using Lumen, Doctrine, Migrations, Swagger, and PHPUnit.
This project use docker-compose.
$ git clone https://github.com/mirandawork/lumen-api.git
$ cd lumen-api
$ docker-compose up --build
Run the commands after all the containers are running.
$ docker-compose exec backend bash
$ cp .env.local .env
$ composer.phar install
$ php artisan doctrine:migrations:migrate
Run phpunit inside the backend(php-fpm) container.
$ ./vendor/bin/phpunit
Run migrations after the phpunit because the database is reset.
$ php artisan doctrine:migrations:migrate
The swagger ui is located in http://localhost:3000/api/documentation.
The swagger.json can be view in http://localhost:3000/docs.
The swagger.json is generated by the libraries darkaonline/swagger-lume and zircote/swagger-php. It is located in storage/api-docs/api-docs.json
- Add the migrations to an entry point in Dockerfile.
- Add more tests.