# narendra2904/btech-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/narendra2904/btech-frontend
- Repository: https://github.com/narendra2904/btech-frontend

## Overview

Backbenchers is a JNTUH B.Tech results portal with an embedded academic assistant. Students search by hall ticket to inspect results and use dedicated views for backlogs, credit progression, live or class results, and comparisons. The assistant can analyze loaded student data, answer academic questions through a server-side Gemini proxy, and link students to study resources. The README documents several capabilities whose individual implementations were not sampled; those are represented by their documented page paths. The excerpts show the assistant’s result lookup and AI request, but not the portal’s result-fetch implementation or every page-to-script connection.

Main entry points: [`ai-bot.js`](https://github.com/narendra2904/btech-frontend/blob/main/ai-bot.js) (Assistant dialog), [`server.js`](https://github.com/narendra2904/btech-frontend/blob/main/server.js) (Express server), [`result.html`](https://github.com/narendra2904/btech-frontend/blob/main/result.html) (Result sheets), [`api/chat-ai.js`](https://github.com/narendra2904/btech-frontend/blob/main/api/chat-ai.js) (AI proxy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Results portal"]
  node_dashboard["Dashboard<br/>[index.html]"]
  node_result["Result sheets<br/>[result.html]"]
  node_backlogs["Backlog analysis<br/>[backlog.html]"]
  node_credits["Credit checker<br/>[creditChecker.html]"]
  node_live["Live results<br/>[liveresults.html]"]
  node_class["Class results<br/>[classresult.html]"]
  node_compare["Result comparison<br/>[compare.html]"]
  node_result_ui["Result rendering<br/>[script.js]"]
end

subgraph group_assistant["Academic assistant"]
  node_assistant_ui["Assistant dialog<br/>[ai-bot.js]"]
  node_academic_analysis["Academic analysis<br/>[ai-bot.js]"]
  node_study_resources["Study resources<br/>[ai-bot.js]"]
end

subgraph group_services["Backend services"]
  node_server["Express server<br/>[server.js]"]
  node_ai_api["AI proxy<br/>[chat-ai.js]"]
  node_whatsapp_api["Feedback handler<br/>[send-whatsapp.js]"]
end

subgraph group_integrations["External integrations"]
  node_result_service["Results API"]
  node_gemini["Google Gemini"]
  node_twilio["Twilio WhatsApp"]
end

node_student(("Student"))

node_student -->|"opens"| node_dashboard
node_student -->|"searches results"| node_result
node_student -->|"checks supplies"| node_backlogs
node_student -->|"audits credits"| node_credits
node_student -->|"fetches results"| node_live
node_student -->|"explores batch"| node_class
node_student -->|"compares students"| node_compare
node_result -.->|"renders results"| node_result_ui
node_student -->|"asks questions"| node_assistant_ui
node_assistant_ui -->|"fetches student data"| node_result_service
node_assistant_ui -->|"analyzes results"| node_academic_analysis
node_assistant_ui -->|"sends open queries"| node_ai_api
node_academic_analysis -.->|"offers resources"| node_study_resources
node_ai_api -->|"requests completion"| node_gemini
node_server -->|"requests completion"| node_gemini
node_server -->|"sends feedback"| node_twilio
node_whatsapp_api -->|"sends feedback"| node_twilio

click node_dashboard "https://github.com/narendra2904/btech-frontend/blob/main/index.html"
click node_result "https://github.com/narendra2904/btech-frontend/blob/main/result.html"
click node_backlogs "https://github.com/narendra2904/btech-frontend/blob/main/backlog.html"
click node_credits "https://github.com/narendra2904/btech-frontend/blob/main/creditChecker.html"
click node_live "https://github.com/narendra2904/btech-frontend/blob/main/liveresults.html"
click node_class "https://github.com/narendra2904/btech-frontend/blob/main/classresult.html"
click node_compare "https://github.com/narendra2904/btech-frontend/blob/main/compare.html"
click node_result_ui "https://github.com/narendra2904/btech-frontend/blob/main/script.js"
click node_assistant_ui "https://github.com/narendra2904/btech-frontend/blob/main/ai-bot.js"
click node_academic_analysis "https://github.com/narendra2904/btech-frontend/blob/main/ai-bot.js"
click node_study_resources "https://github.com/narendra2904/btech-frontend/blob/main/ai-bot.js"
click node_server "https://github.com/narendra2904/btech-frontend/blob/main/server.js"
click node_ai_api "https://github.com/narendra2904/btech-frontend/blob/main/api/chat-ai.js"
click node_whatsapp_api "https://github.com/narendra2904/btech-frontend/blob/main/api/send-whatsapp.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_dashboard,node_result,node_backlogs,node_credits,node_live,node_class,node_compare,node_result_ui toneBlue
class node_assistant_ui,node_academic_analysis,node_study_resources toneAmber
class node_server,node_ai_api,node_whatsapp_api toneMint
class node_result_service,node_gemini,node_twilio toneRose
class node_student toneIndigo
```

## Components

### Results portal

- [Dashboard](https://github.com/narendra2904/btech-frontend/blob/main/index.html): `index.html`
- [Result sheets](https://github.com/narendra2904/btech-frontend/blob/main/result.html): `result.html`
- [Backlog analysis](https://github.com/narendra2904/btech-frontend/blob/main/backlog.html): `backlog.html`
- [Credit checker](https://github.com/narendra2904/btech-frontend/blob/main/creditChecker.html): `creditChecker.html`
- [Live results](https://github.com/narendra2904/btech-frontend/blob/main/liveresults.html): `liveresults.html`
- [Class results](https://github.com/narendra2904/btech-frontend/blob/main/classresult.html): `classresult.html`
- [Result comparison](https://github.com/narendra2904/btech-frontend/blob/main/compare.html): `compare.html`
- [Result rendering](https://github.com/narendra2904/btech-frontend/blob/main/script.js): `script.js`

### Academic assistant

- [Assistant dialog](https://github.com/narendra2904/btech-frontend/blob/main/ai-bot.js): `ai-bot.js`
- [Academic analysis](https://github.com/narendra2904/btech-frontend/blob/main/ai-bot.js): `ai-bot.js`
- [Study resources](https://github.com/narendra2904/btech-frontend/blob/main/ai-bot.js): `ai-bot.js`

### Backend services

- [Express server](https://github.com/narendra2904/btech-frontend/blob/main/server.js): `server.js`
- [AI proxy](https://github.com/narendra2904/btech-frontend/blob/main/api/chat-ai.js): `api/chat-ai.js`
- [Feedback handler](https://github.com/narendra2904/btech-frontend/blob/main/api/send-whatsapp.js): `api/send-whatsapp.js`

### External integrations

- **Results API**
- **Google Gemini**
- **Twilio WhatsApp**

### Other components

- **Student**

## Connections

- Student → Dashboard: opens (evidence: `README.md`)
- Student → Result sheets: searches results (evidence: `README.md`)
- Student → Backlog analysis: checks supplies (evidence: `README.md`)
- Student → Credit checker: audits credits (evidence: `README.md`)
- Student → Live results: fetches results (evidence: `README.md`)
- Student → Class results: explores batch (evidence: `README.md`)
- Student → Result comparison: compares students (evidence: `README.md`)
- Result sheets → Result rendering: renders results
- Student → Assistant dialog: asks questions (evidence: `README.md`)
- Assistant dialog → Results API: fetches student data (evidence: `ai-bot.js`)
- Assistant dialog → Academic analysis: analyzes results (evidence: `ai-bot.js`)
- Assistant dialog → AI proxy: sends open queries (evidence: `ai-bot.js`)
- Academic analysis → Study resources: offers resources (evidence: `ai-bot.js`)
- AI proxy → Google Gemini: requests completion (evidence: `api/chat-ai.js`)
- Express server → Google Gemini: requests completion (evidence: `server.js`)
- Express server → Twilio WhatsApp: sends feedback (evidence: `server.js`)
- Feedback handler → Twilio WhatsApp: sends feedback (evidence: `api/send-whatsapp.js`)
