Repository navigation
Development
Running the stack locally without Docker, for hacking on the code. For production deployment see Self-Hosting and Deployment; for the full technical design see ARCHITECTURE.md in the repository.
| Layer | Tech |
|---|---|
| Backend | Python 3.12 · FastAPI · SQLAlchemy · Alembic · Pydantic v2 |
| Frontend | Next.js 16 (App Router) · TypeScript · Tailwind · shadcn/ui |
| Database | SQLite |
| Storage | Local filesystem |
cd backend
python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# Point the default /data paths at a local dir (a backend/.env works too):
export DB_URL=sqlite:////tmp/cs-dev/contactsheet.db UPLOAD_DIR=/tmp/cs-dev/uploads \
EXPORTS_DIR=/tmp/cs-dev/exports BRANDING_DIR=/tmp/cs-dev/branding \
WATERMARKS_DIR=/tmp/cs-dev/watermarks
alembic upgrade head
uvicorn app.main:app --reload --port 8000The backend's defaults (
/data/...) only exist inside the container. Without a localDB_URLand all four*_DIRpaths it will fail to start with a read-only-filesystem error (uploads also spool underEXPORTS_DIR/.tmp).
cd frontend
npm install
npm run dev # http://localhost:3000The Next.js dev server proxies /api/* and /uploads/* to http://localhost:8000 (set NEXT_PUBLIC_API_BASE to point it elsewhere).
# frontend
npm run lint # ESLint
npm test # Vitest unit tests
npm run build # production build + tsc --noEmit type-check
# backend (from backend/, after pip install -r requirements-dev.txt)
.venv/bin/pytest # unit suite
# end-to-end smoke test (from the repo root; boots its own isolated stack — see e2e/README.md)
backend/.venv/bin/pytest e2e/
# backend — create a migration after a model change
.venv/bin/alembic revision -m "describe_change"
.venv/bin/alembic upgrade head- Clean layers: router → service → repository. No business logic in route handlers.
- UUIDv4 primary keys — never expose auto-increment IDs.
-
Soft delete (
deleted_at) on galleries and images. - Alembic migration required for every schema change.
- REST API first — every feature should be reachable through the API.
UI strings live in frontend/messages/{en,de}.json (English is the source of truth). Validate before committing catalog changes:
cd frontend && node scripts/validate-i18n.mjsSee Translating for the community translation flow via Weblate.
Back to the Home index.