# ayush7s/fsba architecture

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

- Interactive diagram: https://gitdiagram.com/ayush7s/fsba
- Repository: https://github.com/ayush7s/fsba

## Overview

This is a Flask school portal for public academic information and admin-managed content, with a paid study-material purchase flow. Visitors browse notices, announcements, faculty, and materials; an admin maintains those records. The paid flow selects a material, accepts payment details, records a payment, generates a receipt, and stores it. The sampled routes also show Supabase-backed file storage. Several core utilities and frontend modules were indexed but not excerpted, so their runtime connections are omitted rather than inferred.

Main entry points: [`app.py`](https://github.com/ayush7s/fsba/blob/main/app.py) (Portal routes), [`utils/storage.py`](https://github.com/ayush7s/fsba/blob/main/utils/storage.py) (File storage helper), [`models/paid_material.py`](https://github.com/ayush7s/fsba/blob/main/models/paid_material.py) (Paid material records), [`models/user.py`](https://github.com/ayush7s/fsba/blob/main/models/user.py) (User records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["School portal"]
  node_flask["Portal routes<br/>[app.py]"]
  node_authentication["Admin authentication<br/>[app.py]"]
  node_user_model[("User records<br/>[user.py]")]
  node_gallery["3D gallery<br/>[3d-gallery.js]"]
end

subgraph group_content["Academic content"]
  node_notices["Notices<br/>[app.py]"]
  node_notice_model[("Notice records<br/>[notice.py]")]
  node_announcements["Announcements<br/>[app.py]"]
  node_announcement_model[("Announcement records<br/>[announcement.py]")]
  node_study_materials["Study materials<br/>[app.py]"]
  node_study_model[("Study material records<br/>[study_material.py]")]
  node_faculty["Faculty directory<br/>[app.py]"]
  node_faculty_model[("Faculty records<br/>[faculty.py]")]
end

subgraph group_commerce["Paid materials"]
  node_paid_catalog["Paid catalog<br/>[app.py]"]
  node_paid_model[("Paid material records<br/>[paid_material.py]")]
  node_payment_flow["Payment submission<br/>[app.py]"]
  node_payment_model[("Payment records<br/>[payment.py]")]
end

subgraph group_services["Storage and utilities"]
  node_sql_store[("SQL database")]
  node_storage["File storage helper<br/>[storage.py]"]
  node_supabase_client["Supabase client<br/>[supabase_client.py]"]
  node_receipt["Receipt generator<br/>[receipt.py]"]
  node_email["Email service<br/>[email_service.py]"]
  node_qr["QR generator<br/>[qr_generator.py]"]
end

node_visitor(("Visitor"))
node_admin(("Administrator"))
node_supabase[("Supabase Storage")]

node_visitor -->|"opens portal"| node_flask
node_admin -->|"signs in"| node_authentication
node_authentication -->|"checks credentials"| node_user_model
node_flask -->|"routes requests"| node_notices
node_notices -->|"queries records"| node_notice_model
node_flask -->|"routes requests"| node_announcements
node_announcements -->|"queries records"| node_announcement_model
node_flask -->|"routes requests"| node_study_materials
node_study_materials -->|"queries records"| node_study_model
node_flask -->|"routes requests"| node_faculty
node_faculty -->|"queries records"| node_faculty_model
node_flask -->|"routes requests"| node_paid_catalog
node_paid_catalog -->|"filters records"| node_paid_model
node_flask -->|"routes submission"| node_payment_flow
node_payment_flow -->|"loads material"| node_paid_model
node_payment_flow -->|"records payment"| node_payment_model
node_payment_flow -->|"generates receipt"| node_receipt
node_payment_flow -->|"uploads receipt"| node_storage
node_flask -->|"manages uploads"| node_storage
node_storage -->|"gets client"| node_supabase_client
node_supabase_client -.->|"creates client"| node_supabase
node_storage -->|"reads and writes files"| node_supabase
node_notice_model -.->|"persists records"| node_sql_store
node_announcement_model -.->|"persists records"| node_sql_store
node_study_model -.->|"persists records"| node_sql_store
node_faculty_model -.->|"persists records"| node_sql_store
node_paid_model -.->|"persists records"| node_sql_store
node_payment_model -.->|"persists records"| node_sql_store
node_user_model -.->|"persists records"| node_sql_store

click node_flask "https://github.com/ayush7s/fsba/blob/main/app.py"
click node_authentication "https://github.com/ayush7s/fsba/blob/main/app.py"
click node_notices "https://github.com/ayush7s/fsba/blob/main/app.py"
click node_notice_model "https://github.com/ayush7s/fsba/blob/main/models/notice.py"
click node_announcements "https://github.com/ayush7s/fsba/blob/main/app.py"
click node_announcement_model "https://github.com/ayush7s/fsba/blob/main/models/announcement.py"
click node_study_materials "https://github.com/ayush7s/fsba/blob/main/app.py"
click node_study_model "https://github.com/ayush7s/fsba/blob/main/models/study_material.py"
click node_faculty "https://github.com/ayush7s/fsba/blob/main/app.py"
click node_faculty_model "https://github.com/ayush7s/fsba/blob/main/models/faculty.py"
click node_paid_catalog "https://github.com/ayush7s/fsba/blob/main/app.py"
click node_paid_model "https://github.com/ayush7s/fsba/blob/main/models/paid_material.py"
click node_payment_flow "https://github.com/ayush7s/fsba/blob/main/app.py"
click node_payment_model "https://github.com/ayush7s/fsba/blob/main/models/payment.py"
click node_user_model "https://github.com/ayush7s/fsba/blob/main/models/user.py"
click node_storage "https://github.com/ayush7s/fsba/blob/main/utils/storage.py"
click node_supabase_client "https://github.com/ayush7s/fsba/blob/main/utils/supabase_client.py"
click node_receipt "https://github.com/ayush7s/fsba/blob/main/utils/receipt.py"
click node_email "https://github.com/ayush7s/fsba/blob/main/utils/email_service.py"
click node_qr "https://github.com/ayush7s/fsba/blob/main/utils/qr_generator.py"
click node_gallery "https://github.com/ayush7s/fsba/blob/main/static/js/3d-gallery.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_flask,node_authentication,node_user_model,node_gallery toneBlue
class node_notices,node_notice_model,node_announcements,node_announcement_model,node_study_materials,node_study_model,node_faculty,node_faculty_model,node_supabase toneAmber
class node_paid_catalog,node_paid_model,node_payment_flow,node_payment_model toneMint
class node_sql_store,node_storage,node_supabase_client,node_receipt,node_email,node_qr toneRose
class node_visitor,node_admin toneIndigo
```

## Components

### School portal

- [Portal routes](https://github.com/ayush7s/fsba/blob/main/app.py): `app.py`
- [Admin authentication](https://github.com/ayush7s/fsba/blob/main/app.py): `app.py`
- [User records](https://github.com/ayush7s/fsba/blob/main/models/user.py): `models/user.py`
- [3D gallery](https://github.com/ayush7s/fsba/blob/main/static/js/3d-gallery.js): `static/js/3d-gallery.js`

### Academic content

- [Notices](https://github.com/ayush7s/fsba/blob/main/app.py): `app.py`
- [Notice records](https://github.com/ayush7s/fsba/blob/main/models/notice.py): `models/notice.py`
- [Announcements](https://github.com/ayush7s/fsba/blob/main/app.py): `app.py`
- [Announcement records](https://github.com/ayush7s/fsba/blob/main/models/announcement.py): `models/announcement.py`
- [Study materials](https://github.com/ayush7s/fsba/blob/main/app.py): `app.py`
- [Study material records](https://github.com/ayush7s/fsba/blob/main/models/study_material.py): `models/study_material.py`
- [Faculty directory](https://github.com/ayush7s/fsba/blob/main/app.py): `app.py`
- [Faculty records](https://github.com/ayush7s/fsba/blob/main/models/faculty.py): `models/faculty.py`

### Paid materials

- [Paid catalog](https://github.com/ayush7s/fsba/blob/main/app.py): `app.py`
- [Paid material records](https://github.com/ayush7s/fsba/blob/main/models/paid_material.py): `models/paid_material.py`
- [Payment submission](https://github.com/ayush7s/fsba/blob/main/app.py): `app.py`
- [Payment records](https://github.com/ayush7s/fsba/blob/main/models/payment.py): `models/payment.py`

### Storage and utilities

- **SQL database**
- [File storage helper](https://github.com/ayush7s/fsba/blob/main/utils/storage.py): `utils/storage.py`
- [Supabase client](https://github.com/ayush7s/fsba/blob/main/utils/supabase_client.py): `utils/supabase_client.py`
- [Receipt generator](https://github.com/ayush7s/fsba/blob/main/utils/receipt.py): `utils/receipt.py`
- [Email service](https://github.com/ayush7s/fsba/blob/main/utils/email_service.py): `utils/email_service.py`
- [QR generator](https://github.com/ayush7s/fsba/blob/main/utils/qr_generator.py): `utils/qr_generator.py`

### Other components

- **Visitor**
- **Administrator**
- **Supabase Storage**

## Connections

- Visitor → Portal routes: opens portal (evidence: `app.py`)
- Administrator → Admin authentication: signs in (evidence: `app.py`)
- Admin authentication → User records: checks credentials (evidence: `app.py`)
- Portal routes → Notices: routes requests (evidence: `app.py`)
- Notices → Notice records: queries records (evidence: `app.py`)
- Portal routes → Announcements: routes requests (evidence: `app.py`)
- Announcements → Announcement records: queries records (evidence: `app.py`)
- Portal routes → Study materials: routes requests (evidence: `app.py`)
- Study materials → Study material records: queries records (evidence: `app.py`)
- Portal routes → Faculty directory: routes requests (evidence: `app.py`)
- Faculty directory → Faculty records: queries records (evidence: `app.py`)
- Portal routes → Paid catalog: routes requests (evidence: `app.py`)
- Paid catalog → Paid material records: filters records (evidence: `app.py`)
- Portal routes → Payment submission: routes submission (evidence: `app.py`)
- Payment submission → Paid material records: loads material (evidence: `app.py`)
- Payment submission → Payment records: records payment (evidence: `app.py`)
- Payment submission → Receipt generator: generates receipt (evidence: `app.py`)
- Payment submission → File storage helper: uploads receipt (evidence: `app.py`)
- Portal routes → File storage helper: manages uploads (evidence: `app.py`)
- File storage helper → Supabase client: gets client (evidence: `utils/storage.py`)
- Supabase client → Supabase Storage: creates client
- File storage helper → Supabase Storage: reads and writes files (evidence: `utils/storage.py`)
- Notice records → SQL database: persists records
- Announcement records → SQL database: persists records
- Study material records → SQL database: persists records
- Faculty records → SQL database: persists records
- Paid material records → SQL database: persists records
- Payment records → SQL database: persists records
- User records → SQL database: persists records
