Skip to content

Laravel-powered To-Do REST API with MySQL and JWT authentication: tasks, labels, priorities, search and pagination. Fully dockerized (Docker Compose), ships with migrations & seeders, ready for local dev and deploy.

License

Notifications You must be signed in to change notification settings

lifan2029/api-todo-list

Repository files navigation

🗒️ Todo List API

A simple REST API for managing tasks (todo list), built with Laravel 10 (PHP 8.2) and Docker.
This project is a pet project and serves as a demonstration of REST API architecture with online Postman documentation.


🚀 Tech Stack

  • PHP 8.2
  • Laravel 10
  • Docker / Docker Compose
  • MySQL
  • Composer
  • Postman (for API documentation)

🧩 Features

  • Create new tasks
  • Retrieve all tasks
  • Update and delete tasks
  • Mark tasks as completed / uncompleted
  • Filter tasks by status

⚙️ Installation & Setup

1. Clone the repository

git clone https://github.com/lifan2029/api-todo-list.git
cd api-todo-list

2. Copy environment file

cp .env.example .env

3. Configure .env variables

DB_CONNECTION=mysql
DB_HOST=laravel-db
DB_PORT=3306
DB_DATABASE=api_todo_list
DB_USERNAME=todolistuser
DB_PASSWORD=ortERSAkiEntALMaXI

4. Build and start Docker containers

docker compose up -d --build

5. Install Laravel dependencies

docker compose exec laravel-php composer install

6. Generate application key

docker compose exec laravel-php php artisan key:generate

7. Run database migrations

docker compose exec laravel-php php artisan migrate

🧠 API Endpoints

Method Endpoint Description
GET /api/v1/task Get all tasks
POST /api/v1/task/store Create a new task
PUT /api/v1/task/update/{id} Update a task
PUT /api/v1/task/complete/{id} Complete a task
DELETE /api/v1/task/delete/{id} Delete a task

Example request (create a task):

POST /api/v1/task/store
{
  "title": "Build a demo project",
  "description": "Create an API for a todo list",
  "due_date": "01.09.2025 17:51",
  "priority_id": 1
}

📘 API Documentation (Postman)

The online Postman collection is available here:
👉 Open Postman Collection


🔧 Useful Commands

docker compose exec laravel-php php artisan migrate:fresh --seed   # Recreate DB with seed data
docker compose exec laravel-php php artisan test                   # Run tests
docker compose logs -f laravel-php                                 # View container logs

✨ Author

Developed by lifan2029 — Fullstack developer.
If you like this project, feel free to ⭐ star it on GitHub!

📧 [email protected]


🧠 This project was created for demonstrate Laravel API development with Docker.

About

Laravel-powered To-Do REST API with MySQL and JWT authentication: tasks, labels, priorities, search and pagination. Fully dockerized (Docker Compose), ships with migrations & seeders, ready for local dev and deploy.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages