# ourstorycomic/hou-s-rims architecture

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

- Interactive diagram: https://gitdiagram.com/ourstorycomic/hou-s-rims
- Repository: https://github.com/ourstorycomic/hou-s-rims

## Overview

This Flask application combines a quantitative research-data tool with HOU-S-RIMS, an academic research-management portal. In the analysis workflow, a user uploads a dataset, can clean it, request statistical analysis and charts, and export a report or Power BI connection. The portal separately supports role-based access and student, lecturer, and faculty workflows, including submissions, progress, groups, and chat. The tree and excerpts establish the app’s route registration and selected handlers; links between unsampled domain endpoints and their internal services are omitted where their wiring cannot be verified.

Main entry points: [`static/tool/js/main.js`](https://github.com/ourstorycomic/hou-s-rims/blob/main/static/tool/js/main.js) (Analysis interface), [`models.py`](https://github.com/ourstorycomic/hou-s-rims/blob/main/models.py) (Domain models), [`app.py`](https://github.com/ourstorycomic/hou-s-rims/blob/main/app.py) (Flask application), [`routes/plot.py`](https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/plot.py) (Chart generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_browser["Analysis interface<br/>[main.js]"]
  node_flask["Flask application<br/>[app.py]"]
  node_web_routes["Web pages<br/>[web.py]"]
end

subgraph group_analysis["Data analysis"]
  node_upload["Dataset upload<br/>[upload.py]"]
  node_clean["Data cleaning<br/>[cleaning.py]"]
  node_process["Data processing<br/>[process.py]"]
  node_analysis_routes["Statistical analysis<br/>[analysis.py]"]
  node_statistics["Statistical methods<br/>[statistics.py]"]
  node_plot["Chart generation<br/>[plot.py]"]
  node_chart_engine["Chart engine<br/>[main.py]"]
  node_report["Word reports<br/>[document.py]"]
  node_powerbi["Power BI export<br/>[powerbi.py]"]
  node_assistant["Analysis assistant<br/>[assistant.py]"]
end

subgraph group_academic["Research management"]
  node_api_routes["Portal API"]
  node_portal_routes["Role workflows"]
  node_auth["Web authentication<br/>[auth.py]"]
  node_chat["Messaging<br/>[chat.py]"]
end

subgraph group_persistence["Application state"]
  node_models["Domain models<br/>[models.py]"]
  node_database[("SQLite database<br/>[app.py]")]
end

subgraph group_integrations["External services"]
  node_groq["Groq service"]
end

node_user(("User"))

node_user -->|"uses"| node_browser
node_browser -->|"sends requests"| node_flask
node_flask -->|"dispatches pages"| node_web_routes
node_flask -->|"registers routes"| node_portal_routes
node_flask -->|"registers API"| node_api_routes
node_browser -->|"uploads dataset"| node_upload
node_browser -->|"requests charts"| node_plot
node_browser -->|"requests export"| node_powerbi
node_browser -->|"requests report"| node_report
node_browser -->|"requests cleaning"| node_clean
node_analysis_routes -->|"calculates statistics"| node_statistics
node_plot -->|"generates charts"| node_chart_engine
node_assistant -.->|"requests insights"| node_groq
node_auth -->|"queries users"| node_models
node_chat -->|"reads and writes"| node_models
node_portal_routes -->|"uses domain data"| node_models
node_api_routes -->|"uses domain data"| node_models
node_models -->|"persists records"| node_database

click node_browser "https://github.com/ourstorycomic/hou-s-rims/blob/main/static/tool/js/main.js"
click node_flask "https://github.com/ourstorycomic/hou-s-rims/blob/main/app.py"
click node_web_routes "https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/web.py"
click node_upload "https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/upload.py"
click node_clean "https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/cleaning.py"
click node_process "https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/process.py"
click node_analysis_routes "https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/analysis.py"
click node_statistics "https://github.com/ourstorycomic/hou-s-rims/blob/main/API/statistics.py"
click node_plot "https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/plot.py"
click node_chart_engine "https://github.com/ourstorycomic/hou-s-rims/blob/main/API/main.py"
click node_report "https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/document.py"
click node_powerbi "https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/powerbi.py"
click node_assistant "https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/assistant.py"
click node_api_routes "https://github.com/ourstorycomic/hou-s-rims/tree/main/API/routes"
click node_portal_routes "https://github.com/ourstorycomic/hou-s-rims/tree/main/routes"
click node_auth "https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/auth.py"
click node_chat "https://github.com/ourstorycomic/hou-s-rims/blob/main/API/routes/chat.py"
click node_models "https://github.com/ourstorycomic/hou-s-rims/blob/main/models.py"
click node_database "https://github.com/ourstorycomic/hou-s-rims/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_browser,node_flask,node_web_routes,node_user toneBlue
class node_upload,node_clean,node_process,node_analysis_routes,node_statistics,node_plot,node_chart_engine,node_report,node_powerbi,node_assistant toneAmber
class node_api_routes,node_portal_routes,node_auth,node_chat toneMint
class node_models,node_database toneRose
class node_groq toneIndigo
```

## Components

### Web entry

- [Analysis interface](https://github.com/ourstorycomic/hou-s-rims/blob/main/static/tool/js/main.js): `static/tool/js/main.js`
- [Flask application](https://github.com/ourstorycomic/hou-s-rims/blob/main/app.py): `app.py`
- [Web pages](https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/web.py): `routes/web.py`

### Data analysis

- [Dataset upload](https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/upload.py): `routes/upload.py`
- [Data cleaning](https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/cleaning.py): `routes/cleaning.py`
- [Data processing](https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/process.py): `routes/process.py`
- [Statistical analysis](https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/analysis.py): `routes/analysis.py`
- [Statistical methods](https://github.com/ourstorycomic/hou-s-rims/blob/main/API/statistics.py): `API/statistics.py`
- [Chart generation](https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/plot.py): `routes/plot.py`
- [Chart engine](https://github.com/ourstorycomic/hou-s-rims/blob/main/API/main.py): `API/main.py`
- [Word reports](https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/document.py): `routes/document.py`
- [Power BI export](https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/powerbi.py): `routes/powerbi.py`
- [Analysis assistant](https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/assistant.py): `routes/assistant.py`

### Research management

- [Portal API](https://github.com/ourstorycomic/hou-s-rims/tree/main/API/routes): `API/routes`
- [Role workflows](https://github.com/ourstorycomic/hou-s-rims/tree/main/routes): `routes`
- [Web authentication](https://github.com/ourstorycomic/hou-s-rims/blob/main/routes/auth.py): `routes/auth.py`
- [Messaging](https://github.com/ourstorycomic/hou-s-rims/blob/main/API/routes/chat.py): `API/routes/chat.py`

### Application state

- [Domain models](https://github.com/ourstorycomic/hou-s-rims/blob/main/models.py): `models.py`
- [SQLite database](https://github.com/ourstorycomic/hou-s-rims/blob/main/app.py): `app.py`

### External services

- **Groq service**

### Other components

- **User**

## Connections

- User → Analysis interface: uses
- Analysis interface → Flask application: sends requests
- Flask application → Web pages: dispatches pages
- Flask application → Role workflows: registers routes
- Flask application → Portal API: registers API
- Analysis interface → Dataset upload: uploads dataset
- Analysis interface → Chart generation: requests charts
- Analysis interface → Power BI export: requests export
- Analysis interface → Word reports: requests report
- Analysis interface → Data cleaning: requests cleaning
- Statistical analysis → Statistical methods: calculates statistics
- Chart generation → Chart engine: generates charts
- Analysis assistant → Groq service: requests insights
- Web authentication → Domain models: queries users
- Messaging → Domain models: reads and writes
- Role workflows → Domain models: uses domain data
- Portal API → Domain models: uses domain data
- Domain models → SQLite database: persists records
