# rylena/counseltron architecture

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

- Interactive diagram: https://gitdiagram.com/rylena/counseltron
- Repository: https://github.com/rylena/counseltron

## Overview

Counseltron is a local web-based student counseling app. A student opens the served frontend and can seek academic, emotional, or personal support; the documented model-backed chat flow accepts a message, builds a counselor prompt, invokes Phi through Ollama, filters the reply, and returns JSON. The backend and prompt stages are visible in app.py; the frontend source was not excerpted, so its request behavior and styling connections are not asserted. README documents local processing and Ollama, but no separate storage or additional domain subsystem is shown.

Main entry points: [`app.py`](https://github.com/rylena/counseltron/blob/main/app.py) (Chat endpoint), [`Counseltron/frontend.html`](https://github.com/rylena/counseltron/blob/main/Counseltron/frontend.html) (Counseling interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Web interface"]
  node_frontend["Counseling interface<br/>[frontend.html]"]
  node_styles["Interface styles<br/>[style.css]"]
end

subgraph group_backend["Counseling backend"]
  node_chat["Chat endpoint<br/>[app.py]"]
  node_prompt["Counselor prompt<br/>[app.py]"]
  node_filter["Reply filtering<br/>[app.py]"]
end

subgraph group_model["Language model"]
  node_ollama["Ollama Phi model"]
end

node_student(("Student"))
node_browser(("Browser"))

node_student -->|"uses"| node_browser
node_browser -->|"opens"| node_frontend
node_chat -->|"serves"| node_frontend
node_chat -->|"builds"| node_prompt
node_chat -->|"invokes"| node_ollama
node_chat -->|"filters reply"| node_filter

click node_frontend "https://github.com/rylena/counseltron/blob/main/Counseltron/frontend.html"
click node_styles "https://github.com/rylena/counseltron/blob/main/Counseltron/style.css"
click node_chat "https://github.com/rylena/counseltron/blob/main/app.py"
click node_prompt "https://github.com/rylena/counseltron/blob/main/app.py"
click node_filter "https://github.com/rylena/counseltron/blob/main/app.py"

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_frontend,node_styles,node_browser toneBlue
class node_chat,node_prompt,node_filter toneAmber
class node_ollama toneMint
class node_student toneIndigo
```

## Components

### Web interface

- [Counseling interface](https://github.com/rylena/counseltron/blob/main/Counseltron/frontend.html): `Counseltron/frontend.html`
- [Interface styles](https://github.com/rylena/counseltron/blob/main/Counseltron/style.css): `Counseltron/style.css`

### Counseling backend

- [Chat endpoint](https://github.com/rylena/counseltron/blob/main/app.py): `app.py`
- [Counselor prompt](https://github.com/rylena/counseltron/blob/main/app.py): `app.py`
- [Reply filtering](https://github.com/rylena/counseltron/blob/main/app.py): `app.py`

### Language model

- **Ollama Phi model**

### Other components

- **Student**
- **Browser**

## Connections

- Student → Browser: uses (evidence: `readme.md`)
- Browser → Counseling interface: opens
- Chat endpoint → Counseling interface: serves (evidence: `app.py`)
- Chat endpoint → Counselor prompt: builds (evidence: `app.py`)
- Chat endpoint → Ollama Phi model: invokes (evidence: `app.py`)
- Chat endpoint → Reply filtering: filters reply (evidence: `app.py`)
