Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Task API (Phase 1)

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

Tech Stack

  • FastAPI
  • SQLAlchemy
  • Pydantic
  • SQLite
  • Uvicorn

Resources

Task

Defines a todo item.

Fields

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

User

Field Type Description
id integer primary key
email string user email
created_at datetime user creation timestamp

Endpoints

Tasks

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.


Users

POST /users
Create a user.

GET /users/{id}
Retrieve a user.


Rules

  • 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

Concepts Demonstrated

  • REST API design
  • Dependency Injection
  • SQLAlchemy ORM relationships
  • CRUD operations
  • PATCH partial updates
  • Data validation using Pydantic

API Documentation

Swagger UI

Design Notes

Resources

Task - Defines a todo item User

Fields

Task Id - integer - primary key title - string - task name completed - boolean - whether task is done Priority - integer - priority level

User id email created_at

Endpoints

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}

Ruling

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

About

REST API for task management built with FastAPI and SQLAlchemy

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages