- Python 3.11+
- PostgreSQL running at
localhost:5432 with user postgres, password admin, database test_db
# 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
- 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