# 26shivansh-26/gyaan-setu-github architecture

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

- Interactive diagram: https://gitdiagram.com/26shivansh-26/gyaan-setu-github
- Repository: https://github.com/26shivansh-26/gyaan-setu-github

## Overview

Gyaan Setu is a browser-based Class 9 tutoring chat backed by an Express REST API and local Ollama inference. Students send questions through the chat UI; the backend combines fixed tutor guidance with frontend instructions and conversation messages, requests a response from the configured model, then returns a plain-text-friendly reply. The README documents session history, responsive UI, and Hindi/Hinglish support, but the frontend implementation was not sampled, so its internal wiring is not detailed here.

Main entry points: [`server.js`](https://github.com/26shivansh-26/gyaan-setu-github/blob/main/server.js) (Chat API), [`index.html`](https://github.com/26shivansh-26/gyaan-setu-github/blob/main/index.html) (Chat interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Student interface"]
  node_chat_ui["Chat interface<br/>[index.html]"]
end

subgraph group_backend["Chat backend"]
  node_chat_api["Chat API<br/>[server.js]"]
  node_tutor_rules["Tutor guidance<br/>[server.js]"]
  node_reply_handling["Reply handling<br/>[server.js]"]
end

subgraph group_inference["Local inference"]
  node_ollama["Ollama service"]
  node_gyaan_model["Gyaan Setu model"]
end

node_student(("Student"))

node_student -->|"asks question"| node_chat_ui
node_chat_ui -->|"POST /api/chat"| node_chat_api
node_chat_api -->|"combines instructions"| node_tutor_rules
node_chat_api -->|"sends chat request"| node_ollama
node_ollama -->|"runs inference"| node_gyaan_model
node_ollama -->|"returns response"| node_chat_api
node_chat_api -->|"formats reply"| node_reply_handling
node_reply_handling -->|"returns reply"| node_chat_ui
node_chat_ui -->|"shows response"| node_student

click node_chat_ui "https://github.com/26shivansh-26/gyaan-setu-github/blob/main/index.html"
click node_chat_api "https://github.com/26shivansh-26/gyaan-setu-github/blob/main/server.js"
click node_tutor_rules "https://github.com/26shivansh-26/gyaan-setu-github/blob/main/server.js"
click node_reply_handling "https://github.com/26shivansh-26/gyaan-setu-github/blob/main/server.js"

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_chat_ui toneBlue
class node_chat_api,node_tutor_rules,node_reply_handling toneAmber
class node_ollama,node_gyaan_model toneMint
class node_student toneIndigo
```

## Components

### Student interface

- [Chat interface](https://github.com/26shivansh-26/gyaan-setu-github/blob/main/index.html): `index.html`

### Chat backend

- [Chat API](https://github.com/26shivansh-26/gyaan-setu-github/blob/main/server.js): `server.js`
- [Tutor guidance](https://github.com/26shivansh-26/gyaan-setu-github/blob/main/server.js): `server.js`
- [Reply handling](https://github.com/26shivansh-26/gyaan-setu-github/blob/main/server.js): `server.js`

### Local inference

- **Ollama service**
- **Gyaan Setu model**

### Other components

- **Student**

## Connections

- Student → Chat interface: asks question
- Chat interface → Chat API: POST /api/chat
- Chat API → Tutor guidance: combines instructions
- Chat API → Ollama service: sends chat request
- Ollama service → Gyaan Setu model: runs inference
- Ollama service → Chat API: returns response
- Chat API → Reply handling: formats reply
- Reply handling → Chat interface: returns reply
- Chat interface → Student: shows response
