This project is a RESTful API to manage a list of tasks using FastAPI and SQLite.
- Python 3.7 or higher
- pip (Python package manager)
-
Clone this repository: git clone https://github.com/ndresdavila/23bg-todo-api.git cd todo-api
-
Create and activate a virtual environment: python3 -m venv venv source venv/bin/activate
-
Install the dependencies: pip install fastapi uvicorn sqlalchemy
-
Run the server: uvicorn main:app --reload
Open your browser and go to:
http://127.0.0.1:8000/docs
This will open the Swagger UI where you can explore and test the API.
- GET /todos: Retrieve a list of all tasks.
- POST /todos: Create a new task.
Body:{ "title": "Task title", "description": "Optional description", "completed": false }
- GET /todos/{todo_id}: Retrieve a specific task by ID.
- PUT /todos/{todo_id}: Update a specific task by ID.
Body:{ "title": "Updated title", "description": "Updated description", "completed": true }
- DELETE /todos/{todo_id}: Delete a specific task by ID.