Backend for shareloop. See Docker setup to run the full stack without a local Python env.
- A running Postgres + PostGIS instance
- Python >= 3.12, uv (both handled by mise)
uv sync
uv sync --extra dev # for linting / type checkingmise run server:devThe API is documented in ../api/shareloop.openapi.yaml. Regenerate the Pydantic models with mise run server:api:gen.
Schema is defined in src/db/models.py (SQLAlchemy ORM). Migrations run automatically at startup via Alembic.
| Action | Command |
|---|---|
| Apply pending migrations | mise run server:db:migrate |
| New migration from model changes | mise run server:db:migration:new -- -m "description" |
| Empty migration (manual SQL) | mise run server:db:migration:create -- -m "description" |
| Stamp DB at current revision | mise run server:db:stamp |
Workflow: edit src/db/models.py → mise run server:db:migration:new -- -m "..." → review → mise run server:db:migrate → commit.