Skip to content

maxmadknight/test_task_app

Repository files navigation

Todo List API

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

Requirements

  • PHP 8.1+
  • Laravel 8+
  • Docker

Installation

  1. Clone the repository
  2. Run composer install
  3. Set up your .env (the docker data connection is already in the example file, so just cp .env.example .env, yes, in a real project I did not act like that)
  4. Start the application with Sail or Compose
    1. Docker Compose
      1. docker-compose up -d
      2. docker-compose exec laravel.test sh and in container php artisan migrate --seed
    2. Laravel Sail
      1. ./vendor/bin/sail up -d
      2. ./vendor/bin/sail artisan migrate --seed

Endpoints

all except login and register endpoint are with auth check, auth by token Authorization: Bearer %token%

  • POST /register - create new user
  • POST /login - auth user
  • POST /logout - logout user
  • GET /user - get info about current auth user
  • GET /tasks - Retrieve a list of tasks (top level only) with filters and sorting
  • POST /tasks - Create a new task
  • GET /tasks/{id} - Get specific task data with subtasks info
  • PUT /tasks/{id} - Update a task
  • DELETE /tasks/{id} - Delete a task
  • PATCH /tasks/{id}/complete - Mark a task as complete

Api documentation

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

Tests

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

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages