Repository wiki quickstart
Quickstart
This wiki is the source-grounded developer portal for the backend repository. Start here when you need the owning route, model, service, worker, or test for a change.
Main map
API and routing
- API routing — canonical URL entrypoints, versioning, redirects, and docs surfaces.
- API overview — shared API conventions, auth layers, and response patterns.
- Authentication — identity, JWT, Microsoft SSO, and API-key flows.
- Documents — document upload, polling, status, and edit history.
- Schemas — schema CRUD, generation, versioning, and rule linkage.
- Tenancy — tenant resolution, manager behavior, and membership controls.
- Security — CSP, consent, license acceptance, API keys, and virus-scan gates.
- Files — upload, serving, preview, and secure file access.
Runtime services
- Services overview — the shared service-layer map.
- Async pipelines — upload-processing and schema-generation worker paths.
- Worker failures — retries, fallback execution, and cleanup.
- Storage — backend storage adapters.
- Virus scan — external scan contract and failure modes.
Business areas
- Billing — plans, invoices, payment methods, and usage.
Data and persistence
- Domain models — major entities and ownership edges.
- Persistence invariants — constraints and tenant rules.
- Polling-owned tables — unmanaged tables written by the polling service.
- Migrations — important schema and data evolution.
Test guidance
- Contract matrix — intent-to-test routing.
Task-routing table
| Change intent | Primary wiki page | Source entrypoints / symbols | Focused tests | Minimal validation |
|---|
| Add or change API routes | API routing | api/urls.py, api/versions/v1_urls.py, backend_project/urls.py | Route-specific integration tests under tests/integration/ | Hit the route with the matching test client or a narrow pytest/manage.py test subset |
| Modify auth or token behavior | Authentication | api/views/auth_views.py, api/views/ms_auth_views.py, api/authentication/* | tests/unit/auth/*, tests/integration/test_authentication.py | Run auth tests plus the endpoint flow you changed |
| Change tenant scoping or membership rules | Tenancy | api/tenancy/*, tenant-aware managers, tenant views | tests/unit/auth/test_auth_and_tenancy_contracts.py and tenancy integration checks | Run tenant-scoped contract tests |
| Adjust schema generation or versioning | Schemas | api/views/schema_views/*, api/schema_generator/*, api/models/schema.py | tests/unit/schema/* | Run the schema generation/versioning subset |
| Change document upload or polling | Documents | api/views/upload_processing_view.py, api/services/upload_processing/tasks.py, api/views/task_status_view.py | tests/integration/test_async_document_processing.py | Run async upload tests and task-status tests |
| Change file serving or previews | Files | api/views/file_serving_views/*, api/views/file_management_views/* | tests/integration/test_file_management.py | Run file management integration tests |
| Change billing behavior | Billing | api/views/billing_views.py, api/models/billing.py | Billing-related tests under tests/integration/ and tests/unit/ | Run billing endpoint tests |
| Change analytics dashboards | Analytics | api/views/analytics_views.py | Analytics tests under tests/integration/ | Run the chart endpoint tests |
| Change virus scanning or security gates | Security and Virus scan | api/services/virus_scan_service.py, security views | Security and storage tests | Run the narrow security or storage subset |
What to read first for common tasks
- Understand the whole request path: start with API routing, then open the owning domain page.
- Debug upload processing: read Documents, Async pipelines, and Task status.
- Debug schema generation: read Schemas and Schema generation.
- Understand tenant bugs: read Tenancy, then Manager behavior and Background access.
Backlog
- Some areas are intentionally split across focused pages so that route contracts, data ownership, and worker lifecycles stay discoverable without duplicating source detail.
- If a change touches a feature not listed above, locate the owning page from the map before editing source; add a new page only when the change surface is genuinely new.