# giancbaring/sslg architecture

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

- Interactive diagram: https://gitdiagram.com/giancbaring/sslg
- Repository: https://github.com/giancbaring/sslg

## Overview

The repository is a school learner-government portal for account access and governance information, including dashboards, officers, documents, events, news, projects, and treasury pages. The visible account flow includes login, optional email binding, profile updates, and admin account creation. Source excerpts confirm several client API calls and the app’s explicit routes; wiring for other listed pages and backend endpoints is not shown, so those relationships are left out.

Main entry points: [`governance-portal/src/App.tsx`](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/App.tsx) (Application routes), [`governance-portal/src/main.tsx`](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/main.tsx) (Client entry), [`governance-portal/src/pages/LoginPage.tsx`](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/LoginPage.tsx) (Login page), [`governance-portal/src/pages/BindEmailPage.tsx`](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/BindEmailPage.tsx) (Email binding page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Portal client"]
  node_entry["Client entry<br/>[main.tsx]"]
  node_router["Application routes<br/>[App.tsx]"]
end

subgraph group_governance["Governance information"]
  node_home["Home and news<br/>[HomePage.tsx]"]
  node_dashboard["Dashboard<br/>[DashboardPage.tsx]"]
  node_officers["Officers<br/>[OfficersPage.tsx]"]
  node_documents["Documents<br/>[DocumentsPage.tsx]"]
  node_events["Events<br/>[EventsPage.tsx]"]
  node_news["News<br/>[NewsPage.tsx]"]
  node_projects["Projects<br/>[ProjectsPage.tsx]"]
  node_treasury["Treasury<br/>[TreasuryPage.tsx]"]
  node_admin["Admin dashboard"]
end

subgraph group_accounts["Account services"]
  node_login["Login page<br/>[LoginPage.tsx]"]
  node_bindpage["Email binding page<br/>[BindEmailPage.tsx]"]
  node_profile["Profile page<br/>[ProfilePage.tsx]"]
  node_createform["Create-user form<br/>[CreateUserForm.tsx]"]
  node_profileform["Profile form<br/>[ProfileForm.tsx]"]
end

subgraph group_api["API handlers"]
  node_loginapi["Login handler<br/>[login.js]"]
  node_bindapi["Email binding handler<br/>[bind-email.js]"]
  node_createapi["User creation handler<br/>[create-user.js]"]
  node_profileapi["Profile update handler<br/>[update-profile.js]"]
  node_auth["Authentication middleware<br/>[authMiddleware.js]"]
  node_stats["Dashboard stats handler<br/>[dashboard-stats.js]"]
end

node_visitor(("Portal visitor"))

node_visitor -->|"opens portal"| node_entry
node_entry -->|"renders"| node_router
node_router -->|"routes to"| node_login
node_router -->|"routes to"| node_dashboard
node_router -->|"routes to"| node_officers
node_router -->|"routes to"| node_documents
node_router -->|"routes to"| node_events
node_router -->|"routes to"| node_profile
node_login -->|"submits credentials"| node_loginapi
node_bindpage -->|"submits email"| node_bindapi
node_createform -->|"creates account"| node_createapi
node_profileform -->|"updates profile"| node_profileapi

click node_entry "https://github.com/giancbaring/sslg/blob/main/governance-portal/src/main.tsx"
click node_router "https://github.com/giancbaring/sslg/blob/main/governance-portal/src/App.tsx"
click node_home "https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/HomePage.tsx"
click node_dashboard "https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/DashboardPage.tsx"
click node_officers "https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/OfficersPage.tsx"
click node_documents "https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/DocumentsPage.tsx"
click node_events "https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/EventsPage.tsx"
click node_news "https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/NewsPage.tsx"
click node_projects "https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/ProjectsPage.tsx"
click node_treasury "https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/TreasuryPage.tsx"
click node_admin "https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/AdminDashboardPage.tsx"
click node_login "https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/LoginPage.tsx"
click node_bindpage "https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/BindEmailPage.tsx"
click node_profile "https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/ProfilePage.tsx"
click node_createform "https://github.com/giancbaring/sslg/blob/main/governance-portal/src/components/CreateUserForm.tsx"
click node_profileform "https://github.com/giancbaring/sslg/blob/main/governance-portal/src/components/ProfileForm.tsx"
click node_loginapi "https://github.com/giancbaring/sslg/blob/main/governance-portal/functions/api/login.js"
click node_bindapi "https://github.com/giancbaring/sslg/blob/main/governance-portal/functions/api/bind-email.js"
click node_createapi "https://github.com/giancbaring/sslg/blob/main/governance-portal/functions/api/create-user.js"
click node_profileapi "https://github.com/giancbaring/sslg/blob/main/governance-portal/functions/api/update-profile.js"
click node_auth "https://github.com/giancbaring/sslg/blob/main/governance-portal/functions/api/authMiddleware.js"
click node_stats "https://github.com/giancbaring/sslg/blob/main/governance-portal/functions/api/dashboard-stats.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_entry,node_router toneBlue
class node_home,node_dashboard,node_officers,node_documents,node_events,node_news,node_projects,node_treasury,node_admin toneAmber
class node_login,node_bindpage,node_profile,node_createform,node_profileform toneMint
class node_loginapi,node_bindapi,node_createapi,node_profileapi,node_auth,node_stats toneRose
class node_visitor toneIndigo
```

## Components

### Portal client

- [Client entry](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/main.tsx): `governance-portal/src/main.tsx`
- [Application routes](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/App.tsx): `governance-portal/src/App.tsx`

### Governance information

- [Home and news](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/HomePage.tsx): `governance-portal/src/pages/HomePage.tsx`
- [Dashboard](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/DashboardPage.tsx): `governance-portal/src/pages/DashboardPage.tsx`
- [Officers](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/OfficersPage.tsx): `governance-portal/src/pages/OfficersPage.tsx`
- [Documents](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/DocumentsPage.tsx): `governance-portal/src/pages/DocumentsPage.tsx`
- [Events](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/EventsPage.tsx): `governance-portal/src/pages/EventsPage.tsx`
- [News](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/NewsPage.tsx): `governance-portal/src/pages/NewsPage.tsx`
- [Projects](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/ProjectsPage.tsx): `governance-portal/src/pages/ProjectsPage.tsx`
- [Treasury](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/TreasuryPage.tsx): `governance-portal/src/pages/TreasuryPage.tsx`
- [Admin dashboard](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/AdminDashboardPage.tsx): `governance-portal/src/pages/AdminDashboardPage.tsx`

### Account services

- [Login page](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/LoginPage.tsx): `governance-portal/src/pages/LoginPage.tsx`
- [Email binding page](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/BindEmailPage.tsx): `governance-portal/src/pages/BindEmailPage.tsx`
- [Profile page](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/pages/ProfilePage.tsx): `governance-portal/src/pages/ProfilePage.tsx`
- [Create-user form](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/components/CreateUserForm.tsx): `governance-portal/src/components/CreateUserForm.tsx`
- [Profile form](https://github.com/giancbaring/sslg/blob/main/governance-portal/src/components/ProfileForm.tsx): `governance-portal/src/components/ProfileForm.tsx`

### API handlers

- [Login handler](https://github.com/giancbaring/sslg/blob/main/governance-portal/functions/api/login.js): `governance-portal/functions/api/login.js`
- [Email binding handler](https://github.com/giancbaring/sslg/blob/main/governance-portal/functions/api/bind-email.js): `governance-portal/functions/api/bind-email.js`
- [User creation handler](https://github.com/giancbaring/sslg/blob/main/governance-portal/functions/api/create-user.js): `governance-portal/functions/api/create-user.js`
- [Profile update handler](https://github.com/giancbaring/sslg/blob/main/governance-portal/functions/api/update-profile.js): `governance-portal/functions/api/update-profile.js`
- [Authentication middleware](https://github.com/giancbaring/sslg/blob/main/governance-portal/functions/api/authMiddleware.js): `governance-portal/functions/api/authMiddleware.js`
- [Dashboard stats handler](https://github.com/giancbaring/sslg/blob/main/governance-portal/functions/api/dashboard-stats.js): `governance-portal/functions/api/dashboard-stats.js`

### Other components

- **Portal visitor**

## Connections

- Portal visitor → Client entry: opens portal
- Client entry → Application routes: renders
- Application routes → Login page: routes to
- Application routes → Dashboard: routes to
- Application routes → Officers: routes to
- Application routes → Documents: routes to
- Application routes → Events: routes to
- Application routes → Profile page: routes to
- Login page → Login handler: submits credentials
- Email binding page → Email binding handler: submits email
- Create-user form → User creation handler: creates account
- Profile form → Profile update handler: updates profile
