Skip to content

AbolfazlKameli/FastAuth

Repository files navigation

🚀 FastAuth

A lightweight authentication system built with FastAPI, featuring JWT, verification codes, blacklist, password reset/change and more.

✨ Features

  • 🔑 JWT Authentication (access & refresh tokens)
  • 📧 Email verification codes (OTP-style)
  • 🚫 Blacklist system (prevent spamming & abuse)
  • 🔄 Password change & reset flows
  • Async support with FastAPI & SQLAlchemy
  • 🛠 Background tasks powered by Celery
  • 🗄 PostgreSQL database with migrations via Alembic
  • 🧾 Pydantic for request/response validation

🛠 Tech Stack

  • FastAPI: Modern, fast (high-performance) web framework
  • SQLAlchemy: ORM with async support
  • Celery: Distributed task queue for background jobs
  • PostgreSQL: Relational database
  • Alembic: Database migrations
  • Pydantic: Data validation & serialization

⚙️ Installation

Clone the repository:

git clone https://github.com/AbolfazlKameli/FastAuth.git
cd FastAuth

Create your own .env file

cp .example.env envs/.dev.env

Create a virtual environment & install dependencies:

pipenv install 

📦 Database Migrations

Run migrations with Alembic:

alembic upgrade head

▶️ Running the App

using docker:

docker compose up

Start the FastAPI server:

uvicorn src.main:app --reload

Start the Celery worker:

celery -A src.infrastructure worker -l info  

📚 API Documentation

Once running, open your browser at:

  • Swagger UI → http://localhost:8000/docs
  • ReDoc → http://localhost:8000/redoc

🚀 Roadmap

  • Docker support
  • Rate limiting & IP-based throttling
  • Social login (Google, GitHub, etc.)
  • Automatic tests

🤝 Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

About

A simple authentication application written in FastAPI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages