# sadeshraj/v-sense architecture

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

- Interactive diagram: https://gitdiagram.com/sadeshraj/v-sense
- Repository: https://github.com/sadeshraj/v-sense

## Overview

V-Sense combines vehicle-history and valuation workflows with garage operations, administrative review, and customer support. The evidenced AI path runs from a workflow request through coordinator, history, fraud, and validation stages; the API also exposes persisted workflow records for review. The React app routes users to public, garage, and admin experiences. Mobile is documented as a customer and inspector app, but its runtime source is not present in the supplied tree. Links are limited to relationships shown in excerpts, the SOURCE INDEX, or README.

Main entry points: [`agentic-ai/api/main.py`](https://github.com/sadeshraj/v-sense/blob/main/agentic-ai/api/main.py) (AI workflow API), [`frontend-web/src/App.jsx`](https://github.com/sadeshraj/v-sense/blob/main/frontend-web/src/App.jsx) (Web routing), [`backend/VSense.Infrastructure/Persistence/ApplicationDbContext.cs`](https://github.com/sadeshraj/v-sense/blob/main/backend/VSense.Infrastructure/Persistence/ApplicationDbContext.cs) (Database context), [`backend/VSense.API/Program.cs`](https://github.com/sadeshraj/v-sense/blob/main/backend/VSense.API/Program.cs) (API host)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_web_app["Web routing<br/>[App.jsx]"]
  node_garage_dashboard["Garage dashboard"]
  node_admin_review["Admin review"]
  node_admin_support["Admin support"]
  node_web_auth["Web authentication<br/>[auth.js]"]
end

subgraph group_api["ASP.NET API"]
  node_api_host["API host<br/>[Program.cs]"]
  node_api_controllers["Business controllers<br/>[Controllers]"]
  node_workflow_controller["Workflow controller"]
  node_support_controller["Support controller"]
  node_notification_service["Notifications"]
  node_email_service["Email delivery<br/>[EmailService.cs]"]
end

subgraph group_ai["AI workflows"]
  node_ai_api["AI workflow API<br/>[main.py]"]
  node_coordinator["Workflow coordinator<br/>[coordinator.py]"]
  node_history_agent["History analysis"]
  node_fraud_agent["Fraud detection<br/>[fraud_detection.py]"]
  node_valuation_agent["Valuation validation"]
  node_workflow_state["Workflow state<br/>[schema.py]"]
  node_ai_persistence["AI persistence<br/>[persistence.py]"]
end

subgraph group_data["Domain and persistence"]
  node_domain_entities["Domain records<br/>[Entities]"]
  node_db_context[("Database context")]
end

subgraph group_mobile["Mobile app"]
  node_mobile_app["Customer and inspector app"]
end

node_customer(("Customer"))
node_garage_user(("Garage staff"))
node_administrator(("Administrator"))

node_customer -->|"uses"| node_web_app
node_garage_user -->|"uses"| node_web_app
node_administrator -->|"uses"| node_web_app
node_web_app -->|"routes to"| node_garage_dashboard
node_web_app -->|"routes to"| node_admin_review
node_web_app -->|"routes to"| node_admin_support
node_garage_dashboard -->|"logs out via"| node_web_auth
node_api_host -->|"configures"| node_db_context
node_api_host -->|"maps"| node_api_controllers
node_workflow_controller -->|"queries and updates"| node_db_context
node_workflow_controller -.->|"dispatches workflow"| node_ai_api
node_support_controller -->|"stores support data"| node_db_context
node_support_controller -->|"uses support records"| node_domain_entities
node_notification_service -->|"reads and writes"| node_db_context
node_notification_service -->|"uses notification records"| node_domain_entities
node_ai_api -->|"initializes"| node_workflow_state
node_ai_api -->|"dispatches"| node_coordinator
node_ai_api -->|"dispatches"| node_history_agent
node_ai_api -->|"dispatches"| node_fraud_agent
node_ai_api -->|"dispatches"| node_valuation_agent
node_customer -->|"uses"| node_mobile_app
node_garage_user -->|"inspects with"| node_mobile_app

click node_web_app "https://github.com/sadeshraj/v-sense/blob/main/frontend-web/src/App.jsx"
click node_garage_dashboard "https://github.com/sadeshraj/v-sense/blob/main/frontend-web/src/pages/GarageDashboard.jsx"
click node_admin_review "https://github.com/sadeshraj/v-sense/blob/main/frontend-web/src/pages/admin/HITLReviewQueue.jsx"
click node_admin_support "https://github.com/sadeshraj/v-sense/blob/main/frontend-web/src/pages/admin/CustomerSupport.jsx"
click node_web_auth "https://github.com/sadeshraj/v-sense/blob/main/frontend-web/src/api/auth.js"
click node_api_host "https://github.com/sadeshraj/v-sense/blob/main/backend/VSense.API/Program.cs"
click node_api_controllers "https://github.com/sadeshraj/v-sense/tree/main/backend/VSense.API/Controllers"
click node_workflow_controller "https://github.com/sadeshraj/v-sense/blob/main/backend/VSense.API/Controllers/WorkflowsController.cs"
click node_support_controller "https://github.com/sadeshraj/v-sense/blob/main/backend/VSense.API/Controllers/SupportController.cs"
click node_notification_service "https://github.com/sadeshraj/v-sense/blob/main/backend/VSense.Infrastructure/Services/NotificationService.cs"
click node_email_service "https://github.com/sadeshraj/v-sense/blob/main/backend/VSense.Infrastructure/Services/EmailService.cs"
click node_ai_api "https://github.com/sadeshraj/v-sense/blob/main/agentic-ai/api/main.py"
click node_coordinator "https://github.com/sadeshraj/v-sense/blob/main/agentic-ai/agents/coordinator.py"
click node_history_agent "https://github.com/sadeshraj/v-sense/blob/main/agentic-ai/agents/history_analysis.py"
click node_fraud_agent "https://github.com/sadeshraj/v-sense/blob/main/agentic-ai/agents/fraud_detection.py"
click node_valuation_agent "https://github.com/sadeshraj/v-sense/blob/main/agentic-ai/agents/valuation_validation.py"
click node_workflow_state "https://github.com/sadeshraj/v-sense/blob/main/agentic-ai/state/schema.py"
click node_ai_persistence "https://github.com/sadeshraj/v-sense/blob/main/agentic-ai/state/persistence.py"
click node_domain_entities "https://github.com/sadeshraj/v-sense/tree/main/backend/VSense.Domain/Entities"
click node_db_context "https://github.com/sadeshraj/v-sense/blob/main/backend/VSense.Infrastructure/Persistence/ApplicationDbContext.cs"
click node_mobile_app "https://github.com/sadeshraj/v-sense/tree/main/mobile"

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_app,node_garage_dashboard,node_admin_review,node_admin_support,node_web_auth toneBlue
class node_api_host,node_api_controllers,node_workflow_controller,node_support_controller,node_notification_service,node_email_service toneAmber
class node_ai_api,node_coordinator,node_history_agent,node_fraud_agent,node_valuation_agent,node_workflow_state,node_ai_persistence toneMint
class node_domain_entities,node_db_context toneRose
class node_mobile_app,node_customer,node_garage_user,node_administrator toneIndigo
```

## Components

### Web application

- [Web routing](https://github.com/sadeshraj/v-sense/blob/main/frontend-web/src/App.jsx): `frontend-web/src/App.jsx`
- [Garage dashboard](https://github.com/sadeshraj/v-sense/blob/main/frontend-web/src/pages/GarageDashboard.jsx): `frontend-web/src/pages/GarageDashboard.jsx`
- [Admin review](https://github.com/sadeshraj/v-sense/blob/main/frontend-web/src/pages/admin/HITLReviewQueue.jsx): `frontend-web/src/pages/admin/HITLReviewQueue.jsx`
- [Admin support](https://github.com/sadeshraj/v-sense/blob/main/frontend-web/src/pages/admin/CustomerSupport.jsx): `frontend-web/src/pages/admin/CustomerSupport.jsx`
- [Web authentication](https://github.com/sadeshraj/v-sense/blob/main/frontend-web/src/api/auth.js): `frontend-web/src/api/auth.js`

### ASP.NET API

- [API host](https://github.com/sadeshraj/v-sense/blob/main/backend/VSense.API/Program.cs): `backend/VSense.API/Program.cs`
- [Business controllers](https://github.com/sadeshraj/v-sense/tree/main/backend/VSense.API/Controllers): `backend/VSense.API/Controllers`
- [Workflow controller](https://github.com/sadeshraj/v-sense/blob/main/backend/VSense.API/Controllers/WorkflowsController.cs): `backend/VSense.API/Controllers/WorkflowsController.cs`
- [Support controller](https://github.com/sadeshraj/v-sense/blob/main/backend/VSense.API/Controllers/SupportController.cs): `backend/VSense.API/Controllers/SupportController.cs`
- [Notifications](https://github.com/sadeshraj/v-sense/blob/main/backend/VSense.Infrastructure/Services/NotificationService.cs): `backend/VSense.Infrastructure/Services/NotificationService.cs`
- [Email delivery](https://github.com/sadeshraj/v-sense/blob/main/backend/VSense.Infrastructure/Services/EmailService.cs): `backend/VSense.Infrastructure/Services/EmailService.cs`

### AI workflows

- [AI workflow API](https://github.com/sadeshraj/v-sense/blob/main/agentic-ai/api/main.py): `agentic-ai/api/main.py`
- [Workflow coordinator](https://github.com/sadeshraj/v-sense/blob/main/agentic-ai/agents/coordinator.py): `agentic-ai/agents/coordinator.py`
- [History analysis](https://github.com/sadeshraj/v-sense/blob/main/agentic-ai/agents/history_analysis.py): `agentic-ai/agents/history_analysis.py`
- [Fraud detection](https://github.com/sadeshraj/v-sense/blob/main/agentic-ai/agents/fraud_detection.py): `agentic-ai/agents/fraud_detection.py`
- [Valuation validation](https://github.com/sadeshraj/v-sense/blob/main/agentic-ai/agents/valuation_validation.py): `agentic-ai/agents/valuation_validation.py`
- [Workflow state](https://github.com/sadeshraj/v-sense/blob/main/agentic-ai/state/schema.py): `agentic-ai/state/schema.py`
- [AI persistence](https://github.com/sadeshraj/v-sense/blob/main/agentic-ai/state/persistence.py): `agentic-ai/state/persistence.py`

### Domain and persistence

- [Domain records](https://github.com/sadeshraj/v-sense/tree/main/backend/VSense.Domain/Entities): `backend/VSense.Domain/Entities`
- [Database context](https://github.com/sadeshraj/v-sense/blob/main/backend/VSense.Infrastructure/Persistence/ApplicationDbContext.cs): `backend/VSense.Infrastructure/Persistence/ApplicationDbContext.cs`

### Mobile app

- [Customer and inspector app](https://github.com/sadeshraj/v-sense/tree/main/mobile): `mobile`

### Other components

- **Customer**
- **Garage staff**
- **Administrator**

## Connections

- Customer → Web routing: uses
- Garage staff → Web routing: uses
- Administrator → Web routing: uses
- Web routing → Garage dashboard: routes to (evidence: `frontend-web/src/App.jsx`)
- Web routing → Admin review: routes to (evidence: `frontend-web/src/App.jsx`)
- Web routing → Admin support: routes to (evidence: `frontend-web/src/App.jsx`)
- Garage dashboard → Web authentication: logs out via (evidence: `frontend-web/src/pages/GarageDashboard.jsx`)
- API host → Database context: configures (evidence: `backend/VSense.API/Program.cs`)
- API host → Business controllers: maps (evidence: `backend/VSense.API/Program.cs`)
- Workflow controller → Database context: queries and updates (evidence: `backend/VSense.API/Controllers/WorkflowsController.cs`)
- Workflow controller → AI workflow API: dispatches workflow
- Support controller → Database context: stores support data (evidence: `backend/VSense.API/Controllers/SupportController.cs`)
- Support controller → Domain records: uses support records (evidence: `backend/VSense.API/Controllers/SupportController.cs`)
- Notifications → Database context: reads and writes (evidence: `backend/VSense.Infrastructure/Services/NotificationService.cs`)
- Notifications → Domain records: uses notification records (evidence: `backend/VSense.Infrastructure/Services/NotificationService.cs`)
- AI workflow API → Workflow state: initializes (evidence: `agentic-ai/api/main.py`)
- AI workflow API → Workflow coordinator: dispatches (evidence: `agentic-ai/api/main.py`)
- AI workflow API → History analysis: dispatches (evidence: `agentic-ai/api/main.py`)
- AI workflow API → Fraud detection: dispatches (evidence: `agentic-ai/api/main.py`)
- AI workflow API → Valuation validation: dispatches (evidence: `agentic-ai/api/main.py`)
- Customer → Customer and inspector app: uses
- Garage staff → Customer and inspector app: inspects with
