# harshprajapati1910/aiw-platform architecture

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

- Interactive diagram: https://gitdiagram.com/harshprajapati1910/aiw-platform
- Repository: https://github.com/harshprajapati1910/aiw-platform

## Overview

AIW is a document-management and code-review application: users authenticate, create or upload documents, then request analysis or a streamed multi-specialist review; review results can be shown in the dashboard and persisted. The Angular client calls an ASP.NET API, which owns document operations and bridges review streams to a FastAPI/LangGraph service. The AI service also exposes a separate Ollama-backed analysis endpoint. The review controller’s persistence and stream forwarding are shown; several frontend/API and storage links are not visible in the supplied excerpts, so they are omitted or marked unverified.

Main entry points: [`ai-service/app/graph/workflow.py`](https://github.com/harshprajapati1910/aiw-platform/blob/main/ai-service/app/graph/workflow.py) (Review workflow), [`backend/src/AIW.Api/Controllers/DocumentsController.cs`](https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Api/Controllers/DocumentsController.cs) (Documents API), [`frontend/src/app/app.routes.ts`](https://github.com/harshprajapati1910/aiw-platform/blob/main/frontend/src/app/app.routes.ts) (App routes), [`backend/src/AIW.Api/Controllers/DocumentReviewController.cs`](https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Api/Controllers/DocumentReviewController.cs) (Review stream API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Angular client"]
  node_routes["App routes<br/>[app.routes.ts]"]
  node_login["Login<br/>[login.component.ts]"]
  node_authsvc["Auth service<br/>[auth.service.ts]"]
  node_doclist["Document list"]
  node_editor["Document editor"]
  node_docclient["Document client"]
  node_reviewui["Review dashboard"]
  node_reviewclient["Review stream client"]
end

subgraph group_api["ASP.NET API"]
  node_documentsapi["Documents API"]
  node_reviewapi["Review stream API"]
  node_authapi["Auth API<br/>[AuthController.cs]"]
end

subgraph group_application["Application services"]
  node_docservice["Document service<br/>[DocumentService.cs]"]
  node_extractor["File extractor"]
  node_agentclient["Agent review client"]
  node_analysisclient["Analysis client<br/>[AiServiceClient.cs]"]
end

subgraph group_review["AI review service"]
  node_ai["AI service<br/>[main.py]"]
  node_reviewroute["Review stream route<br/>[routes.py]"]
  node_workflow["Review workflow<br/>[workflow.py]"]
  node_supervisor["Review supervisor"]
  node_architecture["Architecture agent"]
  node_security["Security agent<br/>[security_agent.py]"]
  node_performance["Performance agent"]
  node_synthesis["Report synthesis<br/>[synthesis_agent.py]"]
  node_ollama["Ollama analysis<br/>[ollama_service.py]"]
end

subgraph group_persistence["Identity and persistence"]
  node_db[("Application database")]
  node_identity["Identity service<br/>[IdentityService.cs]"]
end

node_user(("User"))
node_modelservice["Ollama"]

node_user -->|"uses"| node_routes
node_routes -->|"routes to"| node_login
node_routes -->|"routes to"| node_doclist
node_routes -->|"routes to"| node_editor
node_doclist -.->|"uses"| node_docclient
node_editor -.->|"uses"| node_docclient
node_reviewui -->|"uses"| node_reviewclient
node_reviewclient -->|"opens SSE stream"| node_reviewapi
node_documentsapi -->|"manages documents"| node_docservice
node_documentsapi -->|"extracts uploads"| node_extractor
node_documentsapi -->|"requests analysis"| node_analysisclient
node_documentsapi -.->|"streams review"| node_agentclient
node_reviewapi -->|"loads document"| node_db
node_reviewapi -->|"requests review"| node_agentclient
node_reviewapi -->|"persists report"| node_db
node_agentclient -->|"posts review"| node_reviewroute
node_reviewroute -->|"streams graph"| node_workflow
node_workflow -->|"dispatches"| node_supervisor
node_workflow -->|"dispatches"| node_architecture
node_workflow -->|"dispatches"| node_security
node_workflow -->|"dispatches"| node_performance
node_workflow -->|"dispatches"| node_synthesis
node_ai -->|"registers route"| node_reviewroute
node_ai -->|"serves analysis"| node_ollama
node_ollama -->|"calls inference"| node_modelservice
node_authapi -.->|"delegates auth"| node_identity
node_identity -.->|"uses identity store"| node_db

click node_routes "https://github.com/harshprajapati1910/aiw-platform/blob/main/frontend/src/app/app.routes.ts"
click node_login "https://github.com/harshprajapati1910/aiw-platform/blob/main/frontend/src/app/features/auth/login/login.component.ts"
click node_authsvc "https://github.com/harshprajapati1910/aiw-platform/blob/main/frontend/src/app/core/services/auth.service.ts"
click node_doclist "https://github.com/harshprajapati1910/aiw-platform/blob/main/frontend/src/app/features/documents/pages/document-list/document-list.component.ts"
click node_editor "https://github.com/harshprajapati1910/aiw-platform/blob/main/frontend/src/app/features/documents/pages/document-editor/document-editor.component.ts"
click node_docclient "https://github.com/harshprajapati1910/aiw-platform/blob/main/frontend/src/app/features/documents/services/document.service.ts"
click node_reviewui "https://github.com/harshprajapati1910/aiw-platform/blob/main/frontend/src/app/features/review-dashboard/components/review-dashboard/review-dashboard.component.ts"
click node_reviewclient "https://github.com/harshprajapati1910/aiw-platform/blob/main/frontend/src/app/features/review-dashboard/services/review-dashboard.service.ts"
click node_documentsapi "https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Api/Controllers/DocumentsController.cs"
click node_reviewapi "https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Api/Controllers/DocumentReviewController.cs"
click node_authapi "https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Api/Controllers/AuthController.cs"
click node_docservice "https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Application/Documents/Services/DocumentService.cs"
click node_extractor "https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Application/Documents/Services/DocumentExtractor.cs"
click node_agentclient "https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Application/Documents/Services/AgentReviewClient.cs"
click node_analysisclient "https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Application/Analysis/Services/AiServiceClient.cs"
click node_ai "https://github.com/harshprajapati1910/aiw-platform/blob/main/ai-service/app/main.py"
click node_reviewroute "https://github.com/harshprajapati1910/aiw-platform/blob/main/ai-service/app/api/routes.py"
click node_workflow "https://github.com/harshprajapati1910/aiw-platform/blob/main/ai-service/app/graph/workflow.py"
click node_supervisor "https://github.com/harshprajapati1910/aiw-platform/blob/main/ai-service/app/graph/agents/supervisor_agent.py"
click node_architecture "https://github.com/harshprajapati1910/aiw-platform/blob/main/ai-service/app/graph/agents/architecture_agent.py"
click node_security "https://github.com/harshprajapati1910/aiw-platform/blob/main/ai-service/app/graph/agents/security_agent.py"
click node_performance "https://github.com/harshprajapati1910/aiw-platform/blob/main/ai-service/app/graph/agents/performance_agent.py"
click node_synthesis "https://github.com/harshprajapati1910/aiw-platform/blob/main/ai-service/app/graph/agents/synthesis_agent.py"
click node_ollama "https://github.com/harshprajapati1910/aiw-platform/blob/main/ai-service/app/services/ollama_service.py"
click node_db "https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Infrastructure/Persistence/ApplicationDbContext.cs"
click node_identity "https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Infrastructure/Identity/IdentityService.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_routes,node_login,node_authsvc,node_doclist,node_editor,node_docclient,node_reviewui,node_reviewclient,node_user toneBlue
class node_documentsapi,node_reviewapi,node_authapi toneAmber
class node_docservice,node_extractor,node_agentclient,node_analysisclient toneMint
class node_ai,node_reviewroute,node_workflow,node_supervisor,node_architecture,node_security,node_performance,node_synthesis,node_ollama toneRose
class node_db,node_identity,node_modelservice toneIndigo
```

## Components

### Angular client

- [App routes](https://github.com/harshprajapati1910/aiw-platform/blob/main/frontend/src/app/app.routes.ts): `frontend/src/app/app.routes.ts`
- [Login](https://github.com/harshprajapati1910/aiw-platform/blob/main/frontend/src/app/features/auth/login/login.component.ts): `frontend/src/app/features/auth/login/login.component.ts`
- [Auth service](https://github.com/harshprajapati1910/aiw-platform/blob/main/frontend/src/app/core/services/auth.service.ts): `frontend/src/app/core/services/auth.service.ts`
- [Document list](https://github.com/harshprajapati1910/aiw-platform/blob/main/frontend/src/app/features/documents/pages/document-list/document-list.component.ts): `frontend/src/app/features/documents/pages/document-list/document-list.component.ts`
- [Document editor](https://github.com/harshprajapati1910/aiw-platform/blob/main/frontend/src/app/features/documents/pages/document-editor/document-editor.component.ts): `frontend/src/app/features/documents/pages/document-editor/document-editor.component.ts`
- [Document client](https://github.com/harshprajapati1910/aiw-platform/blob/main/frontend/src/app/features/documents/services/document.service.ts): `frontend/src/app/features/documents/services/document.service.ts`
- [Review dashboard](https://github.com/harshprajapati1910/aiw-platform/blob/main/frontend/src/app/features/review-dashboard/components/review-dashboard/review-dashboard.component.ts): `frontend/src/app/features/review-dashboard/components/review-dashboard/review-dashboard.component.ts`
- [Review stream client](https://github.com/harshprajapati1910/aiw-platform/blob/main/frontend/src/app/features/review-dashboard/services/review-dashboard.service.ts): `frontend/src/app/features/review-dashboard/services/review-dashboard.service.ts`

### ASP.NET API

- [Documents API](https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Api/Controllers/DocumentsController.cs): `backend/src/AIW.Api/Controllers/DocumentsController.cs`
- [Review stream API](https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Api/Controllers/DocumentReviewController.cs): `backend/src/AIW.Api/Controllers/DocumentReviewController.cs`
- [Auth API](https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Api/Controllers/AuthController.cs): `backend/src/AIW.Api/Controllers/AuthController.cs`

### Application services

- [Document service](https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Application/Documents/Services/DocumentService.cs): `backend/src/AIW.Application/Documents/Services/DocumentService.cs`
- [File extractor](https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Application/Documents/Services/DocumentExtractor.cs): `backend/src/AIW.Application/Documents/Services/DocumentExtractor.cs`
- [Agent review client](https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Application/Documents/Services/AgentReviewClient.cs): `backend/src/AIW.Application/Documents/Services/AgentReviewClient.cs`
- [Analysis client](https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Application/Analysis/Services/AiServiceClient.cs): `backend/src/AIW.Application/Analysis/Services/AiServiceClient.cs`

### AI review service

- [AI service](https://github.com/harshprajapati1910/aiw-platform/blob/main/ai-service/app/main.py): `ai-service/app/main.py`
- [Review stream route](https://github.com/harshprajapati1910/aiw-platform/blob/main/ai-service/app/api/routes.py): `ai-service/app/api/routes.py`
- [Review workflow](https://github.com/harshprajapati1910/aiw-platform/blob/main/ai-service/app/graph/workflow.py): `ai-service/app/graph/workflow.py`
- [Review supervisor](https://github.com/harshprajapati1910/aiw-platform/blob/main/ai-service/app/graph/agents/supervisor_agent.py): `ai-service/app/graph/agents/supervisor_agent.py`
- [Architecture agent](https://github.com/harshprajapati1910/aiw-platform/blob/main/ai-service/app/graph/agents/architecture_agent.py): `ai-service/app/graph/agents/architecture_agent.py`
- [Security agent](https://github.com/harshprajapati1910/aiw-platform/blob/main/ai-service/app/graph/agents/security_agent.py): `ai-service/app/graph/agents/security_agent.py`
- [Performance agent](https://github.com/harshprajapati1910/aiw-platform/blob/main/ai-service/app/graph/agents/performance_agent.py): `ai-service/app/graph/agents/performance_agent.py`
- [Report synthesis](https://github.com/harshprajapati1910/aiw-platform/blob/main/ai-service/app/graph/agents/synthesis_agent.py): `ai-service/app/graph/agents/synthesis_agent.py`
- [Ollama analysis](https://github.com/harshprajapati1910/aiw-platform/blob/main/ai-service/app/services/ollama_service.py): `ai-service/app/services/ollama_service.py`

### Identity and persistence

- [Application database](https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Infrastructure/Persistence/ApplicationDbContext.cs): `backend/src/AIW.Infrastructure/Persistence/ApplicationDbContext.cs`
- [Identity service](https://github.com/harshprajapati1910/aiw-platform/blob/main/backend/src/AIW.Infrastructure/Identity/IdentityService.cs): `backend/src/AIW.Infrastructure/Identity/IdentityService.cs`

### Other components

- **User**
- **Ollama**

## Connections

- User → App routes: uses (evidence: `frontend/src/app/app.routes.ts`)
- App routes → Login: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routes → Document list: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routes → Document editor: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Document list → Document client: uses
- Document editor → Document client: uses
- Review dashboard → Review stream client: uses (evidence: `frontend/src/app/features/review-dashboard/components/review-dashboard/review-dashboard.component.ts`)
- Review stream client → Review stream API: opens SSE stream (evidence: `frontend/src/app/features/review-dashboard/services/review-dashboard.service.ts`)
- Documents API → Document service: manages documents (evidence: `backend/src/AIW.Api/Controllers/DocumentsController.cs`)
- Documents API → File extractor: extracts uploads (evidence: `backend/src/AIW.Api/Controllers/DocumentsController.cs`)
- Documents API → Analysis client: requests analysis (evidence: `backend/src/AIW.Api/Controllers/DocumentsController.cs`)
- Documents API → Agent review client: streams review
- Review stream API → Application database: loads document (evidence: `backend/src/AIW.Api/Controllers/DocumentReviewController.cs`)
- Review stream API → Agent review client: requests review (evidence: `backend/src/AIW.Api/Controllers/DocumentReviewController.cs`)
- Review stream API → Application database: persists report (evidence: `backend/src/AIW.Api/Controllers/DocumentReviewController.cs`)
- Agent review client → Review stream route: posts review (evidence: `backend/src/AIW.Application/Documents/Services/AgentReviewClient.cs`)
- Review stream route → Review workflow: streams graph (evidence: `ai-service/app/api/routes.py`)
- Review workflow → Review supervisor: dispatches (evidence: `ai-service/app/graph/workflow.py`)
- Review workflow → Architecture agent: dispatches (evidence: `ai-service/app/graph/workflow.py`)
- Review workflow → Security agent: dispatches (evidence: `ai-service/app/graph/workflow.py`)
- Review workflow → Performance agent: dispatches (evidence: `ai-service/app/graph/workflow.py`)
- Review workflow → Report synthesis: dispatches (evidence: `ai-service/app/graph/workflow.py`)
- AI service → Review stream route: registers route (evidence: `ai-service/app/main.py`)
- AI service → Ollama analysis: serves analysis (evidence: `ai-service/app/main.py`)
- Ollama analysis → Ollama: calls inference (evidence: `ai-service/app/services/ollama_service.py`)
- Auth API → Identity service: delegates auth
- Identity service → Application database: uses identity store
