A simple API built using FastAPI with features such as a signup, verification, sign in, and log out. It utilizes email verification, JWT, refresh tokens, and a PostgreSQL database. This project is meant to demonstrate authentication flow, token management, and database integration.
- Backend: Python, FastAPI
- Database: SQLAlchemy, PostgreSQL
- Auth & Security: JWT, Passlib
- Migrations: Alembic
- Tooling: Docker
Copy .env.example and fill in the values.
docker compose up --buildThe API will be available at http://localhost:8000, and the docs at http://localhost:8000/docs.
docker compose downAn example .env file is provided. Below are the environment variables contained inside.
DATABASE_URLSMTP_HOSTSMTP_PORTJWT_SECRET
Visit /docs for an interactive Swagger UI.
/auth/refresh requires the refresh token to be pasted into the parameters. The refresh token is returned from logging in.