Files
familienarchiv/docs/architecture/c4/l3-backend-3g-supporting.puml
Marcel 70da532f54 docs(c4): add GeschichteQueryService component; fix GeschichteService relationship
Add GeschichteQueryService component to the L3 supporting-domains diagram.
Remove the now-deleted Rel(geschSvc, journeyItemSvc, "Delegates getItems()")
arrow and add the correct Rel(journeyItemSvc, geschQuerySvc, ...) arrow that
reflects the actual dependency direction after the refactor in the prior commit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 20:47:46 +02:00

4.8 KiB

Component Diagram: API Backend — Supporting DomainsComponent Diagram: API Backend — Supporting DomainsAPI Backend (Spring Boot)[system]«component»AuditService[Spring Service â€” @Async] Writes audit log entriesasynchronously via adedicated TaskExecutor,with transaction-awarelogging to preventdeadlocks on concurrentsaves.«component»AuditLogQueryService[Spring Service] Queries audit logs foractivity feeds, pulse stats,recent contributors, andper-document history.Facade overAuditLogRepository.«component»DashboardController[Spring MVC â€” /api/dashboard] REST endpoints for the userdashboard: recentdocument resume(/resume), weeklytranscription pulse stats(/pulse), and activity feed(/activity) with kind filteringand pagination.«component»StatsController[Spring MVC â€” /api/stats] Returns aggregate counts(total persons, totaldocuments) for the UI statsbar.«component»StatsService[Spring Service] Queries aggregate counts:total persons and totaldocuments.«component»DashboardService[Spring Service] Assembles the userdashboard: recentdocument resume (callsDocumentService +TranscriptionService),weekly transcription pulsestats, and activity feed withcontributor avatars.«component»NotificationController[Spring MVC â€”/api/notifications] REST and SSE endpoints fornotification stream, historywith filtering, read/unreadstate, and per-userpreference management.«component»NotificationService[Spring Service] Creates REPLY andMENTION notifications,optionally sends email,marks as read, and pushesevents to connected clientsvia SseEmitterRegistry.«component»SseEmitterRegistry[Spring Component] In-memoryConcurrentHashMap ofSpring SseEmitter instancesper user. Handlesregistration, deregistration,and JSON event broadcasts.«component»GeschichteController[Spring MVC â€”/api/geschichten] CRUD for publishablestories (STORY) and readingjourneys (JOURNEY).ReturnsGeschichteSummaryprojections for list; fullGeschichte withJourneyItems for detail.Requires BLOG_WRITEpermission for writeoperations.«component»GeschichteService[Spring Service] Manages story lifecycle(DRAFT â†’ PUBLISHED withtimestamp). Supports twosubtypes: STORY (prose)and JOURNEY (orderedJourneyItem sequence).Sanitizes HTML body withan allowlist policy.«component»GeschichteQueryService[Spring Service] Read-only facade overGeschichteRepository.Exposes existsById() andfindById() to preventJourneyItemService fromcrossing domainboundaries.«component»JourneyItemService[Spring Service] Manages journey itemlifecycle: append (100-itemcap), updateNote(three-way PATCH), delete,and reorder (DEFERRABLEposition swap). EnforcesJOURNEY-type guard onappend.«component»GlobalExceptionHandler[Spring @RestControllerAdvice] Converts DomainException,validation errors, andgeneric exceptions toErrorResponse JSON withmachine-readableErrorCode and HTTP status.«container»Web Frontend[SvelteKit]«container»PostgreSQL[PostgreSQL 16]«component»DocumentService[Spring Service] See diagram 3b. Called byDashboardService to fetchdocument titles and resumedata.«component»TranscriptionService[Spring Service] See diagram 3c. Called byDashboardService to fetchtranscription block progressfor resume.Dashboard requests[HTTP / JSON]GET /api/stats[HTTP / JSON]Notification streamand history[HTTP / JSON / SSE]Story requests[HTTP / JSON]Delegates toDelegates toReads aggregatecounts[JDBC]Fetches activity feedand pulse statsFetches documenttitles and resumedataFetches transcriptionblock progress forresumeDelegates toRegisters client SSEconnectionBroadcasts events toconnected clientsDelegates toDelegates journeyitem CRUDChecks Geschichteexistence and typeReads geschichten[JDBC]Reads / writesjourney_items[JDBC]Writes audit_log[JDBC]Reads audit_log[JDBC]Reads / writesnotifications[JDBC]Reads / writesgeschichten[JDBC]