/task_management_system

Task Management System

Primary LanguagePython

Task Management System API



Contributors Forks Stargazers Issues Twitter



Table of Contents
  1. About the project
  2. Usage
  3. Contact

back to top


About The Project

The API is a simple and efficient task management service built with Flask. The platform enables users to manage their tasks seamlessly and reliably. With the API, organizing your tasks becomes effortless, ensuring a smooth experience for individuals.

Features

  • Secure Authentication: The API offers robust user authentication using JWT tokens, ensuring that your task data remains safe and accessible only to you.

  • Task Management: Create, read, update, and delete tasks effortlessly with our user-friendly endpoints. Whether it's a personal to-do list or a project task, managing tasks is quick and hassle-free.

  • Data Persistence: All task data is securely stored in a database, ensuring data integrity and reliability.

  • Input Validation: Strong input validation ensures that the data you enter is accurate and secure, maintaining the integrity of your task management system.

back to top

Built With:

Python Flask Sqlite Postgres


back to top

Usage

To get a local copy up and running, follow the steps below.

Prerequisites

Python3: Get Python

Installation

  1. Clone this repo

    git clone https://github.com/engrmarkk/task_management_system.git
  2. Navigate into the directory

    cd task_management_system
  3. Create a virtual environment

    python -m venv your_venv_name
  4. Activate the virtual environment on powershell or cmd

    your_venv_name\Scripts\activate.bat

    On Bash ('Scripts' for windows, 'bin' for linux)

    source your_venv_name/Scripts/activate.csh
  5. Install project dependencies

    pip install -r requirements.txt
  6. Create .env file

  7. Place your SECRET_KEY, JWT_SECRET_KEY, and DATABASE_URI (for postgresql, then a postgres link) If you want to use use sqlite, you can ignore the DATABASE_URI in the env file (omit it)

    DATABASE_URI=<your_postgresql_link>
    SECRET_KEY=<your_secret_key>
    JWT_SECRET_KEY=<your_jwt_secret_key>
  8. Set your flask app

    set FLASK_APP=runserver.py

    on linux or macOS

    export FLASK_APP=runserver.py
  9. Create database (using flask migrate)

    flask db init ( This will create a migration file)
    flask db migrate
    flask db upgrade (This  will create the db along with the tables)
  10. Run App

 python runserver.py
  1. Use the link generated on the terminal to access the endpoints
      http://127.0.0.1:5000

Project structure

├── README.md
├── .gitignore
├── app_config
|   ├── __init_.py
|   ├── Your_sqlite_database
├── endpoints
│   ├── __init__.py
│   ├── auth.py
|   |   ├──__init__.py
│   └── users.py
|   |  ├──__init__.py
├── models
|   ├── __init_.py
├── app_config
|   ├── __init_.py
├── sockets
|   ├── __init_.py
├── utils
|   ├── __init_.py
├── extensions
|   ├── __init_.py
├── your_venv_name
├── .env
├── runserver.py
└── requirements.txt

Endpoints


POST (Register) http://127.0.0.1:8000/api/v1/auth/register

REQUEST

{
  "username": "string",
  "password": "password"
}

RESPONSE (Success)

 {
    "message": "User created successfully"
}

RESPONSE (Error)

 {
    "message": "Username already exist"
}

POST (Login) http://127.0.0.1:8000/api/v1/auth/login

REQUEST

{
  "username": "string",
  "password": "string"
}

RESPONSE (Success)

  {
    "access_token": "eyJhbGciOiJIUzIEyM..................."
  }

RESPONSE (Error)

 {
    "message": "User does not exist"
}

To login with your key,

Provide the access token on postman auth (Bearer Token)

`

GET (Get tasks) http://127.0.0.1:8000/api/v1/user/get_tasks
@jwt_required

RESPONSE

  {
    "tasks": [
        {
            "completed": true,
            "date_created": "19-May-2024 22:20:15",
            "id": "0abbf4f4131240dc85888bbc1bd4dc3e",
            "task_content": "Write code, Buy foodtuffs, Gym, and Sleep",
            "title": "Welcome Task2"
        },
        {
            "completed": false,
            "date_created": "19-May-2024 22:18:31",
            "id": "66d9c4c3f2bd4b2db2fd9cae4df61161",
            "task_content": "This is a welcome task",
            "title": "Welcome Task"
        }
    ]
}

GET (Get one Task) http://127.0.0.1:8000/api/v1/user/get_one_task/d8ae7e5dea934f3d9f02c2c3f49f2c72
@jwt_required

RESPONSE

  {
    "message": "Task found",
    "task": {
        "completed": false,
        "date_created": "19-May-2024 22:21:06",
        "id": "d8ae7e5dea934f3d9f02c2c3f49f2c72",
        "task_content": "Write code, Buy foodtuffs, Gym, and Sleep",
        "title": "Today Todo"
    }
}

RESPONSE (Error)

 {
    "message": "No task found"
}

POST (Create Task) http://127.0.0.1:8000/api/v1/user/create_task
@jwt_required

REQUEST

{
    "title": "My List3",
    "content": "Write code, Go out"
}

RESPONSE

 {
    "message": "Task created successfully"
}

PATCH (Update Task) http://127.0.0.1:8000/api/v1/user/update_task/0abbf4f4131240dc85888bbc1bd4dc3e
@jwt_required

REQUEST

{
    "content": "Write code, Buy foodtuffs, Gym, and Sleep",
    "completed": true
}

RESPONSE (Success)

 {
    "message": "Task updated successfully"
}

RESPONSE (Error)

 {
    "message": "No task found"
}

PATCH (Update Task) http://127.0.0.1:8000/api/v1/user/delete_task/d8ae7e5dea934f3d9f02c2c3f49f2c72
@jwt_required

RESPONSE (Success)

 {
    "message": "Task deleted successfully"
}

RESPONSE (Error)

 {
    "message": "No task found"
}

back to top


Contact

Adeniyi Olanrewaju - @iamengrmark - adeniyiboladale@yahoo.com

Project Link: Task Management System API

Live Link (BASE URL): https://task-management-system-cy45.onrender.com/api/v1/

Postman Documentation: Postman DOC

back to top