# ilavoga/kabu-cs-hub architecture

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

- Interactive diagram: https://gitdiagram.com/ilavoga/kabu-cs-hub
- Repository: https://github.com/ilavoga/kabu-cs-hub

## Overview

This Flask application is an academic resource hub: visitors browse course materials by semester and download notes or past papers, while authorized users upload those resources. It also provides contact email, news, and useful-links pages. The sampled app.py shows database-backed resource handling and SMTP contact delivery; template details and the wiring of the bundled PDFs were not inspected, so those are not modeled as runtime dependencies.

Main entry points: [`app.py`](https://github.com/ilavoga/kabu-cs-hub/blob/main/app.py) (Flask routes), [`templates/sem1-1.html`](https://github.com/ilavoga/kabu-cs-hub/blob/main/templates/sem1-1.html) (Semester pages), [`templates/check.html`](https://github.com/ilavoga/kabu-cs-hub/blob/main/templates/check.html) (News page), [`templates/useful_links.html`](https://github.com/ilavoga/kabu-cs-hub/blob/main/templates/useful_links.html) (Useful links)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_flask_app["Flask routes<br/>[app.py]"]
  node_semester_pages["Semester pages<br/>[sem1-1.html]"]
  node_news_page["News page<br/>[check.html]"]
  node_links_page["Useful links<br/>[useful_links.html]"]
  node_contact_page["Contact page<br/>[contact.html]"]
end

subgraph group_resources["Study resources"]
  node_notes_catalog["Notes catalog<br/>[app.py]"]
  node_papers_catalog["Papers catalog<br/>[app.py]"]
  node_download_handler["PDF downloads<br/>[app.py]"]
  node_mysql[("MySQL database")]
end

subgraph group_admin["Resource administration"]
  node_admin_auth["Admin authorization<br/>[app.py]"]
  node_notes_upload["Notes upload<br/>[app.py]"]
  node_papers_upload["Papers upload<br/>[app.py]"]
  node_admin_templates["Admin forms<br/>[validate.html]"]
end

subgraph group_communications["Communications"]
  node_contact_handler["Contact submission<br/>[app.py]"]
  node_response_template["Mail response<br/>[response.html]"]
  node_smtp["SMTP mail service"]
end

node_visitor(("Visitor"))
node_admin_user(("Administrator"))

node_visitor -->|"requests pages"| node_flask_app
node_flask_app -->|"renders semester"| node_semester_pages
node_flask_app -->|"renders news"| node_news_page
node_flask_app -->|"renders links"| node_links_page
node_flask_app -->|"renders contact"| node_contact_page
node_flask_app -->|"dispatches"| node_notes_catalog
node_flask_app -->|"dispatches"| node_papers_catalog
node_notes_catalog -->|"queries notes"| node_mysql
node_papers_catalog -->|"queries papers"| node_mysql
node_flask_app -->|"dispatches"| node_download_handler
node_download_handler -->|"reads PDF"| node_mysql
node_download_handler -->|"returns PDF"| node_visitor
node_admin_user -->|"submits forms"| node_flask_app
node_flask_app -->|"renders forms"| node_admin_templates
node_flask_app -->|"dispatches"| node_admin_auth
node_admin_auth -->|"checks credentials"| node_mysql
node_flask_app -->|"dispatches"| node_notes_upload
node_notes_upload -->|"inserts notes"| node_mysql
node_flask_app -->|"dispatches"| node_papers_upload
node_papers_upload -->|"inserts papers"| node_mysql
node_flask_app -->|"dispatches"| node_contact_handler
node_contact_handler -->|"renders email body"| node_response_template
node_contact_handler -->|"sends message"| node_smtp

click node_flask_app "https://github.com/ilavoga/kabu-cs-hub/blob/main/app.py"
click node_semester_pages "https://github.com/ilavoga/kabu-cs-hub/blob/main/templates/sem1-1.html"
click node_news_page "https://github.com/ilavoga/kabu-cs-hub/blob/main/templates/check.html"
click node_links_page "https://github.com/ilavoga/kabu-cs-hub/blob/main/templates/useful_links.html"
click node_contact_page "https://github.com/ilavoga/kabu-cs-hub/blob/main/templates/contact.html"
click node_notes_catalog "https://github.com/ilavoga/kabu-cs-hub/blob/main/app.py"
click node_papers_catalog "https://github.com/ilavoga/kabu-cs-hub/blob/main/app.py"
click node_download_handler "https://github.com/ilavoga/kabu-cs-hub/blob/main/app.py"
click node_admin_auth "https://github.com/ilavoga/kabu-cs-hub/blob/main/app.py"
click node_notes_upload "https://github.com/ilavoga/kabu-cs-hub/blob/main/app.py"
click node_papers_upload "https://github.com/ilavoga/kabu-cs-hub/blob/main/app.py"
click node_admin_templates "https://github.com/ilavoga/kabu-cs-hub/blob/main/templates/validate.html"
click node_contact_handler "https://github.com/ilavoga/kabu-cs-hub/blob/main/app.py"
click node_response_template "https://github.com/ilavoga/kabu-cs-hub/blob/main/templates/response.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_flask_app,node_semester_pages,node_news_page,node_links_page,node_contact_page toneBlue
class node_notes_catalog,node_papers_catalog,node_download_handler,node_mysql toneAmber
class node_admin_auth,node_notes_upload,node_papers_upload,node_admin_templates toneMint
class node_contact_handler,node_response_template,node_smtp toneRose
class node_visitor,node_admin_user toneIndigo
```

## Components

### Web experience

- [Flask routes](https://github.com/ilavoga/kabu-cs-hub/blob/main/app.py): `app.py`
- [Semester pages](https://github.com/ilavoga/kabu-cs-hub/blob/main/templates/sem1-1.html): `templates/sem1-1.html`
- [News page](https://github.com/ilavoga/kabu-cs-hub/blob/main/templates/check.html): `templates/check.html`
- [Useful links](https://github.com/ilavoga/kabu-cs-hub/blob/main/templates/useful_links.html): `templates/useful_links.html`
- [Contact page](https://github.com/ilavoga/kabu-cs-hub/blob/main/templates/contact.html): `templates/contact.html`

### Study resources

- [Notes catalog](https://github.com/ilavoga/kabu-cs-hub/blob/main/app.py): `app.py`
- [Papers catalog](https://github.com/ilavoga/kabu-cs-hub/blob/main/app.py): `app.py`
- [PDF downloads](https://github.com/ilavoga/kabu-cs-hub/blob/main/app.py): `app.py`
- **MySQL database**

### Resource administration

- [Admin authorization](https://github.com/ilavoga/kabu-cs-hub/blob/main/app.py): `app.py`
- [Notes upload](https://github.com/ilavoga/kabu-cs-hub/blob/main/app.py): `app.py`
- [Papers upload](https://github.com/ilavoga/kabu-cs-hub/blob/main/app.py): `app.py`
- [Admin forms](https://github.com/ilavoga/kabu-cs-hub/blob/main/templates/validate.html): `templates/validate.html`

### Communications

- [Contact submission](https://github.com/ilavoga/kabu-cs-hub/blob/main/app.py): `app.py`
- [Mail response](https://github.com/ilavoga/kabu-cs-hub/blob/main/templates/response.html): `templates/response.html`
- **SMTP mail service**

### Other components

- **Visitor**
- **Administrator**

## Connections

- Visitor → Flask routes: requests pages
- Flask routes → Semester pages: renders semester
- Flask routes → News page: renders news
- Flask routes → Useful links: renders links
- Flask routes → Contact page: renders contact
- Flask routes → Notes catalog: dispatches
- Flask routes → Papers catalog: dispatches
- Notes catalog → MySQL database: queries notes
- Papers catalog → MySQL database: queries papers
- Flask routes → PDF downloads: dispatches
- PDF downloads → MySQL database: reads PDF
- PDF downloads → Visitor: returns PDF
- Administrator → Flask routes: submits forms
- Flask routes → Admin forms: renders forms
- Flask routes → Admin authorization: dispatches
- Admin authorization → MySQL database: checks credentials
- Flask routes → Notes upload: dispatches
- Notes upload → MySQL database: inserts notes
- Flask routes → Papers upload: dispatches
- Papers upload → MySQL database: inserts papers
- Flask routes → Contact submission: dispatches
- Contact submission → Mail response: renders email body
- Contact submission → SMTP mail service: sends message
