Skip to content

developer2507/FastAPI_Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Auth Starter

Requirements

  • Python 3.11+
  • PostgreSQL running at localhost:5432 with user postgres, password admin, database test_db

Setup

# Create venv
python -m venv .venv

# Activate venv
.venv/Scripts/activate

# Install Libraires
pip install -r requirements.txt


# Create DB schema automatically on first app start (or run the one-liner below)
# python -c "from app.db.session import Base, engine; from app.db import models; Base.metadata.create_all(bind=engine)"

# Run API
uvicorn app.main:app --reload

Auth

  • Register: POST /auth/register with JSON { email, username, password, role? }
  • Login: POST /auth/login with form fields username, password
  • Protected usage: Include Authorization: Bearer <token> header

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages