# madhuu1706/vedantu_chat_agent- architecture

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

- Interactive diagram: https://gitdiagram.com/madhuu1706/vedantu_chat_agent-
- Repository: https://github.com/madhuu1706/vedantu_chat_agent-

## Overview

This is a student-facing study coach for Shimon Sir’s Vedantu Tamil class. The main workflow is a student submitting a question in the React app, the server routing it to Lyzr with Gemini as fallback, and returning a transcript-grounded reply. The UI also offers session controls, a simulated live-question feed, class details, and a Pomodoro study timer. Edges reflect calls shown in the excerpts or explicitly documented behavior; unsampled client details are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/src/App.tsx) (Study Coach App), [`server.ts`](https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/server.ts) (HTTP API Server), [`src/components/Sidebar.tsx`](https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/src/components/Sidebar.tsx) (Session Sidebar), [`src/types.ts`](https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/src/types.ts) (Shared Chat Types)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Study Coach UI"]
  node_app["Study Coach App<br/>[App.tsx]"]
  node_sessions["Chat Sessions<br/>[App.tsx]"]
  node_sidebar["Session Sidebar<br/>[Sidebar.tsx]"]
  node_timer["Pomodoro Timer<br/>[PomodoroTimer.tsx]"]
  node_feed["Live Question Feed<br/>[LiveFeed.tsx]"]
  node_types["Shared Chat Types<br/>[types.ts]"]
  node_entry["React Entry Point<br/>[main.tsx]"]
end

subgraph group_server["Chat Services"]
  node_server["HTTP API Server<br/>[server.ts]"]
  node_lyzr["Lyzr Agent API"]
  node_gemini["Gemini Model"]
  node_classinfo["Class Details API<br/>[server.ts]"]
end

subgraph group_knowledge["Class Knowledge"]
  node_transcript["Class Transcript KB<br/>[classTranscript.ts]"]
end

node_student(("Student"))

node_student -->|"asks question"| node_app
node_app -->|"posts chat"| node_server
node_server -->|"tries inference"| node_lyzr
node_server -->|"fallback generation"| node_gemini
node_server -->|"grounds fallback"| node_transcript
node_server -->|"returns reply"| node_app
node_app -->|"manages sessions"| node_sessions
node_app -->|"renders controls"| node_sidebar
node_sidebar -->|"renders timer"| node_timer
node_app -->|"renders feed"| node_feed
node_feed -->|"submits question"| node_app
node_app -.->|"requests details"| node_classinfo
node_entry -->|"mounts app"| node_app
node_app -->|"uses types"| node_types
node_sidebar -->|"uses types"| node_types
node_timer -->|"uses mode type"| node_types

click node_app "https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/src/App.tsx"
click node_sessions "https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/src/App.tsx"
click node_sidebar "https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/src/components/Sidebar.tsx"
click node_timer "https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/src/components/PomodoroTimer.tsx"
click node_feed "https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/src/components/LiveFeed.tsx"
click node_server "https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/server.ts"
click node_classinfo "https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/server.ts"
click node_transcript "https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/src/data/classTranscript.ts"
click node_types "https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/src/types.ts"
click node_entry "https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/src/main.tsx"

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_sessions,node_sidebar,node_timer,node_feed,node_types,node_entry toneBlue
class node_server,node_lyzr,node_gemini,node_classinfo toneAmber
class node_transcript toneMint
class node_student toneIndigo
```

## Components

### Study Coach UI

- [Study Coach App](https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/src/App.tsx): `src/App.tsx`
- [Chat Sessions](https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/src/App.tsx): `src/App.tsx`
- [Session Sidebar](https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/src/components/Sidebar.tsx): `src/components/Sidebar.tsx`
- [Pomodoro Timer](https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/src/components/PomodoroTimer.tsx): `src/components/PomodoroTimer.tsx`
- [Live Question Feed](https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/src/components/LiveFeed.tsx): `src/components/LiveFeed.tsx`
- [Shared Chat Types](https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/src/types.ts): `src/types.ts`
- [React Entry Point](https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/src/main.tsx): `src/main.tsx`

### Chat Services

- [HTTP API Server](https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/server.ts): `server.ts`
- **Lyzr Agent API**
- **Gemini Model**
- [Class Details API](https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/server.ts): `server.ts`

### Class Knowledge

- [Class Transcript KB](https://github.com/madhuu1706/vedantu_chat_agent-/blob/main/src/data/classTranscript.ts): `src/data/classTranscript.ts`

### Other components

- **Student**

## Connections

- Student → Study Coach App: asks question (evidence: `src/App.tsx`)
- Study Coach App → HTTP API Server: posts chat (evidence: `src/App.tsx`)
- HTTP API Server → Lyzr Agent API: tries inference (evidence: `server.ts`)
- HTTP API Server → Gemini Model: fallback generation (evidence: `server.ts`)
- HTTP API Server → Class Transcript KB: grounds fallback (evidence: `server.ts`)
- HTTP API Server → Study Coach App: returns reply (evidence: `server.ts`)
- Study Coach App → Chat Sessions: manages sessions (evidence: `src/App.tsx`)
- Study Coach App → Session Sidebar: renders controls (evidence: `src/App.tsx`)
- Session Sidebar → Pomodoro Timer: renders timer (evidence: `src/components/Sidebar.tsx`)
- Study Coach App → Live Question Feed: renders feed (evidence: `src/App.tsx`)
- Live Question Feed → Study Coach App: submits question (evidence: `src/App.tsx`)
- Study Coach App → Class Details API: requests details
- React Entry Point → Study Coach App: mounts app (evidence: `src/main.tsx`)
- Study Coach App → Shared Chat Types: uses types (evidence: `src/App.tsx`)
- Session Sidebar → Shared Chat Types: uses types (evidence: `src/components/Sidebar.tsx`)
- Pomodoro Timer → Shared Chat Types: uses mode type (evidence: `src/components/PomodoroTimer.tsx`)
