# thamesblanq/ulads-front architecture

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

- Interactive diagram: https://gitdiagram.com/thamesblanq/ulads-front
- Repository: https://github.com/thamesblanq/ulads-front

## Overview

ULADS is a student-union portal with public pages and authenticated dashboards for elections, profiles, announcements, academic resources, and administration. Users sign in through a login page and API proxy, then use dashboard features that fetch or update backend data; election browsing and results are a distinct major workflow. The sampled API routes show cookie-based proxying to an external backend. The README is only the default Next.js template, and unsampled pages/routes leave feature-specific wiring uncertain.

Main entry points: [`app/api/auth/login/route.ts`](https://github.com/thamesblanq/ulads-front/blob/main/app/api/auth/login/route.ts) (Login proxy), [`app/api/elections`](https://github.com/thamesblanq/ulads-front/tree/main/app/api/elections) (Election API proxy), [`app/api/users`](https://github.com/thamesblanq/ulads-front/tree/main/app/api/users) (Profile endpoints), [`app/components/ElectionPage.tsx`](https://github.com/thamesblanq/ulads-front/blob/main/app/components/ElectionPage.tsx) (Election views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_landing["Landing page<br/>[page.tsx]"]
  node_dashboard["Dashboard routes"]
  node_apihelper["API utilities<br/>[api.ts]"]
end

subgraph group_identity["Identity and profile"]
  node_loginui["Login and signup<br/>[Login.tsx]"]
  node_loginapi["Login proxy<br/>[route.ts]"]
  node_profileui["Profile page<br/>[ProfilePage.tsx]"]
  node_profileapi["Profile endpoints"]
  node_session["JWT cookie"]
end

subgraph group_elections["Election lifecycle"]
  node_electionui["Election views<br/>[ElectionPage.tsx]"]
  node_electionadmin["Election management"]
  node_electionapi["Election API proxy"]
  node_results["Election results"]
end

subgraph group_engagement["Student services"]
  node_announcements["Announcements"]
  node_resources["Academic resources<br/>[ResourcePage.tsx]"]
  node_messaging["Messaging and minutes"]
  node_payments["Payments<br/>[page.tsx]"]
end

subgraph group_admin["Administration"]
  node_resourceadmin["Resource management"]
  node_audit["Audit logs"]
  node_users["User management<br/>[UserManagement.tsx]"]
  node_adminui["Admin dashboard<br/>[page.tsx]"]
end

node_visitor(("Student / admin"))
node_backend{{"ULADS backend"}}

node_visitor -->|"browses"| node_landing
node_visitor -->|"signs in"| node_loginui
node_visitor -->|"opens"| node_dashboard
node_loginui -->|"submits credentials"| node_loginapi
node_loginapi -->|"forwards login"| node_backend
node_backend -->|"sets cookie"| node_loginapi
node_loginapi -->|"relays cookie"| node_session
node_visitor -->|"edits profile"| node_profileui
node_profileui -->|"requests profile"| node_profileapi
node_profileapi -->|"reads token"| node_session
node_profileapi -->|"proxies profile calls"| node_backend
node_visitor -->|"views elections"| node_electionui
node_electionui -->|"requests election data"| node_electionapi
node_electionadmin -->|"updates status"| node_electionapi
node_electionapi -->|"reads token"| node_session
node_electionapi -->|"proxies election calls"| node_backend
node_electionui -->|"presents results"| node_results
node_visitor -->|"reads notices"| node_announcements
node_visitor -->|"finds resources"| node_resources
node_visitor -->|"manages links"| node_resourceadmin
node_resourceadmin -->|"fetches and updates"| node_backend
node_visitor -->|"uses services"| node_messaging
node_visitor -->|"views payments"| node_payments
node_visitor -->|"administers portal"| node_adminui
node_adminui -->|"manages users"| node_users
node_adminui -->|"reviews activity"| node_audit
node_dashboard -.->|"uses API utilities"| node_apihelper

click node_landing "https://github.com/thamesblanq/ulads-front/blob/main/app/page.tsx"
click node_dashboard "https://github.com/thamesblanq/ulads-front/tree/main/app/dashboard"
click node_loginui "https://github.com/thamesblanq/ulads-front/blob/main/app/components/Login.tsx"
click node_loginapi "https://github.com/thamesblanq/ulads-front/blob/main/app/api/auth/login/route.ts"
click node_profileui "https://github.com/thamesblanq/ulads-front/blob/main/app/components/ProfilePage.tsx"
click node_profileapi "https://github.com/thamesblanq/ulads-front/tree/main/app/api/users"
click node_electionui "https://github.com/thamesblanq/ulads-front/blob/main/app/components/ElectionPage.tsx"
click node_electionadmin "https://github.com/thamesblanq/ulads-front/blob/main/app/components/ElectionManagement.tsx"
click node_electionapi "https://github.com/thamesblanq/ulads-front/tree/main/app/api/elections"
click node_results "https://github.com/thamesblanq/ulads-front/blob/main/app/components/ElectionResults.tsx"
click node_announcements "https://github.com/thamesblanq/ulads-front/blob/main/app/components/AnnouncementPage.tsx"
click node_resources "https://github.com/thamesblanq/ulads-front/blob/main/app/components/ResourcePage.tsx"
click node_resourceadmin "https://github.com/thamesblanq/ulads-front/blob/main/app/components/ManageResources.tsx"
click node_messaging "https://github.com/thamesblanq/ulads-front/tree/main/app/dashboard"
click node_payments "https://github.com/thamesblanq/ulads-front/blob/main/app/dashboard/payments/page.tsx"
click node_audit "https://github.com/thamesblanq/ulads-front/blob/main/app/components/SystemAuditLogs.tsx"
click node_users "https://github.com/thamesblanq/ulads-front/blob/main/app/components/UserManagement.tsx"
click node_adminui "https://github.com/thamesblanq/ulads-front/blob/main/app/dashboard/admin/page.tsx"
click node_apihelper "https://github.com/thamesblanq/ulads-front/blob/main/lib/api.ts"

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_landing,node_dashboard,node_apihelper toneBlue
class node_loginui,node_loginapi,node_profileui,node_profileapi,node_session toneAmber
class node_electionui,node_electionadmin,node_electionapi,node_results toneMint
class node_announcements,node_resources,node_messaging,node_payments toneRose
class node_resourceadmin,node_audit,node_users,node_adminui,node_visitor,node_backend toneIndigo
```

## Components

### Web experience

- [Landing page](https://github.com/thamesblanq/ulads-front/blob/main/app/page.tsx): `app/page.tsx`
- [Dashboard routes](https://github.com/thamesblanq/ulads-front/tree/main/app/dashboard): `app/dashboard`
- [API utilities](https://github.com/thamesblanq/ulads-front/blob/main/lib/api.ts): `lib/api.ts`

### Identity and profile

- [Login and signup](https://github.com/thamesblanq/ulads-front/blob/main/app/components/Login.tsx): `app/components/Login.tsx`
- [Login proxy](https://github.com/thamesblanq/ulads-front/blob/main/app/api/auth/login/route.ts): `app/api/auth/login/route.ts`
- [Profile page](https://github.com/thamesblanq/ulads-front/blob/main/app/components/ProfilePage.tsx): `app/components/ProfilePage.tsx`
- [Profile endpoints](https://github.com/thamesblanq/ulads-front/tree/main/app/api/users): `app/api/users`
- **JWT cookie**

### Election lifecycle

- [Election views](https://github.com/thamesblanq/ulads-front/blob/main/app/components/ElectionPage.tsx): `app/components/ElectionPage.tsx`
- [Election management](https://github.com/thamesblanq/ulads-front/blob/main/app/components/ElectionManagement.tsx): `app/components/ElectionManagement.tsx`
- [Election API proxy](https://github.com/thamesblanq/ulads-front/tree/main/app/api/elections): `app/api/elections`
- [Election results](https://github.com/thamesblanq/ulads-front/blob/main/app/components/ElectionResults.tsx): `app/components/ElectionResults.tsx`

### Student services

- [Announcements](https://github.com/thamesblanq/ulads-front/blob/main/app/components/AnnouncementPage.tsx): `app/components/AnnouncementPage.tsx`
- [Academic resources](https://github.com/thamesblanq/ulads-front/blob/main/app/components/ResourcePage.tsx): `app/components/ResourcePage.tsx`
- [Messaging and minutes](https://github.com/thamesblanq/ulads-front/tree/main/app/dashboard): `app/dashboard`
- [Payments](https://github.com/thamesblanq/ulads-front/blob/main/app/dashboard/payments/page.tsx): `app/dashboard/payments/page.tsx`

### Administration

- [Resource management](https://github.com/thamesblanq/ulads-front/blob/main/app/components/ManageResources.tsx): `app/components/ManageResources.tsx`
- [Audit logs](https://github.com/thamesblanq/ulads-front/blob/main/app/components/SystemAuditLogs.tsx): `app/components/SystemAuditLogs.tsx`
- [User management](https://github.com/thamesblanq/ulads-front/blob/main/app/components/UserManagement.tsx): `app/components/UserManagement.tsx`
- [Admin dashboard](https://github.com/thamesblanq/ulads-front/blob/main/app/dashboard/admin/page.tsx): `app/dashboard/admin/page.tsx`

### Other components

- **Student / admin**
- **ULADS backend**

## Connections

- Student / admin → Landing page: browses
- Student / admin → Login and signup: signs in
- Student / admin → Dashboard routes: opens
- Login and signup → Login proxy: submits credentials
- Login proxy → ULADS backend: forwards login
- ULADS backend → Login proxy: sets cookie
- Login proxy → JWT cookie: relays cookie
- Student / admin → Profile page: edits profile
- Profile page → Profile endpoints: requests profile
- Profile endpoints → JWT cookie: reads token
- Profile endpoints → ULADS backend: proxies profile calls
- Student / admin → Election views: views elections
- Election views → Election API proxy: requests election data
- Election management → Election API proxy: updates status
- Election API proxy → JWT cookie: reads token
- Election API proxy → ULADS backend: proxies election calls
- Election views → Election results: presents results
- Student / admin → Announcements: reads notices
- Student / admin → Academic resources: finds resources
- Student / admin → Resource management: manages links
- Resource management → ULADS backend: fetches and updates
- Student / admin → Messaging and minutes: uses services
- Student / admin → Payments: views payments
- Student / admin → Admin dashboard: administers portal
- Admin dashboard → User management: manages users
- Admin dashboard → Audit logs: reviews activity
- Dashboard routes → API utilities: uses API utilities
