A RESTful backend API for managing tasks and users built with FastAPI and SQLAlchemy.
This project demonstrates backend fundamentals such as:
- REST API design
- CRUD operations
- relational database modeling
- request validation using Pydantic
- dependency injection in FastAPI
- FastAPI
- SQLAlchemy
- Pydantic
- SQLite
- Uvicorn
Defines a todo item.
| Field | Type | Description |
|---|---|---|
| id | integer | primary key |
| title | string | task name |
| completed | boolean | whether task is done |
| priority | integer | priority level |
| user_id | integer | owner of the task |
| Field | Type | Description |
|---|---|---|
| id | integer | primary key |
| string | user email | |
| created_at | datetime | user creation timestamp |
POST /tasks
Create a new task.
GET /tasks
Retrieve all tasks.
GET /tasks/{id}
Retrieve a specific task.
PATCH /tasks/{id}
Update a task.
DELETE /tasks/{id}
Delete a task.
POST /users
Create a user.
GET /users/{id}
Retrieve a user.
- Title is required
- Title cannot be empty
- Priority is optional
- Completed defaults to
false - ID is auto-generated by the database
- Client sends a header for the user to scope queries
- REST API design
- Dependency Injection
- SQLAlchemy ORM relationships
- CRUD operations
- PATCH partial updates
- Data validation using Pydantic
Task - Defines a todo item User
Task Id - integer - primary key title - string - task name completed - boolean - whether task is done Priority - integer - priority level
User id email created_at
POST - /tasks - Create tasks GET - /tasks - list tasks GET - /tasks/{id} - get one task PATCH - /tasks/{id} - update task DELETE /tasks/{id} - delete task
POST - /user - create a user GET - /users/{id}
Title required Title cannot be empty Priority optional completed defaults to false id auto generated by database Client sends a header for the user to scope queries
