# sajaalsaho/ai-codelens architecture

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

- Interactive diagram: https://gitdiagram.com/sajaalsaho/ai-codelens
- Repository: https://github.com/sajaalsaho/ai-codelens

## Overview

AI-CodeLens is an ASP.NET Core code-review API. A developer submits source code; the controller passes it to the application review service, which creates a session and reports findings for blank input, long lines, and TODO markers; the controller returns the review result. The domain models sessions and findings. Although the README describes an AI-assisted product, the infrastructure AI service is currently an unimplemented placeholder and is not wired into this workflow. Edges reflect the shown controller, service, and registration code; no persistence is shown.

Main entry points: [`AI-CodeLens.API/Controllers/CodeReviewController.cs`](https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.API/Controllers/CodeReviewController.cs) (Review Endpoint), [`AI-CodeLens.Application/Services/CodeReviewService.cs`](https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.Application/Services/CodeReviewService.cs) (Review Service), [`AI-CodeLens.Domain/Entities/Finding.cs`](https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.Domain/Entities/Finding.cs) (Finding), [`AI-CodeLens.API/Program.cs`](https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.API/Program.cs) (API Startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_controller["Review Endpoint"]
  node_request["Review Request<br/>[ReviewRequest.cs]"]
  node_response["Review Response<br/>[ReviewResponse.cs]"]
  node_startup["API Startup<br/>[Program.cs]"]
end

subgraph group_application["Review Logic"]
  node_review_interface["Review Contract"]
  node_review_service["Review Service"]
end

subgraph group_domain["Review Domain"]
  node_session["Review Session<br/>[ReviewSession.cs]"]
  node_finding["Finding<br/>[Finding.cs]"]
end

subgraph group_infrastructure["AI Integration"]
  node_ai_interface["AI Contract<br/>[IAIService.cs]"]
  node_ai_service["AI Service<br/>[AIService.cs]"]
end

node_developer(("Developer"))

node_developer -->|"submits code"| node_controller
node_controller -->|"accepts"| node_request
node_controller -->|"calls"| node_review_interface
node_controller -->|"builds response"| node_response
node_review_service -->|"implements"| node_review_interface
node_review_service -->|"creates"| node_session
node_review_service -->|"creates"| node_finding
node_session -->|"holds"| node_finding
node_response -->|"includes"| node_finding
node_startup -->|"registers"| node_review_service
node_startup -->|"maps routes"| node_controller
node_ai_service -->|"implements"| node_ai_interface

click node_controller "https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.API/Controllers/CodeReviewController.cs"
click node_request "https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.Application/DTOs/ReviewRequest.cs"
click node_response "https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.Application/DTOs/ReviewResponse.cs"
click node_review_interface "https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.Application/Interfaces/ICodeReviewService.cs"
click node_review_service "https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.Application/Services/CodeReviewService.cs"
click node_session "https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.Domain/Entities/ReviewSession.cs"
click node_finding "https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.Domain/Entities/Finding.cs"
click node_ai_interface "https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.Infrastructure/Interfaces/IAIService.cs"
click node_ai_service "https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.Infrastructure/Services/AIService.cs"
click node_startup "https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.API/Program.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_controller,node_request,node_response,node_startup toneBlue
class node_review_interface,node_review_service toneAmber
class node_session,node_finding toneMint
class node_ai_interface,node_ai_service toneRose
class node_developer toneIndigo
```

## Components

### HTTP API

- [Review Endpoint](https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.API/Controllers/CodeReviewController.cs): `AI-CodeLens.API/Controllers/CodeReviewController.cs`
- [Review Request](https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.Application/DTOs/ReviewRequest.cs): `AI-CodeLens.Application/DTOs/ReviewRequest.cs`
- [Review Response](https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.Application/DTOs/ReviewResponse.cs): `AI-CodeLens.Application/DTOs/ReviewResponse.cs`
- [API Startup](https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.API/Program.cs): `AI-CodeLens.API/Program.cs`

### Review Logic

- [Review Contract](https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.Application/Interfaces/ICodeReviewService.cs): `AI-CodeLens.Application/Interfaces/ICodeReviewService.cs`
- [Review Service](https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.Application/Services/CodeReviewService.cs): `AI-CodeLens.Application/Services/CodeReviewService.cs`

### Review Domain

- [Review Session](https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.Domain/Entities/ReviewSession.cs): `AI-CodeLens.Domain/Entities/ReviewSession.cs`
- [Finding](https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.Domain/Entities/Finding.cs): `AI-CodeLens.Domain/Entities/Finding.cs`

### AI Integration

- [AI Contract](https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.Infrastructure/Interfaces/IAIService.cs): `AI-CodeLens.Infrastructure/Interfaces/IAIService.cs`
- [AI Service](https://github.com/sajaalsaho/ai-codelens/blob/main/AI-CodeLens.Infrastructure/Services/AIService.cs): `AI-CodeLens.Infrastructure/Services/AIService.cs`

### Other components

- **Developer**

## Connections

- Developer → Review Endpoint: submits code (evidence: `AI-CodeLens.API/Controllers/CodeReviewController.cs`)
- Review Endpoint → Review Request: accepts (evidence: `AI-CodeLens.API/Controllers/CodeReviewController.cs`)
- Review Endpoint → Review Contract: calls (evidence: `AI-CodeLens.API/Controllers/CodeReviewController.cs`)
- Review Endpoint → Review Response: builds response (evidence: `AI-CodeLens.API/Controllers/CodeReviewController.cs`)
- Review Service → Review Contract: implements (evidence: `AI-CodeLens.Application/Services/CodeReviewService.cs`)
- Review Service → Review Session: creates (evidence: `AI-CodeLens.Application/Services/CodeReviewService.cs`)
- Review Service → Finding: creates (evidence: `AI-CodeLens.Application/Services/CodeReviewService.cs`)
- Review Session → Finding: holds (evidence: `AI-CodeLens.Domain/Entities/ReviewSession.cs`)
- Review Response → Finding: includes (evidence: `AI-CodeLens.Application/DTOs/ReviewResponse.cs`)
- API Startup → Review Service: registers (evidence: `AI-CodeLens.API/Program.cs`)
- API Startup → Review Endpoint: maps routes (evidence: `AI-CodeLens.API/Program.cs`)
- AI Service → AI Contract: implements (evidence: `AI-CodeLens.Infrastructure/Services/AIService.cs`)
