FastAPI backend with JWT auth (cookie-based) + plain HTML/CSS/JS frontend.
- Backend — FastAPI, SQLAlchemy, joserfc, passlib (argon2)
- Frontend — Vanilla HTML/CSS/JS (no build step)
- DB — SQLite (swap
DATABASE_URLfor Postgres in prod)
git clone <repo-url>
cd <project>
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env # fill in your valuescd app
uvicorn main:app --reloadOpen http://localhost:8000
| Method | Route | Description |
|---|---|---|
| POST | /register |
Create account |
| POST | /login |
Login, sets cookie |
| GET | /verify |
Get current user |
| POST | /log-out |
Clear cookie |
├── app/
│ ├── main.py # routes
│ ├── auth.py # JWT logic
│ ├── crud.py # DB operations
│ ├── models.py # SQLAlchemy models
│ ├── schema.py # Pydantic schemas
│ ├── utils.py # password hashing
│ ├── database.py # DB session
│ └── config.py # settings via .env
└── frontend/
├── index.html
├── app.js
└── styles.css