# sahithyapopuriofficial-bit/ncct-chatbot architecture

> Architecture diagram of the GitHub repository sahithyapopuriofficial-bit/ncct-chatbot, 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/sahithyapopuriofficial-bit/ncct-chatbot
- Repository: https://github.com/sahithyapopuriofficial-bit/ncct-chatbot

## Overview

NCCT Assistant is a browser-based chatbot for questions about NCCT, cooperative training, courses, and its training-institute network. A user submits a question from the chat UI; the browser sends the in-memory conversation to a server route, which validates it and requests a Gemini response using NCCT-specific guidance. The route returns the reply for display in the chat. The README documents the supported topics and intended guidance for uncertain current facts. The graph reflects the sampled UI and route; it does not imply a separate knowledge base or persistent storage.

Main entry points: [`app/page.tsx`](https://github.com/sahithyapopuriofficial-bit/ncct-chatbot/blob/main/app/page.tsx) (Chat UI and history), [`app/api/chat/route.ts`](https://github.com/sahithyapopuriofficial-bit/ncct-chatbot/blob/main/app/api/chat/route.ts) (Chat API route), [`app/globals.css`](https://github.com/sahithyapopuriofficial-bit/ncct-chatbot/blob/main/app/globals.css) (Chat styling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_chat_ui["Chat interface"]
  node_chat_page["Chat UI and history<br/>[page.tsx]"]
  node_chat_styles["Chat styling<br/>[globals.css]"]
end

subgraph group_chat_service["Chat service"]
  node_chat_api["Chat API route<br/>[route.ts]"]
  node_answer_guidance["NCCT answer guidance<br/>[route.ts]"]
end

subgraph group_ai_provider["AI provider"]
  node_gemini{{"Gemini API"}}
end

node_user(("Chat user"))

node_user -->|"asks questions"| node_chat_page
node_chat_page -->|"sends history"| node_chat_api
node_chat_api -->|"configures answers"| node_answer_guidance
node_chat_api -->|"requests generation"| node_gemini
node_chat_api -->|"returns reply"| node_chat_page
node_chat_page -->|"displays reply"| node_user
node_chat_page -->|"uses styles"| node_chat_styles

click node_chat_page "https://github.com/sahithyapopuriofficial-bit/ncct-chatbot/blob/main/app/page.tsx"
click node_chat_styles "https://github.com/sahithyapopuriofficial-bit/ncct-chatbot/blob/main/app/globals.css"
click node_chat_api "https://github.com/sahithyapopuriofficial-bit/ncct-chatbot/blob/main/app/api/chat/route.ts"
click node_answer_guidance "https://github.com/sahithyapopuriofficial-bit/ncct-chatbot/blob/main/app/api/chat/route.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_chat_page,node_chat_styles,node_user toneBlue
class node_chat_api,node_answer_guidance toneAmber
class node_gemini toneMint
```

## Components

### Chat interface

- [Chat UI and history](https://github.com/sahithyapopuriofficial-bit/ncct-chatbot/blob/main/app/page.tsx): `app/page.tsx`
- [Chat styling](https://github.com/sahithyapopuriofficial-bit/ncct-chatbot/blob/main/app/globals.css): `app/globals.css`

### Chat service

- [Chat API route](https://github.com/sahithyapopuriofficial-bit/ncct-chatbot/blob/main/app/api/chat/route.ts): `app/api/chat/route.ts`
- [NCCT answer guidance](https://github.com/sahithyapopuriofficial-bit/ncct-chatbot/blob/main/app/api/chat/route.ts): `app/api/chat/route.ts`

### AI provider

- **Gemini API**

### Other components

- **Chat user**

## Connections

- Chat user → Chat UI and history: asks questions (evidence: `README.md`)
- Chat UI and history → Chat API route: sends history (evidence: `app/page.tsx`)
- Chat API route → NCCT answer guidance: configures answers (evidence: `app/api/chat/route.ts`)
- Chat API route → Gemini API: requests generation (evidence: `app/api/chat/route.ts`)
- Chat API route → Chat UI and history: returns reply (evidence: `app/api/chat/route.ts`)
- Chat UI and history → Chat user: displays reply (evidence: `app/page.tsx`)
- Chat UI and history → Chat styling: uses styles
