# mdresch/adpa architecture

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

- Interactive diagram: https://gitdiagram.com/mdresch/adpa
- Repository: https://github.com/mdresch/adpa

## Overview

ADPA is an enterprise document-processing and project-management platform. The main user journey is to organize work in a project, select a template, generate standards-aligned documentation with AI, then manage versions and connect documents to enterprise systems. The product also includes search and context retrieval, portfolio and governance workflows, digital twins, and operational analytics. The graph reflects README capabilities and the sampled frontend, backend, and orchestration code; several documented subsystems are represented at their tree-level entry points because their implementation was not sampled.

Main entry points: [`server/src/modules/contextRetrieval/contextRetrievalService.ts`](https://github.com/mdresch/adpa/blob/adpa-project-charter/server/src/modules/contextRetrieval/contextRetrievalService.ts) (Context retrieval), [`app/documents/document-library-workspace.tsx`](https://github.com/mdresch/adpa/blob/adpa-project-charter/app/documents/document-library-workspace.tsx) (Document library), [`app/api/generate/route.ts`](https://github.com/mdresch/adpa/blob/adpa-project-charter/app/api/generate/route.ts) (Document generation), [`orchestrator/Adpa.Orchestrator/Controllers/RitualController.cs`](https://github.com/mdresch/adpa/blob/adpa-project-charter/orchestrator/Adpa.Orchestrator/Controllers/RitualController.cs) (Governance rituals)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Project workspace"]
  node_projects["Project management"]
  node_project_api["Project API<br/>[route.ts]"]
  node_project_space["Project workspace"]
  node_portfolio["Portfolio planning<br/>[page.tsx]"]
end

subgraph group_documents["Document lifecycle"]
  node_document_library["Document library"]
  node_upload["Document upload<br/>[route.ts]"]
  node_generation["Document generation<br/>[route.ts]"]
  node_templates["Template management<br/>[page.tsx]"]
  node_doc_view["Document viewing<br/>[DocumentViewer.tsx]"]
end

subgraph group_intelligence["AI and retrieval"]
  node_ai_orchestration["AI provider orchestration<br/>[aiService.ts]"]
  node_chat_api["Chat endpoint<br/>[route.ts]"]
  node_context_retrieval["Context retrieval"]
  node_keyword_search["Keyword search"]
  node_rag_api["RAG endpoints<br/>[ragRoutes.ts]"]
end

subgraph group_enterprise["Integrations and governance"]
  node_integrations["Enterprise integrations"]
  node_digital_twin["Digital twins<br/>[page.tsx]"]
  node_trigger_rules["Twin trigger rules"]
  node_governance["Governance rituals"]
  node_governance_store[("Governance ledger")]
end

subgraph group_operations["Monitoring and orchestration"]
  node_dashboard["Analytics dashboard<br/>[page.tsx]"]
  node_pipeline["Pipeline dashboard"]
  node_pipeline_api["Pipeline API client<br/>[usePipelineAPI.ts]"]
  node_review_routes["Review scheduling<br/>[reviewRoutes.ts]"]
  node_database[("PostgreSQL access<br/>[connection.ts]")]
end

node_user(("Organization user"))
node_actor_services(("Enterprise services"))

node_user -->|"organizes work"| node_projects
node_projects -->|"loads projects"| node_project_api
node_user -->|"manages project"| node_project_space
node_user -->|"manages documents"| node_document_library
node_document_library -->|"uploads files"| node_upload
node_user -->|"selects templates"| node_templates
node_user -->|"requests generation"| node_generation
node_generation -.->|"generates content"| node_ai_orchestration
node_chat_api -.->|"retrieves context"| node_context_retrieval
node_context_retrieval -->|"runs keyword search"| node_keyword_search
node_context_retrieval -->|"queries data"| node_database
node_rag_api -.->|"serves retrieval"| node_context_retrieval
node_generation -.->|"produces documents"| node_doc_view
node_document_library -.->|"publishes or syncs"| node_integrations
node_user -->|"configures integrations"| node_integrations
node_user -->|"plans portfolio"| node_portfolio
node_user -.->|"manages twins"| node_digital_twin
node_digital_twin -->|"manages rules"| node_trigger_rules
node_user -.->|"reviews governance"| node_governance
node_governance -->|"persists ledger"| node_governance_store
node_governance -.->|"checks governance"| node_actor_services
node_user -->|"monitors activity"| node_dashboard
node_dashboard -.->|"shows pipeline status"| node_pipeline
node_pipeline -.->|"requests job data"| node_pipeline_api
node_pipeline_api -->|"calls pipeline API"| node_actor_services
node_review_routes -->|"checks programs"| node_database
node_actor_services -.->|"connects external tools"| node_integrations

click node_projects "https://github.com/mdresch/adpa/blob/adpa-project-charter/app/projects/projects-workspace.tsx"
click node_project_api "https://github.com/mdresch/adpa/blob/adpa-project-charter/app/api/projects/route.ts"
click node_project_space "https://github.com/mdresch/adpa/blob/adpa-project-charter/app/projects/%5Bid%5D/components/project-workspace.tsx"
click node_portfolio "https://github.com/mdresch/adpa/blob/adpa-project-charter/app/portfolio/page.tsx"
click node_document_library "https://github.com/mdresch/adpa/blob/adpa-project-charter/app/documents/document-library-workspace.tsx"
click node_upload "https://github.com/mdresch/adpa/blob/adpa-project-charter/app/api/documents/upload/route.ts"
click node_generation "https://github.com/mdresch/adpa/blob/adpa-project-charter/app/api/generate/route.ts"
click node_templates "https://github.com/mdresch/adpa/blob/adpa-project-charter/app/templates/page.tsx"
click node_doc_view "https://github.com/mdresch/adpa/blob/adpa-project-charter/components/documents/DocumentViewer.tsx"
click node_ai_orchestration "https://github.com/mdresch/adpa/blob/adpa-project-charter/server/src/services/aiService.ts"
click node_chat_api "https://github.com/mdresch/adpa/blob/adpa-project-charter/app/api/chat/route.ts"
click node_context_retrieval "https://github.com/mdresch/adpa/blob/adpa-project-charter/server/src/modules/contextRetrieval/contextRetrievalService.ts"
click node_keyword_search "https://github.com/mdresch/adpa/blob/adpa-project-charter/server/src/modules/contextRetrieval/engines/keywordSearchEngine.ts"
click node_rag_api "https://github.com/mdresch/adpa/blob/adpa-project-charter/server/src/routes/ragRoutes.ts"
click node_integrations "https://github.com/mdresch/adpa/blob/adpa-project-charter/app/integrations/integrations-workspace.tsx"
click node_digital_twin "https://github.com/mdresch/adpa/blob/adpa-project-charter/app/(dashboard)/digital-twin/page.tsx"
click node_trigger_rules "https://github.com/mdresch/adpa/blob/adpa-project-charter/components/digital-twin/DigitalTwinTriggerRulesManager.tsx"
click node_governance "https://github.com/mdresch/adpa/blob/adpa-project-charter/orchestrator/Adpa.Orchestrator/Controllers/RitualController.cs"
click node_governance_store "https://github.com/mdresch/adpa/blob/adpa-project-charter/orchestrator/Adpa.Orchestrator/Data/GovernanceDbContext.cs"
click node_dashboard "https://github.com/mdresch/adpa/blob/adpa-project-charter/app/analytics/page.tsx"
click node_pipeline "https://github.com/mdresch/adpa/blob/adpa-project-charter/app/process-flow/visual-pipeline/components/PipelineDashboard.tsx"
click node_pipeline_api "https://github.com/mdresch/adpa/blob/adpa-project-charter/app/process-flow/visual-pipeline/hooks/usePipelineAPI.ts"
click node_review_routes "https://github.com/mdresch/adpa/blob/adpa-project-charter/server/src/routes/reviewRoutes.ts"
click node_database "https://github.com/mdresch/adpa/blob/adpa-project-charter/server/src/database/connection.ts"

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_projects,node_project_api,node_project_space,node_portfolio,node_user toneBlue
class node_document_library,node_upload,node_generation,node_templates,node_doc_view toneAmber
class node_ai_orchestration,node_chat_api,node_context_retrieval,node_keyword_search,node_rag_api toneMint
class node_integrations,node_digital_twin,node_trigger_rules,node_governance,node_governance_store toneRose
class node_dashboard,node_pipeline,node_pipeline_api,node_review_routes,node_database,node_actor_services toneIndigo
```

## Components

### Project workspace

- [Project management](https://github.com/mdresch/adpa/blob/adpa-project-charter/app/projects/projects-workspace.tsx): `app/projects/projects-workspace.tsx`
- [Project API](https://github.com/mdresch/adpa/blob/adpa-project-charter/app/api/projects/route.ts): `app/api/projects/route.ts`
- [Project workspace](https://github.com/mdresch/adpa/blob/adpa-project-charter/app/projects/%5Bid%5D/components/project-workspace.tsx): `app/projects/[id]/components/project-workspace.tsx`
- [Portfolio planning](https://github.com/mdresch/adpa/blob/adpa-project-charter/app/portfolio/page.tsx): `app/portfolio/page.tsx`

### Document lifecycle

- [Document library](https://github.com/mdresch/adpa/blob/adpa-project-charter/app/documents/document-library-workspace.tsx): `app/documents/document-library-workspace.tsx`
- [Document upload](https://github.com/mdresch/adpa/blob/adpa-project-charter/app/api/documents/upload/route.ts): `app/api/documents/upload/route.ts`
- [Document generation](https://github.com/mdresch/adpa/blob/adpa-project-charter/app/api/generate/route.ts): `app/api/generate/route.ts`
- [Template management](https://github.com/mdresch/adpa/blob/adpa-project-charter/app/templates/page.tsx): `app/templates/page.tsx`
- [Document viewing](https://github.com/mdresch/adpa/blob/adpa-project-charter/components/documents/DocumentViewer.tsx): `components/documents/DocumentViewer.tsx`

### AI and retrieval

- [AI provider orchestration](https://github.com/mdresch/adpa/blob/adpa-project-charter/server/src/services/aiService.ts): `server/src/services/aiService.ts`
- [Chat endpoint](https://github.com/mdresch/adpa/blob/adpa-project-charter/app/api/chat/route.ts): `app/api/chat/route.ts`
- [Context retrieval](https://github.com/mdresch/adpa/blob/adpa-project-charter/server/src/modules/contextRetrieval/contextRetrievalService.ts): `server/src/modules/contextRetrieval/contextRetrievalService.ts`
- [Keyword search](https://github.com/mdresch/adpa/blob/adpa-project-charter/server/src/modules/contextRetrieval/engines/keywordSearchEngine.ts): `server/src/modules/contextRetrieval/engines/keywordSearchEngine.ts`
- [RAG endpoints](https://github.com/mdresch/adpa/blob/adpa-project-charter/server/src/routes/ragRoutes.ts): `server/src/routes/ragRoutes.ts`

### Integrations and governance

- [Enterprise integrations](https://github.com/mdresch/adpa/blob/adpa-project-charter/app/integrations/integrations-workspace.tsx): `app/integrations/integrations-workspace.tsx`
- [Digital twins](https://github.com/mdresch/adpa/blob/adpa-project-charter/app/(dashboard)/digital-twin/page.tsx): `app/(dashboard)/digital-twin/page.tsx`
- [Twin trigger rules](https://github.com/mdresch/adpa/blob/adpa-project-charter/components/digital-twin/DigitalTwinTriggerRulesManager.tsx): `components/digital-twin/DigitalTwinTriggerRulesManager.tsx`
- [Governance rituals](https://github.com/mdresch/adpa/blob/adpa-project-charter/orchestrator/Adpa.Orchestrator/Controllers/RitualController.cs): `orchestrator/Adpa.Orchestrator/Controllers/RitualController.cs`
- [Governance ledger](https://github.com/mdresch/adpa/blob/adpa-project-charter/orchestrator/Adpa.Orchestrator/Data/GovernanceDbContext.cs): `orchestrator/Adpa.Orchestrator/Data/GovernanceDbContext.cs`

### Monitoring and orchestration

- [Analytics dashboard](https://github.com/mdresch/adpa/blob/adpa-project-charter/app/analytics/page.tsx): `app/analytics/page.tsx`
- [Pipeline dashboard](https://github.com/mdresch/adpa/blob/adpa-project-charter/app/process-flow/visual-pipeline/components/PipelineDashboard.tsx): `app/process-flow/visual-pipeline/components/PipelineDashboard.tsx`
- [Pipeline API client](https://github.com/mdresch/adpa/blob/adpa-project-charter/app/process-flow/visual-pipeline/hooks/usePipelineAPI.ts): `app/process-flow/visual-pipeline/hooks/usePipelineAPI.ts`
- [Review scheduling](https://github.com/mdresch/adpa/blob/adpa-project-charter/server/src/routes/reviewRoutes.ts): `server/src/routes/reviewRoutes.ts`
- [PostgreSQL access](https://github.com/mdresch/adpa/blob/adpa-project-charter/server/src/database/connection.ts): `server/src/database/connection.ts`

### Other components

- **Organization user**
- **Enterprise services**

## Connections

- Organization user → Project management: organizes work (evidence: `README.md`)
- Project management → Project API: loads projects (evidence: `app/api/projects/route.ts`)
- Organization user → Project workspace: manages project (evidence: `README.md`)
- Organization user → Document library: manages documents (evidence: `README.md`)
- Document library → Document upload: uploads files (evidence: `README.md`)
- Organization user → Template management: selects templates (evidence: `README.md`)
- Organization user → Document generation: requests generation (evidence: `README.md`)
- Document generation → AI provider orchestration: generates content
- Chat endpoint → Context retrieval: retrieves context
- Context retrieval → Keyword search: runs keyword search (evidence: `server/src/modules/contextRetrieval/contextRetrievalService.ts`)
- Context retrieval → PostgreSQL access: queries data (evidence: `server/src/modules/contextRetrieval/contextRetrievalService.ts`)
- RAG endpoints → Context retrieval: serves retrieval
- Document generation → Document viewing: produces documents
- Document library → Enterprise integrations: publishes or syncs
- Organization user → Enterprise integrations: configures integrations (evidence: `README.md`)
- Organization user → Portfolio planning: plans portfolio (evidence: `README.md`)
- Organization user → Digital twins: manages twins
- Digital twins → Twin trigger rules: manages rules (evidence: `components/digital-twin/DigitalTwinTriggerRulesManager.tsx`)
- Organization user → Governance rituals: reviews governance
- Governance rituals → Governance ledger: persists ledger (evidence: `orchestrator/Adpa.Orchestrator/Controllers/RitualController.cs`)
- Governance rituals → Enterprise services: checks governance
- Organization user → Analytics dashboard: monitors activity (evidence: `README.md`)
- Analytics dashboard → Pipeline dashboard: shows pipeline status
- Pipeline dashboard → Pipeline API client: requests job data
- Pipeline API client → Enterprise services: calls pipeline API (evidence: `app/process-flow/visual-pipeline/hooks/usePipelineAPI.ts`)
- Review scheduling → PostgreSQL access: checks programs (evidence: `server/src/routes/reviewRoutes.ts`)
- Enterprise services → Enterprise integrations: connects external tools (evidence: `README.md`)
