This website requires JavaScript.
Component Diagram: API Backend â Document Management & Canonical Import Component Diagram: API Backend â Document Management & Canonical Import API Backend (Spring Boot) [system] «component» DocumentController [Spring MVC â /api/documents] CRUD for documents: search, get by ID, update metadata, upload/download file, conversation thread, batch metadata updates, and per-month density aggregation for the timeline filter widget. «component» AdminController [Spring MVC â /api/admin] Triggers the asynchronous canonical import (requires ADMIN permission). Reports import state (IDLE/RUNNING/DONE/FAILED). «component» DocumentService [Spring Service] Core document business logic: store, update, search. Resolves persons and tags, delegates file I/O to FileService, builds dynamic JPA Specifications, and integrates with audit logging. «component» FileService [Spring Service] Wraps AWS SDK v2 S3Client. Uploads files with UUID-keyed paths, computes SHA-256 hash, downloads with content-type detection, and generates presigned URLs for OCR access. «component» CanonicalImportOrchestrator [Spring Service â @Async] Runs the four canonical loaders in an explicit dependency DAG (TagTree â PersonRegister â PersonTree â Document). Smoke-checks all four artifacts before starting, owns the IDLE/RUNNING/DONE/FAILED state machine, fails closed on a malformed artifact. «component» TagTreeImporter [Spring Component] Upserts the tag hierarchy from canonical-tag-tree.xlsx via TagService (by canonical tag_path). «component» PersonRegisterImporter [Spring Component] Upserts register persons from canonical-persons.xlsx via PersonService (by normalizer person_id). «component» PersonTreeImporter [Spring Component] Upserts tree persons + relationships from canonical-persons-tree.json via PersonService and RelationshipService. «component» DocumentImporter [Spring Component] Loads canonical-documents.xlsx: routes attribution register-first (raw cell always retained in sender_text/receiver_text), parses clean dates, builds an honest precision-aware title via DocumentTitleFormatter, keeps the S3 upload + thumbnail plumbing, and ports the path-traversal / homoglyph / absolute-path / %PDF magic-byte security guards. «component» DocumentTitleFormatter [Pure helper] Formats the date label baked into an import title at exactly the data's precision (MONTH -> 'Juni 1916', never a fabricated day). Mirrors the frontend formatDocumentDate; both are pinned to docs/date-label-fixtures.json (#666). «component» CanonicalSheetReader [POI helper] Maps a canonical .xlsx by header name (no positional indices), splits pipe-delimited list columns, fails closed (IMPORT_ARTIFACT_INVALID) on a missing required header. «component» MinioConfig [Spring @Configuration] Creates the S3Client and S3Presigner beans with path-style access for MinIO. Validates MinIO connectivity on startup. «component» DocumentRepository [Spring Data JPA] Queries documents with Specification-based dynamic search, bidirectional conversation thread queries, full-text search with ranking and match highlighting, and transcription pipeline queue projections. «component» DocumentSpecifications [JPA Criteria API] Factory for composable predicates: hasText (full-text), hasSender, hasReceiver, isBetween (date range), hasTags (subquery AND/OR logic). «container» Web Frontend [SvelteKit] «container» PostgreSQL [PostgreSQL 16] «container» Object Storage [MinIO (S3-compatible)] «component» PersonService [Spring Service] See diagram 3e. Resolves sender / receiver persons by ID; upserts persons by source_ref for the importer. «component» TagService [Spring Service] See diagram 3d. Finds or creates tags by name; upserts tags by source_ref for the importer. «component» RelationshipService [Spring Service] See diagram 3e. Creates family relationships from the person tree during import. Document requests [HTTP / JSON] Trigger import [HTTP / JSON] Delegates to Triggers Upload / download files Reads / writes documents Builds search predicates Resolves sender / receivers Finds or creates tags 1. Loads tags 2. Loads register persons 3. Loads tree persons + relationships 4. Loads documents Reads canonical .xlsx Reads canonical .xlsx Reads canonical .xlsx Builds honest title date Upserts tags by source_ref Upserts persons by source_ref Upserts persons by source_ref Creates relationships Upserts documents by index Register-first match / provisional person Attaches tag by source_ref Uploads resolved file Provides S3Client and S3Presigner beans PUT / GET / presigned URL objects [S3 API / HTTP] SQL queries [JDBC]