# kikoyummy115-tech/healthlit architecture

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

- Interactive diagram: https://gitdiagram.com/kikoyummy115-tech/healthlit
- Repository: https://github.com/kikoyummy115-tech/healthlit

## Overview

Healthlit is a Flask application combining event and zone management with a health-advice expert system and account authentication. The main user workflow is to submit a health question, have the API save it and retrieve ranked matching knowledge, then receive recommendations; users can also register or log in and browse or manage events. The graph follows the shown app setup, route-to-model calls, and expert matching. The README provides no usable capability details, and UI wiring is not established by the sampled JavaScript, so those connections are omitted.

Main entry points: [`app/__init__.py`](https://github.com/kikoyummy115-tech/healthlit/blob/main/app/__init__.py) (Flask app factory), [`app/routes/main.py`](https://github.com/kikoyummy115-tech/healthlit/blob/main/app/routes/main.py) (Event routes), [`app/routes/chatbot.py`](https://github.com/kikoyummy115-tech/healthlit/blob/main/app/routes/chatbot.py) (Expert API), [`app/routes/auth.py`](https://github.com/kikoyummy115-tech/healthlit/blob/main/app/routes/auth.py) (Auth routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Application setup"]
  node_launcher["App launcher<br/>[run.py]"]
  node_factory["Flask app factory<br/>[__init__.py]"]
  node_settings["App settings<br/>[config.py]"]
  node_extensions["Flask extensions<br/>[extension.py]"]
end

subgraph group_accounts["Accounts"]
  node_auth_routes["Auth routes<br/>[auth.py]"]
  node_user_model[("User accounts<br/>[user.py]")]
end

subgraph group_events["Events"]
  node_event_routes["Event routes<br/>[main.py]"]
  node_event_models[("Events and zones<br/>[event.py]")]
  node_cloudinary["Cloudinary media"]
end

subgraph group_health["Health advice"]
  node_chat_routes["Expert API<br/>[chatbot.py]"]
  node_expert_engine["Knowledge matching<br/>[expert_engine.py]"]
  node_expert_models[("Health knowledge<br/>[expert_model.py]")]
  node_knowledge_seed["Knowledge seeding<br/>[seed_knowledge.py]"]
  node_chat_ui["Chat interface script<br/>[chatbot.js]"]
  node_expert_ui["Expert interface script<br/>[expert.js]"]
  node_chat_page["AI chat page<br/>[ai_chat.html]"]
end

node_visitor(("Web user"))

node_launcher -->|"creates app"| node_factory
node_factory -->|"loads settings"| node_settings
node_factory -->|"initializes"| node_extensions
node_factory -->|"registers routes"| node_auth_routes
node_factory -->|"registers routes"| node_event_routes
node_factory -->|"imports routes"| node_chat_routes
node_visitor -->|"submits credentials"| node_auth_routes
node_auth_routes -->|"queries and saves"| node_user_model
node_visitor -->|"requests events"| node_event_routes
node_event_routes -->|"reads and writes"| node_event_models
node_event_routes -->|"uploads and deletes"| node_cloudinary
node_visitor -->|"asks question"| node_chat_routes
node_chat_routes -->|"stores question"| node_expert_models
node_chat_routes -->|"requests matches"| node_expert_engine
node_expert_engine -->|"queries knowledge"| node_expert_models
node_knowledge_seed -->|"seeds knowledge"| node_expert_models
node_knowledge_seed -->|"uses database"| node_extensions

click node_launcher "https://github.com/kikoyummy115-tech/healthlit/blob/main/run.py"
click node_factory "https://github.com/kikoyummy115-tech/healthlit/blob/main/app/__init__.py"
click node_settings "https://github.com/kikoyummy115-tech/healthlit/blob/main/config.py"
click node_extensions "https://github.com/kikoyummy115-tech/healthlit/blob/main/extension.py"
click node_auth_routes "https://github.com/kikoyummy115-tech/healthlit/blob/main/app/routes/auth.py"
click node_user_model "https://github.com/kikoyummy115-tech/healthlit/blob/main/app/models/user.py"
click node_event_routes "https://github.com/kikoyummy115-tech/healthlit/blob/main/app/routes/main.py"
click node_event_models "https://github.com/kikoyummy115-tech/healthlit/blob/main/app/models/event.py"
click node_chat_routes "https://github.com/kikoyummy115-tech/healthlit/blob/main/app/routes/chatbot.py"
click node_expert_engine "https://github.com/kikoyummy115-tech/healthlit/blob/main/app/services/expert_engine.py"
click node_expert_models "https://github.com/kikoyummy115-tech/healthlit/blob/main/app/models/expert_model.py"
click node_knowledge_seed "https://github.com/kikoyummy115-tech/healthlit/blob/main/seed_knowledge.py"
click node_chat_ui "https://github.com/kikoyummy115-tech/healthlit/blob/main/app/static/js/chatbot.js"
click node_expert_ui "https://github.com/kikoyummy115-tech/healthlit/blob/main/app/static/js/expert.js"
click node_chat_page "https://github.com/kikoyummy115-tech/healthlit/blob/main/app/templates/tools/ai_chat.html"

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_launcher,node_factory,node_settings,node_extensions,node_visitor toneBlue
class node_auth_routes,node_user_model toneAmber
class node_event_routes,node_event_models,node_cloudinary toneMint
class node_chat_routes,node_expert_engine,node_expert_models,node_knowledge_seed,node_chat_ui,node_expert_ui,node_chat_page toneRose
```

## Components

### Application setup

- [App launcher](https://github.com/kikoyummy115-tech/healthlit/blob/main/run.py): `run.py`
- [Flask app factory](https://github.com/kikoyummy115-tech/healthlit/blob/main/app/__init__.py): `app/__init__.py`
- [App settings](https://github.com/kikoyummy115-tech/healthlit/blob/main/config.py): `config.py`
- [Flask extensions](https://github.com/kikoyummy115-tech/healthlit/blob/main/extension.py): `extension.py`

### Accounts

- [Auth routes](https://github.com/kikoyummy115-tech/healthlit/blob/main/app/routes/auth.py): `app/routes/auth.py`
- [User accounts](https://github.com/kikoyummy115-tech/healthlit/blob/main/app/models/user.py): `app/models/user.py`

### Events

- [Event routes](https://github.com/kikoyummy115-tech/healthlit/blob/main/app/routes/main.py): `app/routes/main.py`
- [Events and zones](https://github.com/kikoyummy115-tech/healthlit/blob/main/app/models/event.py): `app/models/event.py`
- **Cloudinary media**

### Health advice

- [Expert API](https://github.com/kikoyummy115-tech/healthlit/blob/main/app/routes/chatbot.py): `app/routes/chatbot.py`
- [Knowledge matching](https://github.com/kikoyummy115-tech/healthlit/blob/main/app/services/expert_engine.py): `app/services/expert_engine.py`
- [Health knowledge](https://github.com/kikoyummy115-tech/healthlit/blob/main/app/models/expert_model.py): `app/models/expert_model.py`
- [Knowledge seeding](https://github.com/kikoyummy115-tech/healthlit/blob/main/seed_knowledge.py): `seed_knowledge.py`
- [Chat interface script](https://github.com/kikoyummy115-tech/healthlit/blob/main/app/static/js/chatbot.js): `app/static/js/chatbot.js`
- [Expert interface script](https://github.com/kikoyummy115-tech/healthlit/blob/main/app/static/js/expert.js): `app/static/js/expert.js`
- [AI chat page](https://github.com/kikoyummy115-tech/healthlit/blob/main/app/templates/tools/ai_chat.html): `app/templates/tools/ai_chat.html`

### Other components

- **Web user**

## Connections

- App launcher → Flask app factory: creates app (evidence: `run.py`)
- Flask app factory → App settings: loads settings (evidence: `app/__init__.py`)
- Flask app factory → Flask extensions: initializes (evidence: `app/__init__.py`)
- Flask app factory → Auth routes: registers routes (evidence: `app/__init__.py`)
- Flask app factory → Event routes: registers routes (evidence: `app/__init__.py`)
- Flask app factory → Expert API: imports routes (evidence: `app/__init__.py`)
- Web user → Auth routes: submits credentials (evidence: `app/routes/auth.py`)
- Auth routes → User accounts: queries and saves (evidence: `app/routes/auth.py`)
- Web user → Event routes: requests events (evidence: `app/routes/main.py`)
- Event routes → Events and zones: reads and writes (evidence: `app/routes/main.py`)
- Event routes → Cloudinary media: uploads and deletes (evidence: `app/routes/main.py`)
- Web user → Expert API: asks question (evidence: `app/routes/chatbot.py`)
- Expert API → Health knowledge: stores question (evidence: `app/routes/chatbot.py`)
- Expert API → Knowledge matching: requests matches (evidence: `app/routes/chatbot.py`)
- Knowledge matching → Health knowledge: queries knowledge (evidence: `app/services/expert_engine.py`)
- Knowledge seeding → Health knowledge: seeds knowledge (evidence: `seed_knowledge.py`)
- Knowledge seeding → Flask extensions: uses database (evidence: `seed_knowledge.py`)
