A simple REST API built with FastAPI to manage tasks.
This project demonstrates basic backend development concepts such as:
- CRUD operations
- Request validation with Pydantic
- Proper HTTP status codes
- Create task
- List all tasks
- Get task by ID
- Update task
- Delete task
- Python
- FastAPI
- Pydantic
- Install dependencies:
pip install -r requirements.txt- Run the server:
uvicorn main:app --reload- Open in browser:
http://127.0.0.1:8000/docs
| Method | Endpoint | Description |
|---|---|---|
| POST | /tasks | Create a task |
| GET | /tasks | List all tasks |
| GET | /tasks/{id} | Get task by ID |
| PUT | /tasks/{id} | Update a task |
| DELETE | /tasks/{id} | Delete a task |
{
"title": "Study FastAPI",
"description": "Build a simple API",
"completed": false
}- 201 → Created
- 200 → Success
- 204 → No Content
- 404 → Not Found
- 422 → Validation Error