Systemet til håndtering af Fælles Vinindkøb
Find a file
carsten 5be79a7c7a Add simple JWT login for User
Password hashing via pwdlib (argon2id), stateless JWT auth (2h expiry)
delivered as an Authorization: Bearer token, with an OAuth2PasswordBearer
dependency (app/dependencies.py) protecting future routes. Establishes
app/routers/ as the convention for feature routes, explicitly registered
in main.py (no auto-discovery, unlike app/models/).

The first admin user is seeded via an Alembic data migration gated on
SUPERUSER_EMAIL/SUPERUSER_PASSWORD env vars (read at migration-run time
only, never persisted to .env/git) rather than a script or open endpoint,
so a fresh `alembic upgrade head` still succeeds without them. The
migration mirrors the users/organization tables locally instead of
importing the live SQLModel classes, keeping it a stable schema
snapshot; it does import app.core.security.hash_password, a pure
utility with no table-shape dependency.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-27 22:23:25 +02:00
app Add simple JWT login for User 2026-09-27 22:23:25 +02:00
migrations Add simple JWT login for User 2026-09-27 22:23:25 +02:00
scripts Add one-off participant import script for legacy MongoDB data 2026-09-27 19:16:26 +02:00
.env.example Add simple JWT login for User 2026-09-27 22:23:25 +02:00
.gitignore Add one-off participant import script for legacy MongoDB data 2026-09-27 19:16:26 +02:00
.python-version Scaffold FastAPI + SQLModel + Alembic project, Postgres-backed 2026-09-27 15:57:44 +02:00
alembic.ini Scaffold FastAPI + SQLModel + Alembic project, Postgres-backed 2026-09-27 15:57:44 +02:00
CLAUDE.md Scaffold FastAPI + SQLModel + Alembic project, Postgres-backed 2026-09-27 15:57:44 +02:00
pyproject.toml Add simple JWT login for User 2026-09-27 22:23:25 +02:00
README.md Scaffold FastAPI + SQLModel + Alembic project, Postgres-backed 2026-09-27 15:57:44 +02:00
uv.lock Add simple JWT login for User 2026-09-27 22:23:25 +02:00

Vinindkøb v2

Admin-backend til fælles vinindkøb (FastAPI + SQLModel + PostgreSQL + Alembic). Se CLAUDE.md for projektplan og datamodel.

Kom i gang

uv sync
cp .env.example .env   # udfyld DATABASE_URL med din egen Postgres-instans
uv run alembic upgrade head
uv run fastapi dev app/main.py

GET /health bekræfter at appen kan nå databasen.