An advanced, production-ready authentication system built with FastAPI, SQLAlchemy, PostgreSQL, and Alembic.
This project is created purely for learning backend architecture, and is designed as a clean, scalable template for future real applications (such as the Mendora project).
- 🔐 JWT Authentication (Access + Refresh Tokens)
- 🔄 Refresh Token Rotation
- 🔑 Role-Based Access (Admin / User)
- 🧩 SQLAlchemy ORM Models
- 🛢 PostgreSQL Integration
- 📦 Alembic Migrations
- 🧱 Clean Folder Structure (Industry Standard)
- 🛠 User CRUD Example
- 🔒 Secure Password Hashing (bcrypt)
- 📁 Environment Variable Support (.env)
- FastAPI
- SQLAlchemy ORM
- Alembic (Migrations)
- PostgreSQL
- Python-Jose (JWT)
- Passlib[bcrypt] (Password hashing)
- Pydantic v2
- Uvicorn (Server)
This repository is built for learning and understanding:
- JWT and authentication flow
- Refresh token rotation
- Database architecture with SQLAlchemy
- Alembic migrations
- Role-based authorization
- REST API design
- Folder structure for scalable FastAPI projects
This is a learning-only project.
git clone https://github.com/KarkiGaurav/fasty-auth.git
cd fasty-auth
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
alembic upgrade head
uvicorn main:app --reload
alembic init alembic
alembic revision --autogenerate -m "initial migration"
MIT License
Copyright (c) 2025