Files
familienarchiv/docs/architecture/c4/l3-backend-3g-supporting.puml

4.0 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 that link persons anddocuments. RequiresBLOG_WRITE permission forwrite operations.«component»GeschichteService[Spring Service] Manages story lifecycle(DRAFT â†’ PUBLISHED withtimestamp). Sanitizes HTMLbody with an allowlistpolicy.«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 toWrites audit_log[JDBC]Reads audit_log[JDBC]Reads / writesnotifications[JDBC]Reads / writesgeschichten[JDBC]