Skip to content

The To-Do List API allows users to perform CRUD (Create, Read, Update, Delete) operations on a task list using API key authentication. The API uses MySQL database to store the task list and API keys.

Notifications You must be signed in to change notification settings

Krish-Depani/TODO_list_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

TODO list API

This is a REST API built using the FastAPI library to manage a list of to-do tasks stored in a MySQL database. The API uses authentication and only allows access to users with a valid API key.

Features

  • Create, retrieve, update, and delete to-do tasks.
  • Uses authentication to ensure only authorized users can access the API.
  • Connects to a MySQL database to store task information.

Endpoints

  • GET / Returns a welcome message for authorized users.
  • GET /tasks Retrieve all tasks stored in the database.
  • POST /tasks Add a new task to the database.
  • PUT /task/{task_id} Update an existing task in the database.
  • DELETE /task/{task_id} Update an existing task in the database.

Requirements

  • Python 3.6+
  • Fast-API
  • mysql-connector-python
  • python-dotenv
  • pydantic
  • uvicorn

Installation

  • Run the command below to install necessary modules.
    pip install fastapi mysql-connector-python pydantic python-dotenv uvicorn uvicorn[standard]
    

Database Structure

+---------+-----------------+------+
| task_id | task            | done |
+---------+-----------------+------+
|         |                 |      |
+---------+-----------------+------+

+--------+---------+
| api_id | api_key |
+--------+---------+
|        |         |
+--------+---------+

Usage

Note: Please make sure to have a MySQL database set up and the necessary environment variables defined before running the API.

About

The To-Do List API allows users to perform CRUD (Create, Read, Update, Delete) operations on a task list using API key authentication. The API uses MySQL database to store the task list and API keys.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published