Skip to content

Repository files navigation

ToDo Application

Simple ToDo List API built with FastAPI and PostgreSQL for educational purposes.

Features

  • Create, read, update, delete tasks
  • Task status management (pending, completed, etc.)
  • Automatic API documentation (Swagger UI at /docs)
  • PostgreSQL database persistence

Setup

  1. Install dependencies:
python3 -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -r requirements.txt
  1. Ensure PostgreSQL is running (default: postgresql://genesis_core:genesis_core@localhost:5432/genesis_core)

  2. Run the application:

uvicorn main:app --reload

API Endpoints

Method Endpoint Description
GET / Welcome message
GET /health Health check
POST /tasks Create a new task
GET /tasks List all tasks
GET /tasks/{id} Get task by ID
PATCH /tasks/{id} Update task
DELETE /tasks/{id} Delete task

Example Usage

# Create a task
curl -X POST http://localhost:8000/tasks \
  -H "Content-Type: application/json" \
  -d '{"title": "Buy groceries", "description": "Milk, eggs, bread", "status": "pending"}'

# List tasks
curl http://localhost:8000/tasks

# Update task
curl -X PATCH http://localhost:8000/tasks/1 \
  -H "Content-Type: application/json" \
  -d '{"status": "completed"}'

# Delete task
curl -X DELETE http://localhost:8000/tasks/1

Interactive Documentation

Visit http://localhost:8000/docs for Swagger UI.

About

Simple Python todo application for experiments with genesis tools

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages