To setup infrastructure you should follow step described below:
- Run
composer install
in the application dir - Copy .env.example to .env
- Go to dir .docker
cd .docker
and rundocker-compose up -d
- Run
docker-compose exec app php artisan migrate
- Run
docker-compose exec app php artisan db:seed --class="AuthorSeeder"
- Run
chmod -R 777 storage
in app directory to allow write logs.
To start tests u should run command ./vendor/bin/phpunit
inside app container
You can connect to this container using command docker-compose exec app bash
The url of app is http://localhost:8080/
[POST] /api/v1/scan
[GET] /api/v1/books
- accept parameters: from_year, to_year, author_full_name
[GET] /api/v1/cds
- accept parameters: from_year, to_year, author_full_name
[GET] /v1/authors/average
- accepts parameter: author_full_name
All operations of storing data will be logged into file storage/logs/scan.log