# datarat329/iasisst-utesa architecture

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

- Interactive diagram: https://gitdiagram.com/datarat329/iasisst-utesa
- Repository: https://github.com/datarat329/iasisst-utesa

## Overview

iAsisst-UTESA is a university-information chatbot with a browser interface, a FastAPI service, database-backed answers and specialized schedule, credit, and classroom handling. The main workflow is a user message sent from the web client to `/chat`, where the service routes it to a response path and returns a reply. `/train` loads database examples to activate the NumPy model; an admin panel also curates question-and-answer records and pending phrases. Some Python routing details are omitted from the excerpts, so uncertain links are dashed.

Main entry points: [`combined_service.py`](https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py) (Intent routing), [`index.html`](https://github.com/datarat329/iasisst-utesa/blob/main/index.html) (Chat page), [`public/js/script.js`](https://github.com/datarat329/iasisst-utesa/blob/main/public/js/script.js) (Chat client), [`api/index.php`](https://github.com/datarat329/iasisst-utesa/blob/main/api/index.php) (PHP chat handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Chat interface"]
  node_webpage["Chat page<br/>[index.html]"]
  node_chat_ui["Chat client<br/>[script.js]"]
end

subgraph group_service["Chat service"]
  node_chat_api["Chat endpoint"]
  node_intent_route["Intent routing"]
  node_schedule["Schedule parsing"]
  node_credit["Credit estimate"]
  node_classroom["Classroom lookup"]
  node_train_api["Training endpoint"]
  node_legacy_api["PHP chat handler<br/>[index.php]"]
end

subgraph group_knowledge["Knowledge and training"]
  node_faq_match["FAQ matching"]
  node_unknown_capture["Unknown capture"]
  node_training["Neural training"]
  node_data_loader["Training data loader"]
  node_schema["Chatbot schema<br/>[chatbot.sql]"]
end

subgraph group_admin["Knowledge administration"]
  node_admin_panel["Admin panel<br/>[admin.php]"]
  node_php_db["PHP DB helper<br/>[database.php]"]
end

node_user(("Student"))
node_mysql[("MySQL database")]

node_user -->|"uses"| node_webpage
node_webpage -.->|"loads"| node_chat_ui
node_chat_ui -->|"posts message"| node_chat_api
node_chat_api -->|"routes request"| node_intent_route
node_intent_route -->|"handles schedule"| node_schedule
node_intent_route -->|"handles credits"| node_credit
node_intent_route -.->|"handles classroom"| node_classroom
node_intent_route -->|"matches question"| node_faq_match
node_intent_route -->|"records unknown"| node_unknown_capture
node_credit -->|"reads cost"| node_mysql
node_faq_match -->|"reads answers"| node_mysql
node_unknown_capture -->|"writes phrase"| node_mysql
node_train_api -->|"starts training"| node_training
node_training -->|"loads examples"| node_data_loader
node_data_loader -->|"queries examples"| node_mysql
node_schema -->|"defines tables"| node_mysql
node_admin_panel -->|"curates records"| node_mysql
node_legacy_api -->|"queries chatbot data"| node_mysql
node_php_db -.->|"opens connection"| node_mysql

click node_webpage "https://github.com/datarat329/iasisst-utesa/blob/main/index.html"
click node_chat_ui "https://github.com/datarat329/iasisst-utesa/blob/main/public/js/script.js"
click node_chat_api "https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py"
click node_intent_route "https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py"
click node_schedule "https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py"
click node_credit "https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py"
click node_classroom "https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py"
click node_faq_match "https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py"
click node_unknown_capture "https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py"
click node_train_api "https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py"
click node_training "https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py"
click node_data_loader "https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py"
click node_schema "https://github.com/datarat329/iasisst-utesa/blob/main/chatbot.sql"
click node_admin_panel "https://github.com/datarat329/iasisst-utesa/blob/main/api/admin.php"
click node_legacy_api "https://github.com/datarat329/iasisst-utesa/blob/main/api/index.php"
click node_php_db "https://github.com/datarat329/iasisst-utesa/blob/main/private/database.php"

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_webpage,node_chat_ui toneBlue
class node_chat_api,node_intent_route,node_schedule,node_credit,node_classroom,node_train_api,node_legacy_api,node_mysql toneAmber
class node_faq_match,node_unknown_capture,node_training,node_data_loader,node_schema toneMint
class node_admin_panel,node_php_db toneRose
class node_user toneIndigo
```

## Components

### Chat interface

- [Chat page](https://github.com/datarat329/iasisst-utesa/blob/main/index.html): `index.html`
- [Chat client](https://github.com/datarat329/iasisst-utesa/blob/main/public/js/script.js): `public/js/script.js`

### Chat service

- [Chat endpoint](https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py): `combined_service.py`
- [Intent routing](https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py): `combined_service.py`
- [Schedule parsing](https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py): `combined_service.py`
- [Credit estimate](https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py): `combined_service.py`
- [Classroom lookup](https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py): `combined_service.py`
- [Training endpoint](https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py): `combined_service.py`
- [PHP chat handler](https://github.com/datarat329/iasisst-utesa/blob/main/api/index.php): `api/index.php`

### Knowledge and training

- [FAQ matching](https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py): `combined_service.py`
- [Unknown capture](https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py): `combined_service.py`
- [Neural training](https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py): `combined_service.py`
- [Training data loader](https://github.com/datarat329/iasisst-utesa/blob/main/combined_service.py): `combined_service.py`
- [Chatbot schema](https://github.com/datarat329/iasisst-utesa/blob/main/chatbot.sql): `chatbot.sql`

### Knowledge administration

- [Admin panel](https://github.com/datarat329/iasisst-utesa/blob/main/api/admin.php): `api/admin.php`
- [PHP DB helper](https://github.com/datarat329/iasisst-utesa/blob/main/private/database.php): `private/database.php`

### Other components

- **Student**
- **MySQL database**

## Connections

- Student → Chat page: uses (evidence: `README.md`)
- Chat page → Chat client: loads
- Chat client → Chat endpoint: posts message (evidence: `public/js/script.js`)
- Chat endpoint → Intent routing: routes request (evidence: `combined_service.py`)
- Intent routing → Schedule parsing: handles schedule (evidence: `combined_service.py`)
- Intent routing → Credit estimate: handles credits (evidence: `combined_service.py`)
- Intent routing → Classroom lookup: handles classroom (evidence: `combined_service.py`)
- Intent routing → FAQ matching: matches question (evidence: `combined_service.py`)
- Intent routing → Unknown capture: records unknown (evidence: `combined_service.py`)
- Credit estimate → MySQL database: reads cost (evidence: `combined_service.py`)
- FAQ matching → MySQL database: reads answers (evidence: `combined_service.py`)
- Unknown capture → MySQL database: writes phrase (evidence: `combined_service.py`)
- Training endpoint → Neural training: starts training (evidence: `combined_service.py`)
- Neural training → Training data loader: loads examples (evidence: `combined_service.py`)
- Training data loader → MySQL database: queries examples (evidence: `combined_service.py`)
- Chatbot schema → MySQL database: defines tables (evidence: `README.md`)
- Admin panel → MySQL database: curates records (evidence: `api/admin.php`)
- PHP chat handler → MySQL database: queries chatbot data (evidence: `api/index.php`)
- PHP DB helper → MySQL database: opens connection
