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.
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.
- 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
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- Python
- FastAPI
- SQLAlchemy
- SQLite
- Pydantic
- Uvicorn
- API Routers
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
git clone https://github.com/Nevin100/FastAPI-SQLAlchemy-Revision.git
cd FastAPI-SQLAlchemy-Revisionpython -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activatepip install fastapi uvicorn sqlalchemy pydanticuvicorn app.main:app --reloadSwagger UI:
http://127.0.0.1:8000/docsReDoc:
http://127.0.0.1:8000/redoc