# hausersoph/swen_3_ws2026_projekt architecture

> Architecture diagram of the GitHub repository hausersoph/swen_3_ws2026_projekt, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hausersoph/swen_3_ws2026_projekt
- Repository: https://github.com/hausersoph/swen_3_ws2026_projekt

## Overview

Paperless is a document-management application for document metadata and notes; the README explicitly says PDF contents are not handled yet. Its principal backend workflow is an HTTP document request routed by the API controller to business validation and then repository persistence. The Angular dashboard and detail view are present, but the sampled dashboard uses sample data and does not save to the API. The graph covers the documented features; unsampled implementation links are omitted unless documented or visible in the excerpts.

Main entry points: [`src/Paperless.REST/Paperless.Business/DocumentService.cs`](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Business/DocumentService.cs) (Document service), [`src/Paperless.REST/Paperless.Dal/DocumentRepository.cs`](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Dal/DocumentRepository.cs) (Document repository), [`src/Paperless.REST/Paperless.Api/Program.cs`](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Api/Program.cs) (API host), [`src/Paperless.REST/Paperless.Api/Controllers/DocumentsController.cs`](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Api/Controllers/DocumentsController.cs) (Document endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_webapp["Angular app<br/>[main.ts]"]
  node_shell["App shell<br/>[app.component.ts]"]
  node_dashboard["Document dashboard"]
  node_detail["Document detail"]
end

subgraph group_api["REST API"]
  node_api_host["API host<br/>[Program.cs]"]
  node_controller["Document endpoints"]
  node_dtos["Request/response DTOs<br/>[DocumentDtos.cs]"]
  node_mapping["DTO mapping"]
  node_error_handler["Business error handling"]
end

subgraph group_business["Business logic"]
  node_service["Document service<br/>[DocumentService.cs]"]
  node_service_contract["Service contract"]
  node_business_errors["Validation and not-found errors"]
end

subgraph group_domain["Domain model"]
  node_document["Document metadata<br/>[Document.cs]"]
  node_note["Document notes<br/>[DocumentNote.cs]"]
  node_repository_contract["Repository contract"]
end

subgraph group_persistence["Persistence"]
  node_repository["Document repository"]
  node_db_context["EF database context"]
  node_postgres[("PostgreSQL")]
end

node_user(("User"))

node_user -->|"uses"| node_webapp
node_webapp -->|"bootstraps"| node_shell
node_webapp -->|"routes to"| node_dashboard
node_webapp -->|"routes to"| node_detail
node_shell -->|"hosts"| node_dashboard
node_shell -->|"hosts"| node_detail
node_dashboard -->|"links to"| node_detail
node_user -->|"requests"| node_controller
node_api_host -->|"routes"| node_controller
node_controller -->|"invokes"| node_service
node_controller -->|"maps DTOs"| node_mapping
node_controller -->|"accepts/returns"| node_dtos
node_api_host -->|"registers"| node_error_handler
node_api_host -->|"configures"| node_mapping
node_api_host -->|"registers"| node_service
node_api_host -->|"configures DAL"| node_repository
node_service -->|"calls"| node_repository
node_service -->|"throws"| node_business_errors
node_error_handler -->|"handles"| node_business_errors
node_service -->|"implements"| node_service_contract
node_service -->|"uses"| node_repository_contract
node_repository -->|"implements"| node_repository_contract
node_repository -->|"queries/writes"| node_db_context
node_db_context -.->|"persists"| node_postgres
node_db_context -->|"maps entity"| node_document
node_db_context -->|"maps entity"| node_note
node_repository -->|"reads/writes"| node_document
node_repository -->|"reads/writes"| node_note
node_service -->|"validates/builds"| node_document
node_service -->|"builds"| node_note

click node_webapp "https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.WebUI/src/main.ts"
click node_shell "https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.WebUI/src/app/app.component.ts"
click node_dashboard "https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.WebUI/src/app/dashboard.component.ts"
click node_detail "https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.WebUI/src/app/document-detail.component.ts"
click node_api_host "https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Api/Program.cs"
click node_controller "https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Api/Controllers/DocumentsController.cs"
click node_dtos "https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Api/Contracts/DocumentDtos.cs"
click node_mapping "https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Api/Mapping/MappingConfiguration.cs"
click node_error_handler "https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Api/Errors/BusinessExceptionHandler.cs"
click node_service "https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Business/DocumentService.cs"
click node_service_contract "https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Business/IDocumentService.cs"
click node_business_errors "https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Business/BusinessExceptions.cs"
click node_document "https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Domain/Document.cs"
click node_note "https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Domain/DocumentNote.cs"
click node_repository_contract "https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Domain/IDocumentRepository.cs"
click node_repository "https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Dal/DocumentRepository.cs"
click node_db_context "https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Dal/PaperlessDbContext.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_shell,node_dashboard,node_detail,node_user toneBlue
class node_api_host,node_controller,node_dtos,node_mapping,node_error_handler toneAmber
class node_service,node_service_contract,node_business_errors toneMint
class node_document,node_note,node_repository_contract toneRose
class node_repository,node_db_context,node_postgres toneIndigo
```

## Components

### Web interface

- [Angular app](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.WebUI/src/main.ts): `src/Paperless.WebUI/src/main.ts`
- [App shell](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.WebUI/src/app/app.component.ts): `src/Paperless.WebUI/src/app/app.component.ts`
- [Document dashboard](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.WebUI/src/app/dashboard.component.ts): `src/Paperless.WebUI/src/app/dashboard.component.ts`
- [Document detail](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.WebUI/src/app/document-detail.component.ts): `src/Paperless.WebUI/src/app/document-detail.component.ts`

### REST API

- [API host](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Api/Program.cs): `src/Paperless.REST/Paperless.Api/Program.cs`
- [Document endpoints](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Api/Controllers/DocumentsController.cs): `src/Paperless.REST/Paperless.Api/Controllers/DocumentsController.cs`
- [Request/response DTOs](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Api/Contracts/DocumentDtos.cs): `src/Paperless.REST/Paperless.Api/Contracts/DocumentDtos.cs`
- [DTO mapping](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Api/Mapping/MappingConfiguration.cs): `src/Paperless.REST/Paperless.Api/Mapping/MappingConfiguration.cs`
- [Business error handling](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Api/Errors/BusinessExceptionHandler.cs): `src/Paperless.REST/Paperless.Api/Errors/BusinessExceptionHandler.cs`

### Business logic

- [Document service](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Business/DocumentService.cs): `src/Paperless.REST/Paperless.Business/DocumentService.cs`
- [Service contract](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Business/IDocumentService.cs): `src/Paperless.REST/Paperless.Business/IDocumentService.cs`
- [Validation and not-found errors](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Business/BusinessExceptions.cs): `src/Paperless.REST/Paperless.Business/BusinessExceptions.cs`

### Domain model

- [Document metadata](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Domain/Document.cs): `src/Paperless.REST/Paperless.Domain/Document.cs`
- [Document notes](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Domain/DocumentNote.cs): `src/Paperless.REST/Paperless.Domain/DocumentNote.cs`
- [Repository contract](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Domain/IDocumentRepository.cs): `src/Paperless.REST/Paperless.Domain/IDocumentRepository.cs`

### Persistence

- [Document repository](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Dal/DocumentRepository.cs): `src/Paperless.REST/Paperless.Dal/DocumentRepository.cs`
- [EF database context](https://github.com/hausersoph/swen_3_ws2026_projekt/blob/main/src/Paperless.REST/Paperless.Dal/PaperlessDbContext.cs): `src/Paperless.REST/Paperless.Dal/PaperlessDbContext.cs`
- **PostgreSQL**

### Other components

- **User**

## Connections

- User → Angular app: uses (evidence: `src/Paperless.WebUI/src/main.ts`)
- Angular app → App shell: bootstraps (evidence: `src/Paperless.WebUI/src/main.ts`)
- Angular app → Document dashboard: routes to (evidence: `src/Paperless.WebUI/src/main.ts`)
- Angular app → Document detail: routes to (evidence: `src/Paperless.WebUI/src/main.ts`)
- App shell → Document dashboard: hosts (evidence: `src/Paperless.WebUI/src/app/app.component.ts`)
- App shell → Document detail: hosts (evidence: `src/Paperless.WebUI/src/app/app.component.ts`)
- Document dashboard → Document detail: links to (evidence: `src/Paperless.WebUI/src/app/dashboard.component.ts`)
- User → Document endpoints: requests (evidence: `src/Paperless.REST/Paperless.Api/Controllers/DocumentsController.cs`)
- API host → Document endpoints: routes (evidence: `src/Paperless.REST/Paperless.Api/Program.cs`)
- Document endpoints → Document service: invokes (evidence: `src/Paperless.REST/Paperless.Api/Controllers/DocumentsController.cs`)
- Document endpoints → DTO mapping: maps DTOs (evidence: `src/Paperless.REST/Paperless.Api/Controllers/DocumentsController.cs`)
- Document endpoints → Request/response DTOs: accepts/returns (evidence: `src/Paperless.REST/Paperless.Api/Controllers/DocumentsController.cs`)
- API host → Business error handling: registers (evidence: `src/Paperless.REST/Paperless.Api/Program.cs`)
- API host → DTO mapping: configures (evidence: `src/Paperless.REST/Paperless.Api/Program.cs`)
- API host → Document service: registers (evidence: `src/Paperless.REST/Paperless.Api/Program.cs`)
- API host → Document repository: configures DAL (evidence: `src/Paperless.REST/Paperless.Api/Program.cs`)
- Document service → Document repository: calls (evidence: `src/Paperless.REST/Paperless.Business/DocumentService.cs`)
- Document service → Validation and not-found errors: throws (evidence: `src/Paperless.REST/Paperless.Business/DocumentService.cs`)
- Business error handling → Validation and not-found errors: handles (evidence: `src/Paperless.REST/Paperless.Api/Errors/BusinessExceptionHandler.cs`)
- Document service → Service contract: implements (evidence: `src/Paperless.REST/Paperless.Business/DocumentService.cs`)
- Document service → Repository contract: uses (evidence: `src/Paperless.REST/Paperless.Business/DocumentService.cs`)
- Document repository → Repository contract: implements (evidence: `src/Paperless.REST/Paperless.Dal/DocumentRepository.cs`)
- Document repository → EF database context: queries/writes (evidence: `src/Paperless.REST/Paperless.Dal/DocumentRepository.cs`)
- EF database context → PostgreSQL: persists
- EF database context → Document metadata: maps entity (evidence: `src/Paperless.REST/Paperless.Dal/PaperlessDbContext.cs`)
- EF database context → Document notes: maps entity (evidence: `src/Paperless.REST/Paperless.Dal/PaperlessDbContext.cs`)
- Document repository → Document metadata: reads/writes (evidence: `src/Paperless.REST/Paperless.Dal/DocumentRepository.cs`)
- Document repository → Document notes: reads/writes (evidence: `src/Paperless.REST/Paperless.Dal/DocumentRepository.cs`)
- Document service → Document metadata: validates/builds (evidence: `src/Paperless.REST/Paperless.Business/DocumentService.cs`)
- Document service → Document notes: builds (evidence: `src/Paperless.REST/Paperless.Business/DocumentService.cs`)
