Skip to content

This project implements a User-based REST API with a well-structured backend architecture. The application is organized into separate modules for database handling, models, schemas, services, routers, and configuration.

Notifications You must be signed in to change notification settings

Nevin100/FastAPI-SQLAlchemy-Revision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ FastAPI – SQLAlchemy Revision

A complete revision-focused backend project built using FastAPI and SQLAlchemy, demonstrating a clean, modular, and scalable REST API architecture.

This repository is intended to practice and showcase industry-level backend structure, proper separation of concerns, and RESTful API development using Python.


πŸ“Œ Project Description

This project implements a User-based REST API with a well-structured backend architecture.
The application is organized into separate modules for database handling, models, schemas, services, routers, and configuration.

⚠️ This project does not include authentication.
The main focus is on application structure, database integration, and clean code practices.


🧠 Concepts & Learnings

  • FastAPI application structure
  • Modular backend architecture
  • SQLAlchemy ORM usage
  • SQLite database integration
  • Pydantic models for data validation
  • API Routers for clean endpoint separation
  • Service layer for business logic
  • RESTful API design principles

πŸ—‚οΈ Folder Structure

app/
β”‚
β”œβ”€β”€ database/
β”‚ └── database.py # Database connection & session management
β”‚
β”œβ”€β”€ models/
β”‚ └── user.py # SQLAlchemy ORM models
β”‚
β”œβ”€β”€ schemas/
β”‚ └── user.py # Pydantic request/response schemas
β”‚
β”œβ”€β”€ services/
β”‚ └── user_service.py # Business logic layer
β”‚
β”œβ”€β”€ routers/
β”‚ └── user.py # User API routes
β”‚
β”œβ”€β”€ config/
β”‚ └── config.py # Application configuration
β”‚
β”œβ”€β”€ main.py # FastAPI application entry point

πŸ› οΈ Tech Stack

  • Python
  • FastAPI
  • SQLAlchemy
  • SQLite
  • Pydantic
  • Uvicorn
  • API Routers

πŸ” API Functionality

This REST API supports standard CRUD operations for users:

  • Create user
  • Fetch user details
  • Update user information
  • Delete user
  • Input & output validation using Pydantic
  • Clean separation between routes, services, and database logic

▢️ Running the Project Locally

1️⃣ Clone the Repository

git clone https://github.com/Nevin100/FastAPI-SQLAlchemy-Revision.git
cd FastAPI-SQLAlchemy-Revision

2️⃣ Create & Activate Virtual Environment

python -m venv venv
source venv/bin/activate     # Windows: venv\Scripts\activate

3️⃣ Install Dependencies

pip install fastapi uvicorn sqlalchemy pydantic

4️⃣ Start the Development Server

uvicorn app.main:app --reload

Open API Docs

Swagger UI:

http://127.0.0.1:8000/docs

ReDoc:

http://127.0.0.1:8000/redoc

About

This project implements a User-based REST API with a well-structured backend architecture. The application is organized into separate modules for database handling, models, schemas, services, routers, and configuration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages