# vaibhavoza1997/aria architecture

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

- Interactive diagram: https://gitdiagram.com/vaibhavoza1997/aria
- Repository: https://github.com/vaibhavoza1997/aria

## Overview

ARIA is a browser-based SRE incident analysis tool. An operator enters incident details or loads a sample, submits them to the FastAPI backend, and receives a structured root cause analysis, contributing factors, urgency, and remediation steps. The backend validates the request, builds an analysis prompt, calls Gemini, and returns a typed result for display. The README also documents sample-incident loading and a health endpoint. Phase 2 postmortem generation is planned, not implemented; the graph reflects the sampled runtime code and documented capabilities.

Main entry points: [`backend/app/routes/incidents.py`](https://github.com/vaibhavoza1997/aria/blob/main/backend/app/routes/incidents.py) (Incident Routes), [`backend/app/services/incident_service.py`](https://github.com/vaibhavoza1997/aria/blob/main/backend/app/services/incident_service.py) (Analysis Orchestrator), [`frontend/js/app.js`](https://github.com/vaibhavoza1997/aria/blob/main/frontend/js/app.js) (UI Logic), [`backend/app/services/gemini_service.py`](https://github.com/vaibhavoza1997/aria/blob/main/backend/app/services/gemini_service.py) (Gemini Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Incident UI"]
  node_ui["Incident Form<br/>[index.html]"]
  node_browser["UI Logic<br/>[app.js]"]
end

subgraph group_api["HTTP API"]
  node_app["API App<br/>[main.py]"]
  node_routes["Incident Routes<br/>[incidents.py]"]
  node_contracts["Incident Models<br/>[incident.py]"]
  node_samples["Sample Incidents"]
end

subgraph group_analysis["Analysis Pipeline"]
  node_service["Analysis Orchestrator"]
  node_prompts["Prompt Builder"]
end

subgraph group_integration["AI Integration"]
  node_gemini["Gemini Client<br/>[gemini_service.py]"]
  node_config["AI Configuration<br/>[config.py]"]
end

node_operator(("SRE Operator"))
node_gemini_api(("Gemini API"))

node_operator -->|"enters incident"| node_ui
node_ui -->|"interacts with"| node_browser
node_browser -->|"requests API"| node_app
node_app -->|"mounts routes"| node_routes
node_routes -->|"reads samples"| node_samples
node_routes -->|"validates input"| node_contracts
node_routes -->|"dispatches analysis"| node_service
node_service -->|"builds prompt"| node_prompts
node_service -->|"sends prompt"| node_gemini
node_gemini -->|"reads settings"| node_config
node_gemini -->|"generates response"| node_gemini_api
node_service -->|"builds result"| node_contracts
node_routes -->|"returns API data"| node_browser
node_browser -->|"renders analysis"| node_ui

click node_ui "https://github.com/vaibhavoza1997/aria/blob/main/frontend/index.html"
click node_browser "https://github.com/vaibhavoza1997/aria/blob/main/frontend/js/app.js"
click node_app "https://github.com/vaibhavoza1997/aria/blob/main/backend/app/main.py"
click node_routes "https://github.com/vaibhavoza1997/aria/blob/main/backend/app/routes/incidents.py"
click node_contracts "https://github.com/vaibhavoza1997/aria/blob/main/backend/app/models/incident.py"
click node_samples "https://github.com/vaibhavoza1997/aria/blob/main/backend/mock_data/sample_incidents.json"
click node_service "https://github.com/vaibhavoza1997/aria/blob/main/backend/app/services/incident_service.py"
click node_prompts "https://github.com/vaibhavoza1997/aria/blob/main/backend/app/prompts/incident_prompts.py"
click node_gemini "https://github.com/vaibhavoza1997/aria/blob/main/backend/app/services/gemini_service.py"
click node_config "https://github.com/vaibhavoza1997/aria/blob/main/backend/app/config.py"

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_ui,node_browser toneBlue
class node_app,node_routes,node_contracts,node_samples toneAmber
class node_service,node_prompts,node_gemini_api toneMint
class node_gemini,node_config toneRose
class node_operator toneIndigo
```

## Components

### Incident UI

- [Incident Form](https://github.com/vaibhavoza1997/aria/blob/main/frontend/index.html): `frontend/index.html`
- [UI Logic](https://github.com/vaibhavoza1997/aria/blob/main/frontend/js/app.js): `frontend/js/app.js`

### HTTP API

- [API App](https://github.com/vaibhavoza1997/aria/blob/main/backend/app/main.py): `backend/app/main.py`
- [Incident Routes](https://github.com/vaibhavoza1997/aria/blob/main/backend/app/routes/incidents.py): `backend/app/routes/incidents.py`
- [Incident Models](https://github.com/vaibhavoza1997/aria/blob/main/backend/app/models/incident.py): `backend/app/models/incident.py`
- [Sample Incidents](https://github.com/vaibhavoza1997/aria/blob/main/backend/mock_data/sample_incidents.json): `backend/mock_data/sample_incidents.json`

### Analysis Pipeline

- [Analysis Orchestrator](https://github.com/vaibhavoza1997/aria/blob/main/backend/app/services/incident_service.py): `backend/app/services/incident_service.py`
- [Prompt Builder](https://github.com/vaibhavoza1997/aria/blob/main/backend/app/prompts/incident_prompts.py): `backend/app/prompts/incident_prompts.py`

### AI Integration

- [Gemini Client](https://github.com/vaibhavoza1997/aria/blob/main/backend/app/services/gemini_service.py): `backend/app/services/gemini_service.py`
- [AI Configuration](https://github.com/vaibhavoza1997/aria/blob/main/backend/app/config.py): `backend/app/config.py`

### Other components

- **SRE Operator**
- **Gemini API**

## Connections

- SRE Operator → Incident Form: enters incident
- Incident Form → UI Logic: interacts with
- UI Logic → API App: requests API
- API App → Incident Routes: mounts routes
- Incident Routes → Sample Incidents: reads samples
- Incident Routes → Incident Models: validates input
- Incident Routes → Analysis Orchestrator: dispatches analysis
- Analysis Orchestrator → Prompt Builder: builds prompt
- Analysis Orchestrator → Gemini Client: sends prompt
- Gemini Client → AI Configuration: reads settings
- Gemini Client → Gemini API: generates response
- Analysis Orchestrator → Incident Models: builds result
- Incident Routes → UI Logic: returns API data
- UI Logic → Incident Form: renders analysis
