# rajputvikashs5/rca_hackthon architecture

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

- Interactive diagram: https://gitdiagram.com/rajputvikashs5/rca_hackthon
- Repository: https://github.com/rajputvikashs5/rca_hackthon

## Overview

This is an incident root-cause analysis assistant: support staff submit an incident, the API retrieves similar historical incidents, and Gemini produces an evidence-grounded RCA for the interface. Separately, operators ingest public Jira data through transformation, embedding, and PostgreSQL storage; R2 can supply dataset files, while Zenodo metadata and archive inspection are separate management capabilities. The graph preserves frontend history, statistics, settings, and dataset-management branches. Some runtime modules were not sampled, so their documented links are cited to the README; unverified implementation links are omitted.

Main entry points: [`ingestion/pipeline.py`](https://github.com/rajputvikashs5/rca_hackthon/blob/main/ingestion/pipeline.py) (Ingestion coordinator), [`backend/app/api/chat.py`](https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/api/chat.py) (Incident analysis API), [`backend/app/main.py`](https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/main.py) (FastAPI application), [`frontend/src/app/router.tsx`](https://github.com/rajputvikashs5/rca_hackthon/blob/main/frontend/src/app/router.tsx) (Web application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Analyst interface"]
  node_webapp["Web application<br/>[router.tsx]"]
  node_activity["Incident activity"]
  node_pages["RCA and history pages<br/>[Pages.tsx]"]
  node_analytics["Statistics dashboard<br/>[analytics.ts]"]
  node_settings["User settings<br/>[settingsService.ts]"]
end

subgraph group_api["API and RCA"]
  node_api_main["FastAPI application<br/>[main.py]"]
  node_chat_api["Incident analysis API<br/>[chat.py]"]
  node_history_api["Analysis history API"]
  node_schemas["API data schemas<br/>[schemas.py]"]
end

subgraph group_knowledge["Incident knowledge base"]
  node_embedding["Embedding model<br/>[embedding.py]"]
  node_retrieval["Incident retrieval"]
  node_llm["RCA synthesis<br/>[llm.py]"]
  node_repository["Incident repository<br/>[repository.py]"]
  node_database[("PostgreSQL and pgvector<br/>[connection.py]")]
  node_analysis_store["Analysis history store"]
end

subgraph group_ingestion["Offline ingestion"]
  node_pipeline["Ingestion coordinator<br/>[pipeline.py]"]
  node_reader["Jira archive reader<br/>[jira_reader.py]"]
  node_transformer["Incident transformation"]
  node_batch_embed["Batch embeddings"]
end

subgraph group_management["Dataset management"]
  node_r2_storage["R2 storage access<br/>[r2_storage.py]"]
  node_dataset_service["Dataset status service<br/>[dataset_service.py]"]
  node_dataset_api["Dataset API<br/>[dataset.py]"]
  node_zenodo_api["Zenodo API<br/>[zenodo.py]"]
  node_zenodo_service["Zenodo metadata service<br/>[zenodo_service.py]"]
  node_zenodo_client["Zenodo client<br/>[zenodo_client.py]"]
end

node_analyst(("Support analyst"))
node_operator(("Ingestion operator"))
node_zenodo[("Public Jira dataset")]
node_r2[("Cloudflare R2")]

node_analyst -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_activity
node_webapp -->|"routes to"| node_pages
node_analyst -.->|"submits incident"| node_pages
node_pages -.->|"requests analysis"| node_chat_api
node_chat_api -.->|"gets evidence"| node_retrieval
node_retrieval -->|"embeds query"| node_embedding
node_retrieval -->|"searches incidents"| node_repository
node_repository -->|"queries vectors"| node_database
node_chat_api -.->|"synthesizes RCA"| node_llm
node_chat_api -.->|"records analysis"| node_history_api
node_history_api -->|"reads and writes"| node_analysis_store
node_analysis_store -->|"uses connection"| node_database
node_api_main -->|"registers routes"| node_chat_api
node_api_main -->|"registers routes"| node_history_api
node_api_main -->|"registers routes"| node_dataset_api
node_api_main -->|"registers routes"| node_zenodo_api
node_analyst -.->|"views metrics"| node_analytics
node_analyst -.->|"configures"| node_settings
node_operator -->|"runs ingestion"| node_pipeline
node_zenodo -.->|"provides archive"| node_reader
node_pipeline -->|"reads batches"| node_reader
node_pipeline -->|"transforms issues"| node_transformer
node_pipeline -->|"embeds batches"| node_batch_embed
node_batch_embed -->|"uses model"| node_embedding
node_pipeline -->|"upserts incidents"| node_repository
node_pipeline -->|"reads R2 batches"| node_r2_storage
node_r2_storage -->|"reads objects"| node_r2
node_dataset_api -->|"serves status"| node_dataset_service
node_dataset_service -->|"checks storage"| node_r2_storage
node_zenodo_api -->|"serves metadata"| node_zenodo_service
node_zenodo_api -->|"uses client"| node_zenodo_client
node_zenodo_client -->|"requests metadata"| node_zenodo

click node_webapp "https://github.com/rajputvikashs5/rca_hackthon/blob/main/frontend/src/app/router.tsx"
click node_activity "https://github.com/rajputvikashs5/rca_hackthon/blob/main/frontend/src/pages/IncidentActivityPage.tsx"
click node_pages "https://github.com/rajputvikashs5/rca_hackthon/blob/main/frontend/src/pages/Pages.tsx"
click node_analytics "https://github.com/rajputvikashs5/rca_hackthon/blob/main/frontend/src/types/analytics.ts"
click node_settings "https://github.com/rajputvikashs5/rca_hackthon/blob/main/frontend/src/services/settingsService.ts"
click node_api_main "https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/main.py"
click node_chat_api "https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/api/chat.py"
click node_history_api "https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/api/analysis_history.py"
click node_schemas "https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/models/schemas.py"
click node_embedding "https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/services/embedding.py"
click node_retrieval "https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/services/database_retriever.py"
click node_llm "https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/services/llm.py"
click node_repository "https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/database/repository.py"
click node_database "https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/database/connection.py"
click node_analysis_store "https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/database/analysis_repository.py"
click node_pipeline "https://github.com/rajputvikashs5/rca_hackthon/blob/main/ingestion/pipeline.py"
click node_reader "https://github.com/rajputvikashs5/rca_hackthon/blob/main/ingestion/jira_reader.py"
click node_transformer "https://github.com/rajputvikashs5/rca_hackthon/blob/main/ingestion/jira_transformer.py"
click node_batch_embed "https://github.com/rajputvikashs5/rca_hackthon/blob/main/ingestion/embedding_pipeline.py"
click node_r2_storage "https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/services/r2_storage.py"
click node_dataset_service "https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/services/dataset_service.py"
click node_dataset_api "https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/api/dataset.py"
click node_zenodo_api "https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/api/zenodo.py"
click node_zenodo_service "https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/services/zenodo_service.py"
click node_zenodo_client "https://github.com/rajputvikashs5/rca_hackthon/blob/main/ingestion/zenodo_client.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_webapp,node_activity,node_pages,node_analytics,node_settings toneBlue
class node_api_main,node_chat_api,node_history_api,node_schemas,node_zenodo,node_r2 toneAmber
class node_embedding,node_retrieval,node_llm,node_repository,node_database,node_analysis_store toneMint
class node_pipeline,node_reader,node_transformer,node_batch_embed toneRose
class node_r2_storage,node_dataset_service,node_dataset_api,node_zenodo_api,node_zenodo_service,node_zenodo_client,node_analyst,node_operator toneIndigo
```

## Components

### Analyst interface

- [Web application](https://github.com/rajputvikashs5/rca_hackthon/blob/main/frontend/src/app/router.tsx): `frontend/src/app/router.tsx`
- [Incident activity](https://github.com/rajputvikashs5/rca_hackthon/blob/main/frontend/src/pages/IncidentActivityPage.tsx): `frontend/src/pages/IncidentActivityPage.tsx`
- [RCA and history pages](https://github.com/rajputvikashs5/rca_hackthon/blob/main/frontend/src/pages/Pages.tsx): `frontend/src/pages/Pages.tsx`
- [Statistics dashboard](https://github.com/rajputvikashs5/rca_hackthon/blob/main/frontend/src/types/analytics.ts): `frontend/src/types/analytics.ts`
- [User settings](https://github.com/rajputvikashs5/rca_hackthon/blob/main/frontend/src/services/settingsService.ts): `frontend/src/services/settingsService.ts`

### API and RCA

- [FastAPI application](https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/main.py): `backend/app/main.py`
- [Incident analysis API](https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/api/chat.py): `backend/app/api/chat.py`
- [Analysis history API](https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/api/analysis_history.py): `backend/app/api/analysis_history.py`
- [API data schemas](https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/models/schemas.py): `backend/app/models/schemas.py`

### Incident knowledge base

- [Embedding model](https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/services/embedding.py): `backend/app/services/embedding.py`
- [Incident retrieval](https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/services/database_retriever.py): `backend/app/services/database_retriever.py`
- [RCA synthesis](https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/services/llm.py): `backend/app/services/llm.py`
- [Incident repository](https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/database/repository.py): `backend/app/database/repository.py`
- [PostgreSQL and pgvector](https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/database/connection.py): `backend/app/database/connection.py`
- [Analysis history store](https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/database/analysis_repository.py): `backend/app/database/analysis_repository.py`

### Offline ingestion

- [Ingestion coordinator](https://github.com/rajputvikashs5/rca_hackthon/blob/main/ingestion/pipeline.py): `ingestion/pipeline.py`
- [Jira archive reader](https://github.com/rajputvikashs5/rca_hackthon/blob/main/ingestion/jira_reader.py): `ingestion/jira_reader.py`
- [Incident transformation](https://github.com/rajputvikashs5/rca_hackthon/blob/main/ingestion/jira_transformer.py): `ingestion/jira_transformer.py`
- [Batch embeddings](https://github.com/rajputvikashs5/rca_hackthon/blob/main/ingestion/embedding_pipeline.py): `ingestion/embedding_pipeline.py`

### Dataset management

- [R2 storage access](https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/services/r2_storage.py): `backend/app/services/r2_storage.py`
- [Dataset status service](https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/services/dataset_service.py): `backend/app/services/dataset_service.py`
- [Dataset API](https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/api/dataset.py): `backend/app/api/dataset.py`
- [Zenodo API](https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/api/zenodo.py): `backend/app/api/zenodo.py`
- [Zenodo metadata service](https://github.com/rajputvikashs5/rca_hackthon/blob/main/backend/app/services/zenodo_service.py): `backend/app/services/zenodo_service.py`
- [Zenodo client](https://github.com/rajputvikashs5/rca_hackthon/blob/main/ingestion/zenodo_client.py): `ingestion/zenodo_client.py`

### Other components

- **Support analyst**
- **Ingestion operator**
- **Public Jira dataset**
- **Cloudflare R2**

## Connections

- Support analyst → Web application: uses (evidence: `README.md`)
- Web application → Incident activity: routes to (evidence: `frontend/src/app/router.tsx`)
- Web application → RCA and history pages: routes to (evidence: `frontend/src/app/router.tsx`)
- Support analyst → RCA and history pages: submits incident
- RCA and history pages → Incident analysis API: requests analysis (evidence: `README.md`)
- Incident analysis API → Incident retrieval: gets evidence (evidence: `README.md`)
- Incident retrieval → Embedding model: embeds query (evidence: `backend/app/services/database_retriever.py`)
- Incident retrieval → Incident repository: searches incidents (evidence: `backend/app/services/database_retriever.py`)
- Incident repository → PostgreSQL and pgvector: queries vectors (evidence: `backend/app/database/repository.py`)
- Incident analysis API → RCA synthesis: synthesizes RCA (evidence: `README.md`)
- Incident analysis API → Analysis history API: records analysis
- Analysis history API → Analysis history store: reads and writes (evidence: `backend/app/api/analysis_history.py`)
- Analysis history store → PostgreSQL and pgvector: uses connection (evidence: `backend/app/database/analysis_repository.py`)
- FastAPI application → Incident analysis API: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Analysis history API: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Dataset API: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Zenodo API: registers routes (evidence: `backend/app/main.py`)
- Support analyst → Statistics dashboard: views metrics (evidence: `README.md`)
- Support analyst → User settings: configures
- Ingestion operator → Ingestion coordinator: runs ingestion (evidence: `README.md`)
- Public Jira dataset → Jira archive reader: provides archive (evidence: `README.md`)
- Ingestion coordinator → Jira archive reader: reads batches (evidence: `ingestion/pipeline.py`)
- Ingestion coordinator → Incident transformation: transforms issues (evidence: `ingestion/pipeline.py`)
- Ingestion coordinator → Batch embeddings: embeds batches (evidence: `ingestion/pipeline.py`)
- Batch embeddings → Embedding model: uses model (evidence: `ingestion/embedding_pipeline.py`)
- Ingestion coordinator → Incident repository: upserts incidents (evidence: `ingestion/pipeline.py`)
- Ingestion coordinator → R2 storage access: reads R2 batches (evidence: `ingestion/pipeline.py`)
- R2 storage access → Cloudflare R2: reads objects (evidence: `backend/app/services/r2_storage.py`)
- Dataset API → Dataset status service: serves status
- Dataset status service → R2 storage access: checks storage (evidence: `backend/app/services/dataset_service.py`)
- Zenodo API → Zenodo metadata service: serves metadata (evidence: `backend/app/api/zenodo.py`)
- Zenodo API → Zenodo client: uses client (evidence: `backend/app/api/zenodo.py`)
- Zenodo client → Public Jira dataset: requests metadata (evidence: `ingestion/zenodo_client.py`)
