Skip to content

sapk806/auth_api

Repository files navigation

OAuth2 API

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.

Tech Stack

  • Backend: Python, FastAPI
  • Database: SQLAlchemy, PostgreSQL
  • Auth & Security: JWT, Passlib
  • Migrations: Alembic
  • Tooling: Docker

Setup Instructions with Docker

1. Configure environment variables

Copy .env.example and fill in the values.

2. Build and run the containers

docker compose up --build

The API will be available at http://localhost:8000, and the docs at http://localhost:8000/docs.

3. Stop the app

docker compose down

Environment Variables

An example .env file is provided. Below are the environment variables contained inside.

  • DATABASE_URL
  • SMTP_HOST
  • SMTP_PORT
  • JWT_SECRET

How to Use

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published