# ice2023-zx/eastc_portal_test architecture

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

- Interactive diagram: https://gitdiagram.com/ice2023-zx/eastc_portal_test
- Repository: https://github.com/ice2023-zx/eastc_portal_test

## Overview

EASTC is a browser-based lecture-notes portal: visitors can browse courses, students can search and download notes, lecturers can upload and manage PDF notes, and administrators can manage courses and lecturer accounts. The main flow is role selection and sign-in (students continue without signing in), followed by role-specific dashboard actions against Supabase. The graph captures the sampled JavaScript and documented page transitions; the README is empty, and unsampled page markup and other wiring are not inferred.

Main entry points: [`login.js`](https://github.com/ice2023-zx/eastc_portal_test/blob/main/login.js) (Role-based login), [`lecturer-dashboard.js`](https://github.com/ice2023-zx/eastc_portal_test/blob/main/lecturer-dashboard.js) (Lecturer dashboard), [`admin-dashboard.js`](https://github.com/ice2023-zx/eastc_portal_test/blob/main/admin-dashboard.js) (Admin dashboard), [`student-dashboard.js`](https://github.com/ice2023-zx/eastc_portal_test/blob/main/student-dashboard.js) (Student notes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and discovery"]
  node_login["Role-based login<br/>[login.js]"]
  node_home["Course landing<br/>[home.js]"]
  node_account["Password update<br/>[account.js]"]
end

subgraph group_learning["Learning and teaching"]
  node_student["Student notes"]
  node_lecturer["Lecturer dashboard"]
end

subgraph group_administration["Administration"]
  node_admin["Admin dashboard<br/>[admin-dashboard.js]"]
end

subgraph group_backend["Supabase services"]
  node_client["Supabase client setup<br/>[supabase-config.js]"]
  node_auth{{"Supabase Auth"}}
  node_database[("Supabase database")]
  node_storage[("Supabase Storage")]
  node_functions{{"Supabase Edge Functions"}}
end

node_visitor(("Visitor / user"))

node_visitor -->|"chooses role"| node_login
node_visitor -->|"browses courses"| node_home
node_login -->|"signs in"| node_auth
node_login -->|"checks profile role"| node_database
node_login -->|"routes admin"| node_admin
node_login -->|"routes lecturer"| node_lecturer
node_login -->|"routes student"| node_student
node_home -->|"reads courses"| node_database
node_home -->|"opens notes"| node_student
node_student -->|"reads courses and notes"| node_database
node_student -->|"downloads PDFs"| node_storage
node_lecturer -->|"checks user"| node_auth
node_lecturer -->|"reads and writes notes"| node_database
node_lecturer -->|"uploads and removes PDFs"| node_storage
node_lecturer -->|"creates signed link"| node_storage
node_admin -->|"checks session"| node_auth
node_admin -->|"manages courses and profiles"| node_database
node_admin -->|"reads note counts"| node_database
node_admin -->|"invokes lecturer actions"| node_functions
node_account -->|"updates password"| node_auth
node_client -->|"configures client"| node_auth
node_client -->|"configures client"| node_database
node_client -->|"configures client"| node_storage

click node_login "https://github.com/ice2023-zx/eastc_portal_test/blob/main/login.js"
click node_home "https://github.com/ice2023-zx/eastc_portal_test/blob/main/home.js"
click node_student "https://github.com/ice2023-zx/eastc_portal_test/blob/main/student-dashboard.js"
click node_lecturer "https://github.com/ice2023-zx/eastc_portal_test/blob/main/lecturer-dashboard.js"
click node_account "https://github.com/ice2023-zx/eastc_portal_test/blob/main/account.js"
click node_admin "https://github.com/ice2023-zx/eastc_portal_test/blob/main/admin-dashboard.js"
click node_client "https://github.com/ice2023-zx/eastc_portal_test/blob/main/supabase-config.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_login,node_home,node_account,node_visitor toneBlue
class node_student,node_lecturer toneAmber
class node_admin toneMint
class node_client,node_auth,node_database,node_storage,node_functions toneRose
```

## Components

### Access and discovery

- [Role-based login](https://github.com/ice2023-zx/eastc_portal_test/blob/main/login.js): `login.js`
- [Course landing](https://github.com/ice2023-zx/eastc_portal_test/blob/main/home.js): `home.js`
- [Password update](https://github.com/ice2023-zx/eastc_portal_test/blob/main/account.js): `account.js`

### Learning and teaching

- [Student notes](https://github.com/ice2023-zx/eastc_portal_test/blob/main/student-dashboard.js): `student-dashboard.js`
- [Lecturer dashboard](https://github.com/ice2023-zx/eastc_portal_test/blob/main/lecturer-dashboard.js): `lecturer-dashboard.js`

### Administration

- [Admin dashboard](https://github.com/ice2023-zx/eastc_portal_test/blob/main/admin-dashboard.js): `admin-dashboard.js`

### Supabase services

- [Supabase client setup](https://github.com/ice2023-zx/eastc_portal_test/blob/main/supabase-config.js): `supabase-config.js`
- **Supabase Auth**
- **Supabase database**
- **Supabase Storage**
- **Supabase Edge Functions**

### Other components

- **Visitor / user**

## Connections

- Visitor / user → Role-based login: chooses role (evidence: `login.js`)
- Visitor / user → Course landing: browses courses (evidence: `home.js`)
- Role-based login → Supabase Auth: signs in (evidence: `login.js`)
- Role-based login → Supabase database: checks profile role (evidence: `login.js`)
- Role-based login → Admin dashboard: routes admin (evidence: `login.js`)
- Role-based login → Lecturer dashboard: routes lecturer (evidence: `login.js`)
- Role-based login → Student notes: routes student (evidence: `login.js`)
- Course landing → Supabase database: reads courses (evidence: `home.js`)
- Course landing → Student notes: opens notes (evidence: `home.js`)
- Student notes → Supabase database: reads courses and notes (evidence: `student-dashboard.js`)
- Student notes → Supabase Storage: downloads PDFs (evidence: `student-dashboard.js`)
- Lecturer dashboard → Supabase Auth: checks user (evidence: `lecturer-dashboard.js`)
- Lecturer dashboard → Supabase database: reads and writes notes (evidence: `lecturer-dashboard.js`)
- Lecturer dashboard → Supabase Storage: uploads and removes PDFs (evidence: `lecturer-dashboard.js`)
- Lecturer dashboard → Supabase Storage: creates signed link (evidence: `lecturer-dashboard.js`)
- Admin dashboard → Supabase Auth: checks session (evidence: `admin-dashboard.js`)
- Admin dashboard → Supabase database: manages courses and profiles (evidence: `admin-dashboard.js`)
- Admin dashboard → Supabase database: reads note counts (evidence: `admin-dashboard.js`)
- Admin dashboard → Supabase Edge Functions: invokes lecturer actions (evidence: `admin-dashboard.js`)
- Password update → Supabase Auth: updates password (evidence: `account.js`)
- Supabase client setup → Supabase Auth: configures client (evidence: `supabase-config.js`)
- Supabase client setup → Supabase database: configures client (evidence: `supabase-config.js`)
- Supabase client setup → Supabase Storage: configures client (evidence: `supabase-config.js`)
