docs: update package structure docs to reflect domain-based layout
Some checks failed
CI / Unit & Component Tests (push) Failing after 3m40s
CI / OCR Service Tests (push) Successful in 28s
CI / Backend Unit Tests (push) Failing after 3m0s
CI / Unit & Component Tests (pull_request) Failing after 3m39s
CI / Backend Unit Tests (pull_request) Failing after 3m27s
CI / OCR Service Tests (pull_request) Successful in 41s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-05 13:02:14 +02:00
parent 27e7fa9170
commit 5f1c539fad
2 changed files with 40 additions and 18 deletions

View File

@@ -64,16 +64,28 @@ npm run generate:api # Regenerate TypeScript API types from OpenAPI spec
### Package Structure ### Package Structure
Package-by-domain: each domain owns its controller, service, repository, entities, and DTOs.
``` ```
backend/src/main/java/org/raddatz/familienarchiv/ backend/src/main/java/org/raddatz/familienarchiv/
├── controller/ REST endpoints — thin, delegate everything to services ├── audit/ Audit logging
├── service/ Business logic — the only place that touches repositories ├── config/ Infrastructure config (Minio, Async, Web)
├── repository/ Spring Data JPA interfaces ├── dashboard/ Dashboard analytics + StatsController/StatsService
├── model/ JPA entities ├── document/ Document domain (entities, controller, service, repository, DTOs)
├── dto/ Input objects (request bodies/form data) │ ├── annotation/ DocumentAnnotation, AnnotationService, AnnotationController
├── exception/ DomainException + ErrorCode enum │ ├── comment/ DocumentComment, CommentService, CommentController
├── security/ SecurityConfig, Permission enum, @RequirePermission, PermissionAspect │ └── transcription/ TranscriptionBlock, TranscriptionService, TranscriptionBlockQueryService
── config/ MinioConfig, AsyncConfig ── exception/ DomainException, ErrorCode, GlobalExceptionHandler
├── filestorage/ FileService (S3/MinIO)
├── geschichte/ Geschichte (story) domain
├── importing/ MassImportService, ExcelService
├── notification/ Notification domain + SseEmitterRegistry
├── ocr/ OCR domain — OcrService, OcrBatchService, training
├── person/ Person domain
│ └── relationship/ PersonRelationship sub-domain
├── security/ SecurityConfig, Permission, @RequirePermission, PermissionAspect
├── tag/ Tag domain
└── user/ User domain — AppUser, UserGroup, UserService, auth controllers
``` ```
### Layering Rules (strictly enforced) ### Layering Rules (strictly enforced)

View File

@@ -19,18 +19,28 @@ Spring Boot 4.0 monolith serving the Familienarchiv REST API. Handles document m
## Package Structure ## Package Structure
Package-by-domain: each domain owns its controller, service, repository, entities, and DTOs.
``` ```
src/main/java/org/raddatz/familienarchiv/ src/main/java/org/raddatz/familienarchiv/
├── audit/ # Audit logging infrastructure ├── audit/ # Audit logging (AuditService, AuditLogQueryService)
├── config/ # MinioConfig, AsyncConfig, RateLimitInterceptor ├── config/ # Infrastructure config (MinioConfig, AsyncConfig, WebConfig)
├── controller/ # REST endpoints — thin, delegate to services ├── dashboard/ # Dashboard analytics + StatsController/StatsService
├── dashboard/ # Dashboard analytics queries and endpoints ├── document/ # Document domain — entities, controller, service, repository, DTOs
├── dto/ # Input/request DTOs (e.g., DocumentUpdateDTO, GroupDTO) │ ├── annotation/ # DocumentAnnotation, AnnotationService, AnnotationController
├── exception/ # DomainException + ErrorCode enum │ ├── comment/ # DocumentComment, CommentService, CommentController
├── model/ # JPA entities (Document, Person, Tag, AppUser, etc.) │ └── transcription/ # TranscriptionBlock, TranscriptionService, TranscriptionBlockQueryService
├── repository/ # Spring Data JPA interfaces + Specifications ├── exception/ # DomainException, ErrorCode, GlobalExceptionHandler
├── security/ # SecurityConfig, Permission enum, @RequirePermission, PermissionAspect ├── filestorage/ # FileService (S3/MinIO)
── service/ # Business logic — the only place that touches repositories ── geschichte/ # Geschichte (story) domain
├── importing/ # MassImportService, ExcelService
├── notification/ # Notification domain + SseEmitterRegistry
├── ocr/ # OCR domain — OcrService, OcrBatchService, training
├── person/ # Person domain — Person, PersonService, PersonController
│ └── relationship/ # PersonRelationship sub-domain
├── security/ # SecurityConfig, Permission, @RequirePermission, PermissionAspect
├── tag/ # Tag domain — Tag, TagService, TagController
└── user/ # User domain — AppUser, UserGroup, UserService, auth controllers
``` ```
## Layering Rules (Strict) ## Layering Rules (Strict)