# gelowie/nova-chatbot architecture

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

- Interactive diagram: https://gitdiagram.com/gelowie/nova-chatbot
- Repository: https://github.com/gelowie/nova-chatbot

## Overview

Nova is a local chatbot: a browser sends a message to the Python HTTP server, which calls the engine and returns a reply. The engine tries math, then time/date, then the editable JSON brain, with a fallback when nothing matches. The README documents the UI, HTTP routes and brain capabilities; source excerpts confirm server-to-engine and engine-to-skill calls. The Java files are an optional skills/router demo, not part of the documented Python server flow. Unsampled frontend and brain internals are represented only at their documented boundaries.

Main entry points: [`server.py`](https://github.com/gelowie/nova-chatbot/blob/main/server.py) (HTTP routes), [`src/py/engine.py`](https://github.com/gelowie/nova-chatbot/blob/main/src/py/engine.py) (Nova engine), [`src/java/NovaEngine.java`](https://github.com/gelowie/nova-chatbot/blob/main/src/java/NovaEngine.java) (Java router), [`src/index.html`](https://github.com/gelowie/nova-chatbot/blob/main/src/index.html) (Chat page)

## Diagram (Mermaid)

```mermaid
flowchart TD

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

subgraph group_http["HTTP server"]
  node_http_server["HTTP routes<br/>[server.py]"]
end

subgraph group_routing["Reply routing"]
  node_engine["Nova engine<br/>[engine.py]"]
  node_brain["JSON brain<br/>[brain.json]"]
end

subgraph group_skills["Answer skills"]
  node_math["Math skill<br/>[math_solver.py]"]
  node_time["Time and date<br/>[time_reader.py]"]
end

subgraph group_java["Java demo"]
  node_java_router["Java router<br/>[NovaEngine.java]"]
  node_java_math["Java math<br/>[MathSolver.java]"]
  node_java_time["Java time<br/>[TimeReader.java]"]
end

node_browser(("User browser"))

node_browser -->|"uses"| node_chat_ui
node_chat_ui -->|"POST /chat"| node_http_server
node_http_server -->|"calls respond"| node_engine
node_http_server -->|"configures path"| node_brain
node_engine -->|"tries first"| node_math
node_engine -->|"tries second"| node_time
node_engine -->|"matches intents"| node_brain
node_http_server -->|"returns reply"| node_browser
node_java_router -->|"calls first"| node_java_math
node_java_router -->|"calls second"| node_java_time

click node_chat_ui "https://github.com/gelowie/nova-chatbot/blob/main/src/index.html"
click node_http_server "https://github.com/gelowie/nova-chatbot/blob/main/server.py"
click node_engine "https://github.com/gelowie/nova-chatbot/blob/main/src/py/engine.py"
click node_brain "https://github.com/gelowie/nova-chatbot/blob/main/src/json/brain.json"
click node_math "https://github.com/gelowie/nova-chatbot/blob/main/src/py/math_solver.py"
click node_time "https://github.com/gelowie/nova-chatbot/blob/main/src/py/time_reader.py"
click node_java_router "https://github.com/gelowie/nova-chatbot/blob/main/src/java/NovaEngine.java"
click node_java_math "https://github.com/gelowie/nova-chatbot/blob/main/src/java/MathSolver.java"
click node_java_time "https://github.com/gelowie/nova-chatbot/blob/main/src/java/TimeReader.java"

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,node_browser toneBlue
class node_http_server toneAmber
class node_engine,node_brain toneMint
class node_math,node_time toneRose
class node_java_router,node_java_math,node_java_time toneIndigo
```

## Components

### Chat interface

- [Chat page](https://github.com/gelowie/nova-chatbot/blob/main/src/index.html): `src/index.html`

### HTTP server

- [HTTP routes](https://github.com/gelowie/nova-chatbot/blob/main/server.py): `server.py`

### Reply routing

- [Nova engine](https://github.com/gelowie/nova-chatbot/blob/main/src/py/engine.py): `src/py/engine.py`
- [JSON brain](https://github.com/gelowie/nova-chatbot/blob/main/src/json/brain.json): `src/json/brain.json`

### Answer skills

- [Math skill](https://github.com/gelowie/nova-chatbot/blob/main/src/py/math_solver.py): `src/py/math_solver.py`
- [Time and date](https://github.com/gelowie/nova-chatbot/blob/main/src/py/time_reader.py): `src/py/time_reader.py`

### Java demo

- [Java router](https://github.com/gelowie/nova-chatbot/blob/main/src/java/NovaEngine.java): `src/java/NovaEngine.java`
- [Java math](https://github.com/gelowie/nova-chatbot/blob/main/src/java/MathSolver.java): `src/java/MathSolver.java`
- [Java time](https://github.com/gelowie/nova-chatbot/blob/main/src/java/TimeReader.java): `src/java/TimeReader.java`

### Other components

- **User browser**

## Connections

- User browser → Chat page: uses (evidence: `README.md`)
- Chat page → HTTP routes: POST /chat (evidence: `README.md`)
- HTTP routes → Nova engine: calls respond (evidence: `server.py`)
- HTTP routes → JSON brain: configures path (evidence: `server.py`)
- Nova engine → Math skill: tries first (evidence: `src/py/engine.py`)
- Nova engine → Time and date: tries second (evidence: `src/py/engine.py`)
- Nova engine → JSON brain: matches intents (evidence: `README.md`)
- HTTP routes → User browser: returns reply (evidence: `README.md`)
- Java router → Java math: calls first (evidence: `src/java/NovaEngine.java`)
- Java router → Java time: calls second (evidence: `src/java/NovaEngine.java`)
