Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

πŸš€ FastAPI Backend RD Lab

A collection of backend projects built using FastAPI, demonstrating the progression from basic API development to a structured, authentication-based backend system.


Infrastructure & Automation

See workflow: .github/workflows/

  • Containerization: Fully containerized using Docker and docker-compose for consistent multi-environment deployments.
  • CI/CD Pipeline: Automated GitHub Actions workflows configured with path-filtering to independently run Pytest and Flake8 linting for isolated micro-projects.

Quick Start

Spin up the entire environment (API and Database) in one command: docker-compose up --build

πŸ”„ CI/CD Flow

  1. Developer pushes code to GitHub
  2. GitHub Actions pipeline triggers
  3. Dependencies installed
  4. Tests executed (pytest)
  5. Linting performed (flake8)
  6. Docker image built

πŸ“Œ Overview

This repository contains two FastAPI projects showcasing different levels of backend development:

  1. πŸ“š Books API (Beginner Level)
  2. βœ… Todo API (Intermediate Level with Authentication & Database)

The goal of this repository is to demonstrate practical backend concepts such as:

  • API design
  • Data validation
  • Authentication
  • Database integration
  • Modular architecture

🧩 Projects Included


πŸ“š 1. Books API (Beginner)

A simple REST API built using FastAPI with in-memory data storage.

πŸ”Ή Features

  • CRUD operations for books
  • Request validation using Pydantic
  • Path & query parameter handling
  • Basic API structure

πŸ”Ή Tech Used

  • FastAPI
  • Pydantic

πŸ”Ή Purpose

This project focuses on learning:

  • FastAPI routing
  • Request/response handling
  • Basic API design

βœ… 2. Todo API (Intermediate)

A more advanced backend system with authentication and database integration.

πŸ”Ή Features

  • JWT-based authentication
  • User-specific todos (owner-based access)
  • Full CRUD operations
  • SQLAlchemy ORM integration
  • Dependency injection
  • Modular router-based structure
  • Testable API design

πŸ”Ή Tech Used

  • FastAPI
  • SQLAlchemy
  • Pydantic
  • Uvicorn
  • Pytest

πŸ”Ή Architecture Highlights

  • Separation of concerns (models, schemas, routers)
  • Dependency injection for DB and authentication
  • Secure endpoints with user validation


4. Run the server

uvicorn main:app --reload


πŸ“„ API Documentation

FastAPI provides built-in interactive docs:


πŸ”’ Authentication (Todo API)

All todo endpoints are protected.


πŸ§ͺ Running Tests

pytest -v


πŸ“ˆ Learning Progression

This repository demonstrates:

  • Beginner β†’ CRUD API with in-memory data
  • Intermediate β†’ Authentication + database + modular design

πŸš€ Future Improvements

  • Convert routes to RESTful design (/todos/{id})
  • Add response models for better API control
  • Implement pagination and filtering
  • Add Docker support
  • Deploy to cloud (AWS / Render / Railway)

🀝 Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a new branch
  3. Commit your changes
  4. Push and create a Pull Request

πŸ“œ License

This project is licensed under the MIT License.


πŸ‘¨β€πŸ’» Author

Aranya Majumdar

About

A centralized R&D lab for prototyping advanced FastAPI backend patterns, validating scalable system design decisions, and building reference implementations for high-performance, asynchronous APIs.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages