# vamshikrishna-117/incidentiq architecture

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

- Interactive diagram: https://gitdiagram.com/vamshikrishna-117/incidentiq
- Repository: https://github.com/vamshikrishna-117/incidentiq

## Overview

IncidentIQ is a real-time incident command center for SRE and DevOps teams. Operators browse and triage incidents, create or update records, and inspect a live incident timeline; they can then request AI analysis and follow recommended actions. Supabase provides persistence, authentication, realtime updates, and attachment storage, while configurable AI providers supply analysis with a rule-based fallback. The graph includes documented analytics, infrastructure health, settings, and demo/auth capabilities. Some page implementations were not sampled, so those branches are shown only at the level supported by the README and tree.

Main entry points: [`src/hooks/use-incidents.ts`](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/hooks/use-incidents.ts) (Incident queries and mutations), [`src/lib/ai.ts`](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/lib/ai.ts) (AI analysis engine), [`src/app/dashboard/page.tsx`](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/dashboard/page.tsx) (Incident management), [`src/app/api/incidents/route.ts`](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/api/incidents/route.ts) (Incident API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Operator experience"]
  node_dashboard["Dashboard and triage<br/>[page.tsx]"]
  node_incident_list["Incident management<br/>[page.tsx]"]
  node_analytics["Incident analytics<br/>[page.tsx]"]
  node_infrastructure["Service health<br/>[page.tsx]"]
  node_settings["Configuration<br/>[page.tsx]"]
end

subgraph group_incident["Incident workflow"]
  node_incident_detail["Incident timeline<br/>[page.tsx]"]
  node_update_composer["Timeline updates"]
  node_incident_hooks["Incident queries and mutations<br/>[use-incidents.ts]"]
  node_incident_api["Incident API<br/>[route.ts]"]
  node_incident_detail_api["Incident update API<br/>[route.ts]"]
end

subgraph group_services["Analysis and operations"]
  node_ai_api["AI analysis endpoint<br/>[route.ts]"]
  node_ai_engine["AI analysis engine<br/>[ai.ts]"]
  node_ai_fallback["Rule-based fallback<br/>[ai-fallback.ts]"]
  node_upload_api["Attachment upload<br/>[route.ts]"]
  node_realtime["Realtime subscriptions"]
end

subgraph group_platform["Data and identity"]
  node_authentication["Authentication<br/>[page.tsx]"]
  node_auth_store["Auth state<br/>[auth-store.ts]"]
  node_supabase_client["Browser client<br/>[client.ts]"]
  node_supabase_server["Server client<br/>[server.ts]"]
  node_database[("Supabase database")]
  node_storage[("Supabase Storage")]
end

node_operator(("SRE operator"))
node_groq["Groq provider"]
node_gemini["Gemini provider"]

node_operator -->|"opens"| node_dashboard
node_operator -->|"triages"| node_incident_list
node_operator -->|"reviews"| node_incident_detail
node_operator -->|"reviews trends"| node_analytics
node_operator -->|"checks health"| node_infrastructure
node_operator -->|"configures"| node_settings
node_operator -->|"signs in"| node_authentication
node_authentication -->|"sets identity"| node_auth_store
node_incident_list -->|"queries and updates"| node_incident_hooks
node_dashboard -->|"loads incidents"| node_incident_hooks
node_incident_detail -.->|"loads timeline"| node_incident_hooks
node_update_composer -->|"posts updates"| node_incident_hooks
node_incident_hooks -->|"reads and writes"| node_supabase_client
node_incident_hooks -->|"queries records"| node_database
node_incident_list -->|"creates incidents"| node_incident_api
node_incident_api -->|"creates client"| node_supabase_server
node_incident_api -->|"reads and inserts"| node_database
node_incident_detail_api -->|"stores updates"| node_database
node_operator -->|"requests analysis"| node_ai_api
node_ai_api -->|"generates analysis"| node_ai_engine
node_ai_engine -->|"calls provider"| node_groq
node_ai_engine -->|"calls provider"| node_gemini
node_ai_engine -->|"falls back to"| node_ai_fallback
node_ai_api -->|"stores results"| node_database
node_operator -->|"uploads files"| node_upload_api
node_upload_api -->|"streams attachments"| node_storage
node_realtime -->|"subscribes through"| node_supabase_client
node_realtime -->|"receives broadcasts"| node_database
node_analytics -->|"queries metrics"| node_supabase_client
node_infrastructure -.->|"reads service health"| node_database
node_settings -.->|"reads configuration"| node_database

click node_dashboard "https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/page.tsx"
click node_incident_list "https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/dashboard/page.tsx"
click node_analytics "https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/analytics/page.tsx"
click node_infrastructure "https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/infrastructure/page.tsx"
click node_settings "https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/settings/page.tsx"
click node_authentication "https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/(auth)/login/page.tsx"
click node_auth_store "https://github.com/vamshikrishna-117/incidentiq/blob/main/src/stores/auth-store.ts"
click node_incident_detail "https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/incidents/%5Bid%5D/page.tsx"
click node_update_composer "https://github.com/vamshikrishna-117/incidentiq/blob/main/src/components/incident-detail/update-composer.tsx"
click node_incident_hooks "https://github.com/vamshikrishna-117/incidentiq/blob/main/src/hooks/use-incidents.ts"
click node_incident_api "https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/api/incidents/route.ts"
click node_incident_detail_api "https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/api/incidents/%5Bid%5D/updates/route.ts"
click node_ai_api "https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/api/incidents/%5Bid%5D/ai/route.ts"
click node_ai_engine "https://github.com/vamshikrishna-117/incidentiq/blob/main/src/lib/ai.ts"
click node_ai_fallback "https://github.com/vamshikrishna-117/incidentiq/blob/main/src/lib/ai-fallback.ts"
click node_upload_api "https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/api/upload/route.ts"
click node_realtime "https://github.com/vamshikrishna-117/incidentiq/blob/main/src/hooks/use-supabase-realtime.ts"
click node_supabase_client "https://github.com/vamshikrishna-117/incidentiq/blob/main/src/lib/supabase/client.ts"
click node_supabase_server "https://github.com/vamshikrishna-117/incidentiq/blob/main/src/lib/supabase/server.ts"

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_dashboard,node_incident_list,node_analytics,node_infrastructure,node_settings toneBlue
class node_incident_detail,node_update_composer,node_incident_hooks,node_incident_api,node_incident_detail_api toneAmber
class node_ai_api,node_ai_engine,node_ai_fallback,node_upload_api,node_realtime toneMint
class node_authentication,node_auth_store,node_supabase_client,node_supabase_server,node_database,node_storage toneRose
class node_operator,node_groq,node_gemini toneIndigo
```

## Components

### Operator experience

- [Dashboard and triage](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Incident management](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`
- [Incident analytics](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/analytics/page.tsx): `src/app/analytics/page.tsx`
- [Service health](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/infrastructure/page.tsx): `src/app/infrastructure/page.tsx`
- [Configuration](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/settings/page.tsx): `src/app/settings/page.tsx`

### Incident workflow

- [Incident timeline](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/incidents/%5Bid%5D/page.tsx): `src/app/incidents/[id]/page.tsx`
- [Timeline updates](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/components/incident-detail/update-composer.tsx): `src/components/incident-detail/update-composer.tsx`
- [Incident queries and mutations](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/hooks/use-incidents.ts): `src/hooks/use-incidents.ts`
- [Incident API](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/api/incidents/route.ts): `src/app/api/incidents/route.ts`
- [Incident update API](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/api/incidents/%5Bid%5D/updates/route.ts): `src/app/api/incidents/[id]/updates/route.ts`

### Analysis and operations

- [AI analysis endpoint](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/api/incidents/%5Bid%5D/ai/route.ts): `src/app/api/incidents/[id]/ai/route.ts`
- [AI analysis engine](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/lib/ai.ts): `src/lib/ai.ts`
- [Rule-based fallback](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/lib/ai-fallback.ts): `src/lib/ai-fallback.ts`
- [Attachment upload](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/api/upload/route.ts): `src/app/api/upload/route.ts`
- [Realtime subscriptions](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/hooks/use-supabase-realtime.ts): `src/hooks/use-supabase-realtime.ts`

### Data and identity

- [Authentication](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/app/(auth)/login/page.tsx): `src/app/(auth)/login/page.tsx`
- [Auth state](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/stores/auth-store.ts): `src/stores/auth-store.ts`
- [Browser client](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/lib/supabase/client.ts): `src/lib/supabase/client.ts`
- [Server client](https://github.com/vamshikrishna-117/incidentiq/blob/main/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`
- **Supabase database**
- **Supabase Storage**

### Other components

- **SRE operator**
- **Groq provider**
- **Gemini provider**

## Connections

- SRE operator → Dashboard and triage: opens (evidence: `README.md`)
- SRE operator → Incident management: triages (evidence: `README.md`)
- SRE operator → Incident timeline: reviews (evidence: `README.md`)
- SRE operator → Incident analytics: reviews trends (evidence: `README.md`)
- SRE operator → Service health: checks health (evidence: `README.md`)
- SRE operator → Configuration: configures (evidence: `README.md`)
- SRE operator → Authentication: signs in (evidence: `README.md`)
- Authentication → Auth state: sets identity
- Incident management → Incident queries and mutations: queries and updates (evidence: `src/app/dashboard/page.tsx`)
- Dashboard and triage → Incident queries and mutations: loads incidents (evidence: `src/app/page.tsx`)
- Incident timeline → Incident queries and mutations: loads timeline
- Timeline updates → Incident queries and mutations: posts updates (evidence: `src/components/incident-detail/update-composer.tsx`)
- Incident queries and mutations → Browser client: reads and writes (evidence: `src/hooks/use-incidents.ts`)
- Incident queries and mutations → Supabase database: queries records (evidence: `README.md`)
- Incident management → Incident API: creates incidents (evidence: `README.md`)
- Incident API → Server client: creates client (evidence: `src/app/api/incidents/route.ts`)
- Incident API → Supabase database: reads and inserts (evidence: `src/app/api/incidents/route.ts`)
- Incident update API → Supabase database: stores updates (evidence: `README.md`)
- SRE operator → AI analysis endpoint: requests analysis (evidence: `README.md`)
- AI analysis endpoint → AI analysis engine: generates analysis (evidence: `src/app/api/incidents/[id]/ai/route.ts`)
- AI analysis engine → Groq provider: calls provider (evidence: `src/lib/ai.ts`)
- AI analysis engine → Gemini provider: calls provider (evidence: `src/lib/ai.ts`)
- AI analysis engine → Rule-based fallback: falls back to (evidence: `src/lib/ai.ts`)
- AI analysis endpoint → Supabase database: stores results (evidence: `README.md`)
- SRE operator → Attachment upload: uploads files (evidence: `README.md`)
- Attachment upload → Supabase Storage: streams attachments (evidence: `README.md`)
- Realtime subscriptions → Browser client: subscribes through (evidence: `src/hooks/use-supabase-realtime.ts`)
- Realtime subscriptions → Supabase database: receives broadcasts (evidence: `README.md`)
- Incident analytics → Browser client: queries metrics (evidence: `src/app/analytics/page.tsx`)
- Service health → Supabase database: reads service health
- Configuration → Supabase database: reads configuration
