# kartevsumit/eyhacks architecture

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

- Interactive diagram: https://gitdiagram.com/kartevsumit/eyhacks
- Repository: https://github.com/kartevsumit/eyhacks

## Overview

This is an agent-facing insurance-claims application with a React dashboard, an Express API, and a separate retrieval chatbot. The main workflow authenticates an agent, loads assigned claims, and supports claim lookup; the dashboard also sends questions to the chatbot service. Claim creation, assignment, and document uploads are distinct backend stages. The Python ingestion code builds a Pinecone-backed document index. Several backend routes and Python modules are listed but not excerpted, so their undocumented connections are omitted.

Main entry points: [`backend/src/index.js`](https://github.com/kartevsumit/eyhacks/blob/main/backend/src/index.js) (API server), [`src/App.jsx`](https://github.com/kartevsumit/eyhacks/blob/main/src/App.jsx) (App routing), [`src/pages/AgentDash.jsx`](https://github.com/kartevsumit/eyhacks/blob/main/src/pages/AgentDash.jsx) (Agent dashboard), [`src/components/ChatContainer.jsx`](https://github.com/kartevsumit/eyhacks/blob/main/src/components/ChatContainer.jsx) (Chat interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Agent interface"]
  node_app["App routing<br/>[App.jsx]"]
  node_auth_ui["Agent auth state<br/>[useAuthStore.js]"]
  node_dashboard["Agent dashboard<br/>[AgentDash.jsx]"]
  node_claim_state["Claim state<br/>[useStore.js]"]
  node_claim_suggestion["Claim suggestions"]
  node_chat_ui["Chat interface<br/>[ChatContainer.jsx]"]
  node_chat_input["Chat input<br/>[ChatInput.jsx]"]
  node_http_client["HTTP client<br/>[axios.js]"]
end

subgraph group_api["Claims API"]
  node_api_server["API server<br/>[index.js]"]
  node_auth_routes["Agent auth routes"]
  node_agent_controller["Agent auth logic"]
  node_auth_middleware["Auth middleware<br/>[auth.middleware.js]"]
  node_claim_routes["Claim operations<br/>[claimRoutes.js]"]
  node_document_routes["Document uploads<br/>[documentRoutes.js]"]
end

subgraph group_assistant["AI assistant"]
  node_chat_api["Chat service<br/>[app.py]"]
  node_chat_logic["Chat processing<br/>[chat.py]"]
  node_ingestion["Document ingestion<br/>[ingest.py]"]
  node_llm_module["LLM integration<br/>[LLM.py]"]
  node_call_module["Call processing<br/>[VACT.py]"]
  node_summary_module["Call summaries<br/>[Call_summary.py]"]
end

subgraph group_data["Persistence and integrations"]
  node_agent_model[("Agent records<br/>[agent.model.js]")]
  node_claim_model[("Claim records<br/>[claim.model.js]")]
  node_db_connection["Database connection<br/>[db.js]"]
  node_vector_index[("Pinecone index")]
end

node_agent(("Claims agent"))
node_chat_service(("Chat endpoint"))

node_agent -->|"uses"| node_app
node_app -->|"checks auth"| node_auth_ui
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_claim_suggestion
node_agent -->|"signs in"| node_auth_ui
node_auth_ui -->|"sends requests"| node_http_client
node_dashboard -->|"loads claims"| node_claim_state
node_claim_state -->|"requests claims"| node_http_client
node_claim_suggestion -->|"uses"| node_claim_state
node_dashboard -->|"renders"| node_chat_ui
node_chat_ui -->|"renders"| node_chat_input
node_agent -->|"asks question"| node_chat_input
node_chat_ui -->|"posts question"| node_chat_service
node_http_client -->|"calls API"| node_api_server
node_api_server -->|"registers"| node_auth_routes
node_api_server -->|"registers"| node_claim_routes
node_api_server -->|"registers"| node_document_routes
node_auth_routes -->|"routes requests"| node_agent_controller
node_auth_routes -->|"protects check"| node_auth_middleware
node_agent_controller -->|"reads and writes"| node_agent_model
node_agent_controller -->|"issues tokens"| node_agent_model
node_claim_routes -->|"reads and writes"| node_claim_model
node_claim_routes -->|"assigns agents"| node_agent_model
node_document_routes -->|"stores file path"| node_claim_model
node_api_server -->|"imports"| node_db_connection
node_chat_service -.->|"serves requests"| node_chat_api
node_chat_api -.->|"delegates"| node_chat_logic
node_chat_api -->|"imports"| node_ingestion
node_ingestion -->|"populates"| node_vector_index

click node_app "https://github.com/kartevsumit/eyhacks/blob/main/src/App.jsx"
click node_auth_ui "https://github.com/kartevsumit/eyhacks/blob/main/src/store/useAuthStore.js"
click node_dashboard "https://github.com/kartevsumit/eyhacks/blob/main/src/pages/AgentDash.jsx"
click node_claim_state "https://github.com/kartevsumit/eyhacks/blob/main/src/store/useStore.js"
click node_claim_suggestion "https://github.com/kartevsumit/eyhacks/blob/main/src/pages/RealTsuggestion.jsx"
click node_chat_ui "https://github.com/kartevsumit/eyhacks/blob/main/src/components/ChatContainer.jsx"
click node_chat_input "https://github.com/kartevsumit/eyhacks/blob/main/src/components/ChatInput.jsx"
click node_http_client "https://github.com/kartevsumit/eyhacks/blob/main/src/lib/axios.js"
click node_api_server "https://github.com/kartevsumit/eyhacks/blob/main/backend/src/index.js"
click node_auth_routes "https://github.com/kartevsumit/eyhacks/blob/main/backend/src/routes/agentAuth.routes.js"
click node_agent_controller "https://github.com/kartevsumit/eyhacks/blob/main/backend/src/controllers/agent.controller.js"
click node_auth_middleware "https://github.com/kartevsumit/eyhacks/blob/main/backend/src/middlewares/auth.middleware.js"
click node_claim_routes "https://github.com/kartevsumit/eyhacks/blob/main/backend/src/routes/claimRoutes.js"
click node_document_routes "https://github.com/kartevsumit/eyhacks/blob/main/backend/src/routes/documentRoutes.js"
click node_agent_model "https://github.com/kartevsumit/eyhacks/blob/main/backend/src/models/agent.model.js"
click node_claim_model "https://github.com/kartevsumit/eyhacks/blob/main/backend/src/models/claim.model.js"
click node_db_connection "https://github.com/kartevsumit/eyhacks/blob/main/backend/src/lib/db.js"
click node_chat_api "https://github.com/kartevsumit/eyhacks/blob/main/backend/Assistant_ChatBot/app.py"
click node_chat_logic "https://github.com/kartevsumit/eyhacks/blob/main/backend/Assistant_ChatBot/chat.py"
click node_ingestion "https://github.com/kartevsumit/eyhacks/blob/main/backend/Assistant_ChatBot/ingest.py"
click node_llm_module "https://github.com/kartevsumit/eyhacks/blob/main/backend/python/LLM.py"
click node_call_module "https://github.com/kartevsumit/eyhacks/blob/main/backend/python/VACT.py"
click node_summary_module "https://github.com/kartevsumit/eyhacks/blob/main/backend/python/Call_summary.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_app,node_auth_ui,node_dashboard,node_claim_state,node_claim_suggestion,node_chat_ui,node_chat_input,node_http_client toneBlue
class node_api_server,node_auth_routes,node_agent_controller,node_auth_middleware,node_claim_routes,node_document_routes toneAmber
class node_chat_api,node_chat_logic,node_ingestion,node_llm_module,node_call_module,node_summary_module toneMint
class node_agent_model,node_claim_model,node_db_connection,node_vector_index toneRose
class node_agent,node_chat_service toneIndigo
```

## Components

### Agent interface

- [App routing](https://github.com/kartevsumit/eyhacks/blob/main/src/App.jsx): `src/App.jsx`
- [Agent auth state](https://github.com/kartevsumit/eyhacks/blob/main/src/store/useAuthStore.js): `src/store/useAuthStore.js`
- [Agent dashboard](https://github.com/kartevsumit/eyhacks/blob/main/src/pages/AgentDash.jsx): `src/pages/AgentDash.jsx`
- [Claim state](https://github.com/kartevsumit/eyhacks/blob/main/src/store/useStore.js): `src/store/useStore.js`
- [Claim suggestions](https://github.com/kartevsumit/eyhacks/blob/main/src/pages/RealTsuggestion.jsx): `src/pages/RealTsuggestion.jsx`
- [Chat interface](https://github.com/kartevsumit/eyhacks/blob/main/src/components/ChatContainer.jsx): `src/components/ChatContainer.jsx`
- [Chat input](https://github.com/kartevsumit/eyhacks/blob/main/src/components/ChatInput.jsx): `src/components/ChatInput.jsx`
- [HTTP client](https://github.com/kartevsumit/eyhacks/blob/main/src/lib/axios.js): `src/lib/axios.js`

### Claims API

- [API server](https://github.com/kartevsumit/eyhacks/blob/main/backend/src/index.js): `backend/src/index.js`
- [Agent auth routes](https://github.com/kartevsumit/eyhacks/blob/main/backend/src/routes/agentAuth.routes.js): `backend/src/routes/agentAuth.routes.js`
- [Agent auth logic](https://github.com/kartevsumit/eyhacks/blob/main/backend/src/controllers/agent.controller.js): `backend/src/controllers/agent.controller.js`
- [Auth middleware](https://github.com/kartevsumit/eyhacks/blob/main/backend/src/middlewares/auth.middleware.js): `backend/src/middlewares/auth.middleware.js`
- [Claim operations](https://github.com/kartevsumit/eyhacks/blob/main/backend/src/routes/claimRoutes.js): `backend/src/routes/claimRoutes.js`
- [Document uploads](https://github.com/kartevsumit/eyhacks/blob/main/backend/src/routes/documentRoutes.js): `backend/src/routes/documentRoutes.js`

### AI assistant

- [Chat service](https://github.com/kartevsumit/eyhacks/blob/main/backend/Assistant_ChatBot/app.py): `backend/Assistant_ChatBot/app.py`
- [Chat processing](https://github.com/kartevsumit/eyhacks/blob/main/backend/Assistant_ChatBot/chat.py): `backend/Assistant_ChatBot/chat.py`
- [Document ingestion](https://github.com/kartevsumit/eyhacks/blob/main/backend/Assistant_ChatBot/ingest.py): `backend/Assistant_ChatBot/ingest.py`
- [LLM integration](https://github.com/kartevsumit/eyhacks/blob/main/backend/python/LLM.py): `backend/python/LLM.py`
- [Call processing](https://github.com/kartevsumit/eyhacks/blob/main/backend/python/VACT.py): `backend/python/VACT.py`
- [Call summaries](https://github.com/kartevsumit/eyhacks/blob/main/backend/python/Call_summary.py): `backend/python/Call_summary.py`

### Persistence and integrations

- [Agent records](https://github.com/kartevsumit/eyhacks/blob/main/backend/src/models/agent.model.js): `backend/src/models/agent.model.js`
- [Claim records](https://github.com/kartevsumit/eyhacks/blob/main/backend/src/models/claim.model.js): `backend/src/models/claim.model.js`
- [Database connection](https://github.com/kartevsumit/eyhacks/blob/main/backend/src/lib/db.js): `backend/src/lib/db.js`
- **Pinecone index**

### Other components

- **Claims agent**
- **Chat endpoint**

## Connections

- Claims agent → App routing: uses (evidence: `src/App.jsx`)
- App routing → Agent auth state: checks auth (evidence: `src/App.jsx`)
- App routing → Agent dashboard: routes to (evidence: `src/App.jsx`)
- App routing → Claim suggestions: routes to (evidence: `src/App.jsx`)
- Claims agent → Agent auth state: signs in (evidence: `src/store/useAuthStore.js`)
- Agent auth state → HTTP client: sends requests (evidence: `src/store/useAuthStore.js`)
- Agent dashboard → Claim state: loads claims (evidence: `src/pages/AgentDash.jsx`)
- Claim state → HTTP client: requests claims (evidence: `src/store/useStore.js`)
- Claim suggestions → Claim state: uses (evidence: `src/pages/RealTsuggestion.jsx`)
- Agent dashboard → Chat interface: renders (evidence: `src/pages/AgentDash.jsx`)
- Chat interface → Chat input: renders (evidence: `src/components/ChatContainer.jsx`)
- Claims agent → Chat input: asks question
- Chat interface → Chat endpoint: posts question (evidence: `src/components/ChatContainer.jsx`)
- HTTP client → API server: calls API (evidence: `src/lib/axios.js`)
- API server → Agent auth routes: registers (evidence: `backend/src/index.js`)
- API server → Claim operations: registers (evidence: `backend/src/index.js`)
- API server → Document uploads: registers (evidence: `backend/src/index.js`)
- Agent auth routes → Agent auth logic: routes requests (evidence: `backend/src/routes/agentAuth.routes.js`)
- Agent auth routes → Auth middleware: protects check (evidence: `backend/src/routes/agentAuth.routes.js`)
- Agent auth logic → Agent records: reads and writes (evidence: `backend/src/controllers/agent.controller.js`)
- Agent auth logic → Agent records: issues tokens (evidence: `backend/src/controllers/agent.controller.js`)
- Claim operations → Claim records: reads and writes (evidence: `backend/src/routes/claimRoutes.js`)
- Claim operations → Agent records: assigns agents (evidence: `backend/src/routes/claimRoutes.js`)
- Document uploads → Claim records: stores file path (evidence: `backend/src/routes/documentRoutes.js`)
- API server → Database connection: imports (evidence: `backend/src/index.js`)
- Chat endpoint → Chat service: serves requests
- Chat service → Chat processing: delegates (evidence: `backend/Assistant_ChatBot/app.py`)
- Chat service → Document ingestion: imports (evidence: `backend/Assistant_ChatBot/app.py`)
- Document ingestion → Pinecone index: populates (evidence: `backend/Assistant_ChatBot/ingest.py`)
