# tris860/iga-1 architecture

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

- Interactive diagram: https://gitdiagram.com/tris860/iga-1
- Repository: https://github.com/tris860/iga-1

## Overview

IGA is a Flask-based learning-resource portal with teacher registration and verification, administrator account/content management, and student browsing and PDF viewing. The main workflow is an administrator approves a teacher, the teacher uploads categorized PDF materials, and students browse and stream them. The graph also shows account authentication, profile management, and the catalog-selection endpoint. Relationship evidence is limited to the supplied excerpts and SOURCE INDEX; unsampled routes and templates are not inferred.

Main entry points: [`website/views.py`](https://github.com/tris860/iga-1/blob/main/website/views.py) (Portal routes), [`website/__init__.py`](https://github.com/tris860/iga-1/blob/main/website/__init__.py) (Flask app setup), [`website/auth.py`](https://github.com/tris860/iga-1/blob/main/website/auth.py) (Registration and login), [`website/static/javascript/admin.js`](https://github.com/tris860/iga-1/blob/main/website/static/javascript/admin.js) (Admin dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts and access"]
  node_auth["Registration and login<br/>[auth.py]"]
  node_mailer["Verification email<br/>[mailer.py]"]
  node_user["User records<br/>[models.py]"]
end

subgraph group_content["Learning content"]
  node_files["PDF records<br/>[models.py]"]
end

subgraph group_web["Web application"]
  node_entry["App startup<br/>[main.py]"]
  node_app["Flask app setup<br/>[__init__.py]"]
  node_config["App configuration<br/>[config.py]"]
  node_views["Portal routes<br/>[views.py]"]
  node_database[("SQLite database<br/>[app.db]")]
  node_admin_ui["Admin dashboard<br/>[admin.js]"]
  node_student_ui["Student viewer<br/>[student.js]"]
  node_catalog_ui["Catalog browser<br/>[index.js]"]
  node_auth_ui["Login interface<br/>[script.js]"]
end

node_teacher(("Teacher"))
node_student(("Student"))
node_admin(("Administrator"))

node_teacher -.->|"submits credentials"| node_auth_ui
node_auth_ui -.->|"authenticates"| node_auth
node_entry -->|"creates app"| node_app
node_app -->|"loads settings"| node_config
node_app -->|"registers routes"| node_auth
node_app -->|"registers routes"| node_views
node_app -->|"loads user model"| node_user
node_auth -->|"queries accounts"| node_user
node_auth -->|"updates accounts"| node_database
node_admin -.->|"manages portal"| node_admin_ui
node_admin_ui -.->|"requests management"| node_views
node_views -->|"manages accounts"| node_user
node_views -->|"sends verification"| node_mailer
node_mailer -->|"uses mail service"| node_app
node_views -->|"stores and lists PDFs"| node_files
node_views -.->|"reads and writes"| node_database
node_teacher -.->|"uploads materials"| node_admin_ui
node_student -.->|"browses materials"| node_student_ui
node_student_ui -->|"fetches and streams"| node_views
node_catalog_ui -->|"requests catalog"| node_views

click node_entry "https://github.com/tris860/iga-1/blob/main/main.py"
click node_app "https://github.com/tris860/iga-1/blob/main/website/__init__.py"
click node_config "https://github.com/tris860/iga-1/blob/main/website/config.py"
click node_auth "https://github.com/tris860/iga-1/blob/main/website/auth.py"
click node_views "https://github.com/tris860/iga-1/blob/main/website/views.py"
click node_mailer "https://github.com/tris860/iga-1/blob/main/website/mailer.py"
click node_user "https://github.com/tris860/iga-1/blob/main/website/models.py"
click node_files "https://github.com/tris860/iga-1/blob/main/website/models.py"
click node_database "https://github.com/tris860/iga-1/blob/main/website/app.db"
click node_admin_ui "https://github.com/tris860/iga-1/blob/main/website/static/javascript/admin.js"
click node_student_ui "https://github.com/tris860/iga-1/blob/main/website/static/javascript/student.js"
click node_catalog_ui "https://github.com/tris860/iga-1/blob/main/website/static/javascript/index.js"
click node_auth_ui "https://github.com/tris860/iga-1/blob/main/website/static/javascript/script.js"

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_auth,node_mailer,node_user toneBlue
class node_files toneAmber
class node_entry,node_app,node_config,node_views,node_database,node_admin_ui,node_student_ui,node_catalog_ui,node_auth_ui toneMint
class node_teacher,node_student,node_admin toneIndigo
```

## Components

### Accounts and access

- [Registration and login](https://github.com/tris860/iga-1/blob/main/website/auth.py): `website/auth.py`
- [Verification email](https://github.com/tris860/iga-1/blob/main/website/mailer.py): `website/mailer.py`
- [User records](https://github.com/tris860/iga-1/blob/main/website/models.py): `website/models.py`

### Learning content

- [PDF records](https://github.com/tris860/iga-1/blob/main/website/models.py): `website/models.py`

### Web application

- [App startup](https://github.com/tris860/iga-1/blob/main/main.py): `main.py`
- [Flask app setup](https://github.com/tris860/iga-1/blob/main/website/__init__.py): `website/__init__.py`
- [App configuration](https://github.com/tris860/iga-1/blob/main/website/config.py): `website/config.py`
- [Portal routes](https://github.com/tris860/iga-1/blob/main/website/views.py): `website/views.py`
- [SQLite database](https://github.com/tris860/iga-1/blob/main/website/app.db): `website/app.db`
- [Admin dashboard](https://github.com/tris860/iga-1/blob/main/website/static/javascript/admin.js): `website/static/javascript/admin.js`
- [Student viewer](https://github.com/tris860/iga-1/blob/main/website/static/javascript/student.js): `website/static/javascript/student.js`
- [Catalog browser](https://github.com/tris860/iga-1/blob/main/website/static/javascript/index.js): `website/static/javascript/index.js`
- [Login interface](https://github.com/tris860/iga-1/blob/main/website/static/javascript/script.js): `website/static/javascript/script.js`

### Other components

- **Teacher**
- **Student**
- **Administrator**

## Connections

- Teacher → Login interface: submits credentials
- Login interface → Registration and login: authenticates
- App startup → Flask app setup: creates app (evidence: `main.py`)
- Flask app setup → App configuration: loads settings (evidence: `website/__init__.py`)
- Flask app setup → Registration and login: registers routes (evidence: `website/__init__.py`)
- Flask app setup → Portal routes: registers routes (evidence: `website/__init__.py`)
- Flask app setup → User records: loads user model (evidence: `website/__init__.py`)
- Registration and login → User records: queries accounts (evidence: `website/auth.py`)
- Registration and login → SQLite database: updates accounts (evidence: `website/auth.py`)
- Administrator → Admin dashboard: manages portal
- Admin dashboard → Portal routes: requests management
- Portal routes → User records: manages accounts (evidence: `website/views.py`)
- Portal routes → Verification email: sends verification (evidence: `website/views.py`)
- Verification email → Flask app setup: uses mail service (evidence: `website/mailer.py`)
- Portal routes → PDF records: stores and lists PDFs (evidence: `website/views.py`)
- Portal routes → SQLite database: reads and writes
- Teacher → Admin dashboard: uploads materials
- Student → Student viewer: browses materials
- Student viewer → Portal routes: fetches and streams (evidence: `website/static/javascript/student.js`)
- Catalog browser → Portal routes: requests catalog (evidence: `website/static/javascript/index.js`)
