A lightweight authentication system built with FastAPI, featuring JWT, verification codes, blacklist, password reset/change and more.
- 🔑 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
- 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
Clone the repository:
git clone https://github.com/AbolfazlKameli/FastAuth.git
cd FastAuthCreate your own .env file
cp .example.env envs/.dev.envCreate a virtual environment & install dependencies:
pipenv install Run migrations with Alembic:
alembic upgrade headusing docker:
docker compose upStart the FastAPI server:
uvicorn src.main:app --reloadStart the Celery worker:
celery -A src.infrastructure worker -l info Once running, open your browser at:
- Swagger UI →
http://localhost:8000/docs - ReDoc →
http://localhost:8000/redoc
- Docker support
- Rate limiting & IP-based throttling
- Social login (Google, GitHub, etc.)
- Automatic tests
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.