This API allows you to manage a list of tasks with the following features:
- Create, edit, delete tasks
- Mark tasks as complete
- Filter and sort tasks
- Support for subtasks
- PHP 8.1+
- Laravel 8+
- Docker
- Clone the repository
- Run
composer install
- Set up your
.env
(the docker data connection is already in the example file, so justcp .env.example .env
, yes, in a real project I did not act like that) - Start the application with Sail or Compose
- Docker Compose
docker-compose up -d
docker-compose exec laravel.test sh
and in containerphp artisan migrate --seed
- Laravel Sail
./vendor/bin/sail up -d
./vendor/bin/sail artisan migrate --seed
- Docker Compose
all except login and register endpoint are with auth check, auth by token Authorization: Bearer %token%
POST /register
- create new userPOST /login
- auth userPOST /logout
- logout userGET /user
- get info about current auth userGET /tasks
- Retrieve a list of tasks (top level only) with filters and sortingPOST /tasks
- Create a new taskGET /tasks/{id}
- Get specific task data with subtasks infoPUT /tasks/{id}
- Update a taskDELETE /tasks/{id}
- Delete a taskPATCH /tasks/{id}/complete
- Mark a task as complete
Api generated by the L5-Swagger package and can be viewed without the auth by the path /api/documentation
and the file is in storage/api-docs/api-docs.json
Some test are cannot be checked within running elasticsearch container (for this app, if need we can use some mock
functions)
Basic function are tested with regular setup without docker need by running php artisan test
To perform the testes with elasticsearch you need a running container and remove
the <env name="SCOUT_DRIVER" value="null"/>
from the phpunit.xml
file
This project is licensed under the MIT License.