# francis3002-01/it33a-ai-chatbot-midterm-activity architecture

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

- Interactive diagram: https://gitdiagram.com/francis3002-01/it33a-ai-chatbot-midterm-activity
- Repository: https://github.com/francis3002-01/it33a-ai-chatbot-midterm-activity

## Overview

This is a small web chatbot: the Node server serves static files and exposes a chat endpoint that forwards prompts to Gemini, then returns generated text or an error. The server implementation is excerpted; the browser files are listed but their contents are not shown, so no browser-to-endpoint call is asserted.

Main entry points: [`server.js`](https://github.com/francis3002-01/it33a-ai-chatbot-midterm-activity/blob/main/server.js) (Express chat server), [`public/index.html`](https://github.com/francis3002-01/it33a-ai-chatbot-midterm-activity/blob/main/public/index.html) (Chat page), [`public/style.css`](https://github.com/francis3002-01/it33a-ai-chatbot-midterm-activity/blob/main/public/style.css) (Page styles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client assets"]
  node_page["Chat page<br/>[index.html]"]
  node_styles["Page styles<br/>[style.css]"]
end

subgraph group_backend["Chat backend"]
  node_server["Express chat server<br/>[server.js]"]
end

subgraph group_external["External service"]
  node_gemini["Gemini API"]
end

node_visitor(("Visitor"))

node_server -->|"serves static files"| node_page
node_server -->|"serves static files"| node_styles
node_server -->|"sends prompt"| node_gemini
node_gemini -->|"returns response"| node_server

click node_page "https://github.com/francis3002-01/it33a-ai-chatbot-midterm-activity/blob/main/public/index.html"
click node_styles "https://github.com/francis3002-01/it33a-ai-chatbot-midterm-activity/blob/main/public/style.css"
click node_server "https://github.com/francis3002-01/it33a-ai-chatbot-midterm-activity/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_page,node_styles toneBlue
class node_server toneAmber
class node_gemini toneMint
class node_visitor toneIndigo
```

## Components

### Client assets

- [Chat page](https://github.com/francis3002-01/it33a-ai-chatbot-midterm-activity/blob/main/public/index.html): `public/index.html`
- [Page styles](https://github.com/francis3002-01/it33a-ai-chatbot-midterm-activity/blob/main/public/style.css): `public/style.css`

### Chat backend

- [Express chat server](https://github.com/francis3002-01/it33a-ai-chatbot-midterm-activity/blob/main/server.js): `server.js`

### External service

- **Gemini API**

### Other components

- **Visitor**

## Connections

- Express chat server → Chat page: serves static files (evidence: `server.js`)
- Express chat server → Page styles: serves static files (evidence: `server.js`)
- Express chat server → Gemini API: sends prompt (evidence: `server.js`)
- Gemini API → Express chat server: returns response (evidence: `server.js`)
