ShiftIt — Documentation Index
Generated: 2026-05-10 by
bmad-document-project(initial scan, deep level). Update via/document-project(or its successor) — the workflow is brownfield-aware and supports re-scan, deep-dive, or selective regeneration.
This index is the primary AI retrieval entry point for the ShiftIt project. New contributors and AI agents should read project-overview.md first, then drill into per-part architecture as needed.
Project at a glance
-
Type: monorepo (Cargo workspace) with 2 parts + 1 standalone tool crate
-
Primary languages: Rust (backend stable, frontend nightly)
-
Architecture: modular monolith REST API (Axum) + WASM SPA (Leptos), connected over
/api/v1 -
Multi-tenancy: PostgreSQL Row-Level Security (RLS) with per-request
app.tenant_id -
Auth: Zitadel OIDC issuer; backend is a pure resource server
Parts
Backend (backend/) — shiftit-backend
-
Type: Rust modular monolith REST API
-
Stack: Axum 0.8, sqlx 0.8, PostgreSQL 16 (RLS), utoipa, jsonwebtoken, web-push, aws-sdk-s3
-
Entry point:
backend/src/main.rs -
Auth: Validates Zitadel JWTs against JWKS; injects
TenantContextinto every request -
Key concept:
TenantContext::rls_transaction(&pool)→ tenant-scoped DB transaction (set the GUC, let Postgres enforce isolation)
Frontend (frontend/) — shiftit-frontend
-
Type: Rust → WASM SPA + PWA
-
Stack: Leptos 0.8 (CSR + nightly), Trunk, Tailwind v4, rust-ui (MIT)
-
Entry point:
frontend/src/main.rs→ mounts<App/>fromfrontend/src/app.rs -
Three surfaces:
/admin/(10 pages),/app/(5 pages, employee),/f/{slug}(customer form) -
Build target:
wasm32-unknown-unknown; pinned nightly toolchain infrontend/rust-toolchain.toml
Generated documentation
| Doc | What it covers |
|---|---|
One-pager: what ShiftIt is, where everything lives |
|
Annotated directory tree per part |
|
How frontend talks to backend ( |
|
Backend internals: layering, auth pipeline, RLS, OpenAPI |
|
Frontend internals: surface segmentation, data flow patterns |
|
Endpoint catalog organised by tag (mirrors |
|
Schema per migration, RLS policies, FK relationships |
|
rust-ui primitives + per-surface page catalog |
|
Daily dev loop, build/test commands, conventions, troubleshooting |
|
Compose stack, env vars, CI/CD, build modes |
docs/project-parts.json (machine-readable structure metadata) is kept in the repo alongside the docs but is not part of the published component.
Existing documentation (preserved)
| Doc | Description |
|---|---|
|
Project handover doc. Run-the-dev-stack and architectural facts the next session must know. Read this first if you are coding. |
|
Outstanding work, prioritised. P0/P1/P2 — every new task should be picked from here |
License signing & shipping flow for self-hosted builds |
|
Bare binary + nginx without Compose |
|
Annotated Compose walkthrough |
|
TLS termination + reverse proxy config |
|
OAuth app config, claim mapping (⚠️ verify v1/v2 action API per current Zitadel) |
|
|
Frozen — what the system should be. Reference, not current state |
|
Frozen per-plan walkthroughs from the superpowers workflow |
Ideas & exploration
Speculative bets and the autonomous-run decision trail live in the repo’s notes/ folder (process artifacts, excluded from the portal):
-
notes/wild-ideas.adoc— speculative, uncommitted bets. #1: managed Device-Owner tablets + custom forms + PoS + fleet control as a service line (osd-proven kiosk pattern; logistics/events/field-service verticals). -
notes/autonomous-decision-log.adoc— decisions made during no-human-in-the-loop sessions, each with rationale + revert path.
Getting started
-
Read
../CLAUDE.md— this is the canonical "how to run the dev stack" doc and tells you about RLS, the dev-auth bypass, and the migration discipline. -
Run the dev stack — three terminals: Postgres (Docker),
python3 scripts/mock-jwks.py 9999,./scripts/run-backend.sh admin,cd frontend && trunk serve. -
Open
http://localhost:3010/api/docs/to browse the live API surface. -
Open
http://localhost:8080/for the frontend, then paste this in the console once to enter auth-gated UI:localStorage.setItem('shiftit_token', JSON.stringify('dev')); location.reload(); -
Pick a follow-up from
docs/follow-ups.md— the file is the source of truth for what’s next.
For AI agents (brownfield workflow notes)
-
Picking work: every new task should map to an entry in
docs/follow-ups.md. New work that doesn’t fit an existing entry should add a new one rather than scattering TODOs in code. -
Reading the codebase:
architecture-backend.mdandarchitecture-frontend.mdgive you the conceptual layout;source-tree-analysis.mdgives you the file-level map; the OpenAPI doc at/api/docs/is the live API surface. -
Tenant isolation invariant: every backend DB operation must run via
ctx.rls_transaction(&pool). The single bypass (customer_forms_lookup_by_slug) is documented inarchitecture-backend.mdanddata-models-backend.md. -
Migration discipline: if you add migrations, follow Plan 02 conventions (see
development-guide.md); if you edit existing migrations, dev DBs must be reset (procedure inCLAUDE.md). -
OpenAPI registration: new routes need three updates —
#[utoipa::path],main.rs::create_router, andopenapi.rs::ApiDoc::paths. The third is easy to forget.