# ojashwap/docdev architecture

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

- Interactive diagram: https://gitdiagram.com/ojashwap/docdev
- Repository: https://github.com/ojashwap/docdev

## Overview

Docaya is an enterprise electronic document management system that governs a document from capture to official publication. The intended workflow is staging, manual registration and classification, multi-stage review against working-day SLA targets, then unchanged promotion to SharePoint; approved records also support search and Ask/Browse. The React entry point loads the prototype UI, while sampled App.tsx shows API-backed workspace actions. The API’s use cases and most adapters are documented but not sampled, so their internal wiring is shown only where documentation or source supports it.

Main entry points: [`src/api/Docaya.Application`](https://github.com/ojashwap/docdev/tree/main/src/api/Docaya.Application) (Use cases and ports), [`src/web/src/prototype`](https://github.com/ojashwap/docdev/tree/main/src/web/src/prototype) (Workspace screens), [`src/functions/Orchestrations/DocumentPromotionOrchestrator.cs`](https://github.com/ojashwap/docdev/blob/main/src/functions/Orchestrations/DocumentPromotionOrchestrator.cs) (Promotion workflow), [`src/web/src/services/api.ts`](https://github.com/ojashwap/docdev/blob/main/src/web/src/services/api.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_web["React UI<br/>[main.tsx]"]
  node_prototype["Workspace screens"]
  node_api_client["API client<br/>[api.ts]"]
  node_search["Search and Ask<br/>[AskDocayaPanel.tsx]"]
  node_notifications["Notifications"]
  node_admin["Administration<br/>[AdminCenter.tsx]"]
end

subgraph group_governance["Document governance"]
  node_domain["Workflow rules<br/>[Docaya.Domain]"]
  node_staging["Staging storage"]
  node_classification["Manual classification"]
  node_review["Approval workflow"]
  node_sla["Working-day SLA"]
end

subgraph group_platform["API and persistence"]
  node_contracts["API contracts"]
  node_api_host["HTTP API host<br/>[Program.cs]"]
  node_application["Use cases and ports<br/>[Docaya.Application]"]
  node_infrastructure["Provider adapters"]
  node_sql[("Docaya SQL<br/>[DocayaDbContext.cs]")]
end

subgraph group_automation["Background processing"]
  node_functions["Functions host<br/>[Program.cs]"]
  node_promotion["Promotion workflow"]
  node_activities["Promotion activities"]
end

node_user(("Staff user"))
node_sharepoint["SharePoint Online"]

node_user -->|"uses"| node_web
node_web -->|"renders"| node_prototype
node_prototype -.->|"requests data"| node_api_client
node_api_client -.->|"calls"| node_api_host
node_contracts -.->|"defines contract"| node_api_client
node_api_host -.->|"dispatches requests"| node_application
node_application -.->|"applies rules"| node_domain
node_application -.->|"uses port"| node_staging
node_application -.->|"registers metadata"| node_classification
node_application -.->|"evaluates decisions"| node_review
node_application -.->|"calculates targets"| node_sla
node_infrastructure -->|"configures persistence"| node_sql
node_infrastructure -->|"implements ports"| node_application
node_functions -->|"registers services"| node_application
node_functions -->|"hosts orchestration"| node_promotion
node_promotion -->|"dispatches steps"| node_activities
node_activities -.->|"promotes file"| node_sharepoint
node_promotion -.->|"indexes published version"| node_search
node_prototype -->|"offers discovery"| node_search
node_prototype -->|"offers notifications"| node_notifications
node_prototype -->|"offers administration"| node_admin

click node_web "https://github.com/ojashwap/docdev/blob/main/src/web/src/main.tsx"
click node_prototype "https://github.com/ojashwap/docdev/tree/main/src/web/src/prototype"
click node_api_client "https://github.com/ojashwap/docdev/blob/main/src/web/src/services/api.ts"
click node_contracts "https://github.com/ojashwap/docdev/tree/main/src/contracts"
click node_api_host "https://github.com/ojashwap/docdev/blob/main/src/api/Docaya.Api/Program.cs"
click node_application "https://github.com/ojashwap/docdev/tree/main/src/api/Docaya.Application"
click node_domain "https://github.com/ojashwap/docdev/tree/main/src/api/Docaya.Domain"
click node_staging "https://github.com/ojashwap/docdev/blob/main/src/api/Docaya.Application/Ports/IStagingContentStore.cs"
click node_classification "https://github.com/ojashwap/docdev/blob/main/src/api/Docaya.Domain/Documents/ClassificationDimensions.cs"
click node_review "https://github.com/ojashwap/docdev/blob/main/src/api/Docaya.Domain/Documents/DocumentStateMachine.cs"
click node_sla "https://github.com/ojashwap/docdev/blob/main/src/api/Docaya.Domain/Workflow/WorkingDayCalendar.cs"
click node_infrastructure "https://github.com/ojashwap/docdev/tree/main/src/api/Docaya.Infrastructure"
click node_sql "https://github.com/ojashwap/docdev/blob/main/src/api/Docaya.Infrastructure/Persistence/DocayaDbContext.cs"
click node_functions "https://github.com/ojashwap/docdev/blob/main/src/functions/Program.cs"
click node_promotion "https://github.com/ojashwap/docdev/blob/main/src/functions/Orchestrations/DocumentPromotionOrchestrator.cs"
click node_activities "https://github.com/ojashwap/docdev/blob/main/src/functions/Activities/PromotionActivities.cs"
click node_search "https://github.com/ojashwap/docdev/blob/main/src/web/src/features/assistant/AskDocayaPanel.tsx"
click node_notifications "https://github.com/ojashwap/docdev/tree/main/src/web/src/features/notifications"
click node_admin "https://github.com/ojashwap/docdev/blob/main/src/web/src/features/admin/AdminCenter.tsx"

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_web,node_prototype,node_api_client,node_search,node_notifications,node_admin,node_user toneBlue
class node_domain,node_staging,node_classification,node_review,node_sla toneAmber
class node_contracts,node_api_host,node_application,node_infrastructure,node_sql toneMint
class node_functions,node_promotion,node_activities toneRose
class node_sharepoint toneIndigo
```

## Components

### User experience

- [React UI](https://github.com/ojashwap/docdev/blob/main/src/web/src/main.tsx): `src/web/src/main.tsx`
- [Workspace screens](https://github.com/ojashwap/docdev/tree/main/src/web/src/prototype): `src/web/src/prototype`
- [API client](https://github.com/ojashwap/docdev/blob/main/src/web/src/services/api.ts): `src/web/src/services/api.ts`
- [Search and Ask](https://github.com/ojashwap/docdev/blob/main/src/web/src/features/assistant/AskDocayaPanel.tsx): `src/web/src/features/assistant/AskDocayaPanel.tsx`
- [Notifications](https://github.com/ojashwap/docdev/tree/main/src/web/src/features/notifications): `src/web/src/features/notifications`
- [Administration](https://github.com/ojashwap/docdev/blob/main/src/web/src/features/admin/AdminCenter.tsx): `src/web/src/features/admin/AdminCenter.tsx`

### Document governance

- [Workflow rules](https://github.com/ojashwap/docdev/tree/main/src/api/Docaya.Domain): `src/api/Docaya.Domain`
- [Staging storage](https://github.com/ojashwap/docdev/blob/main/src/api/Docaya.Application/Ports/IStagingContentStore.cs): `src/api/Docaya.Application/Ports/IStagingContentStore.cs`
- [Manual classification](https://github.com/ojashwap/docdev/blob/main/src/api/Docaya.Domain/Documents/ClassificationDimensions.cs): `src/api/Docaya.Domain/Documents/ClassificationDimensions.cs`
- [Approval workflow](https://github.com/ojashwap/docdev/blob/main/src/api/Docaya.Domain/Documents/DocumentStateMachine.cs): `src/api/Docaya.Domain/Documents/DocumentStateMachine.cs`
- [Working-day SLA](https://github.com/ojashwap/docdev/blob/main/src/api/Docaya.Domain/Workflow/WorkingDayCalendar.cs): `src/api/Docaya.Domain/Workflow/WorkingDayCalendar.cs`

### API and persistence

- [API contracts](https://github.com/ojashwap/docdev/tree/main/src/contracts): `src/contracts`
- [HTTP API host](https://github.com/ojashwap/docdev/blob/main/src/api/Docaya.Api/Program.cs): `src/api/Docaya.Api/Program.cs`
- [Use cases and ports](https://github.com/ojashwap/docdev/tree/main/src/api/Docaya.Application): `src/api/Docaya.Application`
- [Provider adapters](https://github.com/ojashwap/docdev/tree/main/src/api/Docaya.Infrastructure): `src/api/Docaya.Infrastructure`
- [Docaya SQL](https://github.com/ojashwap/docdev/blob/main/src/api/Docaya.Infrastructure/Persistence/DocayaDbContext.cs): `src/api/Docaya.Infrastructure/Persistence/DocayaDbContext.cs`

### Background processing

- [Functions host](https://github.com/ojashwap/docdev/blob/main/src/functions/Program.cs): `src/functions/Program.cs`
- [Promotion workflow](https://github.com/ojashwap/docdev/blob/main/src/functions/Orchestrations/DocumentPromotionOrchestrator.cs): `src/functions/Orchestrations/DocumentPromotionOrchestrator.cs`
- [Promotion activities](https://github.com/ojashwap/docdev/blob/main/src/functions/Activities/PromotionActivities.cs): `src/functions/Activities/PromotionActivities.cs`

### Other components

- **Staff user**
- **SharePoint Online**

## Connections

- Staff user → React UI: uses
- React UI → Workspace screens: renders
- Workspace screens → API client: requests data
- API client → HTTP API host: calls
- API contracts → API client: defines contract
- HTTP API host → Use cases and ports: dispatches requests
- Use cases and ports → Workflow rules: applies rules
- Use cases and ports → Staging storage: uses port
- Use cases and ports → Manual classification: registers metadata
- Use cases and ports → Approval workflow: evaluates decisions
- Use cases and ports → Working-day SLA: calculates targets
- Provider adapters → Docaya SQL: configures persistence
- Provider adapters → Use cases and ports: implements ports
- Functions host → Use cases and ports: registers services
- Functions host → Promotion workflow: hosts orchestration
- Promotion workflow → Promotion activities: dispatches steps
- Promotion activities → SharePoint Online: promotes file
- Promotion workflow → Search and Ask: indexes published version
- Workspace screens → Search and Ask: offers discovery
- Workspace screens → Notifications: offers notifications
- Workspace screens → Administration: offers administration
