Skip to content

mar-babu/laravel_todo_backend

Repository files navigation

πŸ“ TodoMaster - Laravel Todo App Api

A sleek, productivity-boosting todo application with task management, deadlines, and collaboration features.

PHP Version
Laravel Version
Live Demo


✨ Key Features

βœ”οΈ Create/Update/Delete Tasks
βœ”οΈ Mark Tasks as Complete
βœ”οΈ Secure Validation
βœ”οΈ Clear Completed Tasks by One Click
βœ”οΈ Filter Tasks Status
βœ”οΈ Sunctum Authentication (Login/Register/Logout)
βœ”οΈ Automated Tests (12 Tests Passed)


Apis Documentation For Authenticate and Task Module

//Base Api URL
http://127.0.0.1:8000/api;
or
http://localhost:8000/api;

Register

POST /auth/register create an user
Parameters
name type data type description
name required string N/A
email required string unique string
password integer string N/A
password_confirmation required string N/A
Responses
http code content-type response
201 json []
{
    "status": true,
    "message": "User registered successfully.",
    "token": "1|NZo9LHRD8LD36eBwzP8ZS9KQfXwPpK8tSaaCTqhq8f93781d"
}

Login

POST /auth/login user login
Parameters
name type data type description
email required string unique string
password integer string N/A
Responses
http code content-type response
200 json []
{
    "status": true,
    "message": "User logged in successfully",
    "token": "2|C7rSL7rPMadM4xgj6RPQGbvJiaUdqrHLCIV3r6Ol03696b94",
    "isVerified": false
}

Get All Tasks as List

GET /tasks get all the tasks list through this api

Need authorize Bearer Token

Responses
http code content-type response
200 json []
[
    {
        "id": 4,
        "name": "Onboarding preparation",
        "description": "<p>Set up equipment for new hires starting Monday</p>",
        "status": 0,
        "status_name": "Pending"
    },
    {
        "id": 3,
        "name": "Nutrition consultation",
        "description": "<p>Review meal plans with weight loss clients</p>",
        "status": 2,
        "status_name": "Completed"
    },
    {
        "id": 2,
        "name": "Code review: payment module",
        "description": "<p>Review PR #142 for security vulnerabilities</p>",
        "status": 0,
        "status_name": "Pending"
    },
    {
        "id": 1,
        "name": "Team practice: 5pm",
        "description": "<p>Focus on defensive formations and set pieces</p>",
        "status": 0,
        "status_name": "Pending"
    }
]

Create Task

POST /tasks to create new task
Parameters
name type data type description
name required string N/A
description required string N/A
Responses
http code content-type response
200 json []
{
    "success": true,
    "message": "Task created successfully."
}

Update Task

PUT /tasks/11 to update a task
Parameters
name type data type description
name required string N/A
description required string N/A
Responses
http code content-type response
200 json []
{
    "success": true,
    "message": "Task updated successfully.",
    "data": {
        "id": 11,
        "name": "Reach at ar-techpro.com",
        "description": "<p>To conduct and experience with future technology....<\/p>",
        "status": 0,
        "status_name": "Pending"
    }
}

Individual Task

GET /tasks/12 get individual task
Responses
http code content-type response
200 json []
{
    "data": {
        "id": 12,
        "name": "Do the great job",
        "description": "<p>To conduct and experience with ar-techpro.com</p>",
        "status": 0,
        "status_name": "Pending"
    }
}

Destroy Task

DELETE /tasks/12 delete individual task
Responses
http code content-type response
200 json []
{
    "success": true,
    "message": "Task deleted successfully."
}

Change Task Status (mark as complete)

PUT /tasks/11/status to change status that task would get complete or pending
Parameters
name type data type description
status required string enum value
Responses
http code content-type response
200 json []
{
    "success": true,
    "message": "Task status updated successfully."
}

πŸš€ Quick Start

Prerequisites

  • PHP 8.2+
  • Composer
  • MySQL
# Clone & Setup
git clone https://github.com/mar-babu/laravel_todo_backend.git
cd laravel_todo_backend
composer install
cp .env.example .env
php artisan key:generate

# Configure Database (edit .env)
DB_CONNECTION=mysql
DB_DATABASE=todomaster
DB_USERNAME=root
DB_PASSWORD=

# Run Migrations
php artisan migrate --seed

# Start Server
php artisan serve

# Automated Tests
php artisan test

License

The Laravel framework is open-sourced software licensed under the MIT license.