# rmathznotgeniuz/faculty_portal architecture

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

- Interactive diagram: https://gitdiagram.com/rmathznotgeniuz/faculty_portal
- Repository: https://github.com/rmathznotgeniuz/faculty_portal

## Overview

University Faculty Portal is a React prototype for faculty, department heads, and administrators, backed by a Spring Boot modular-monolith foundation. Users enter through routed role-specific screens and explore academic, student, exam-duty, allocation, workload, reporting, notification, and audit workflows; frontend data is currently mocked. The backend has initial identity, authorization, and organization entities, while the README documents a limited authenticated demo API with PostgreSQL-backed duty selection. Most backend domain modules remain structural/planned, so their internal flows are not shown.

Main entry points: [`backend/src/main/java/com/facultyportal/FacultyPortalApplication.java`](https://github.com/rmathznotgeniuz/faculty_portal/blob/main/backend/src/main/java/com/facultyportal/FacultyPortalApplication.java) (Spring application), [`frontend/src/app/App.tsx`](https://github.com/rmathznotgeniuz/faculty_portal/blob/main/frontend/src/app/App.tsx) (Role workflows), [`frontend/src/services/mockService.ts`](https://github.com/rmathznotgeniuz/faculty_portal/blob/main/frontend/src/services/mockService.ts) (Mock workflow service), [`frontend/src/main.tsx`](https://github.com/rmathznotgeniuz/faculty_portal/blob/main/frontend/src/main.tsx) (App bootstrap)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Portal frontend"]
  node_bootstrap["App bootstrap<br/>[main.tsx]"]
  node_router["Role workflows<br/>[App.tsx]"]
  node_shell["Portal shell<br/>[AppShell.tsx]"]
  node_faculty["Faculty screens"]
  node_hod["HOD screens"]
  node_admin["Admin screens"]
  node_dashboard["Dashboard widgets"]
  node_dutyui["Duty components"]
  node_layoutui["Navigation components"]
  node_auth["Authentication setup<br/>[keycloak.ts]"]
end

subgraph group_mock["Mock data services"]
  node_portalservice["Portal service<br/>[portalService.ts]"]
  node_mockservice["Mock workflow service<br/>[mockService.ts]"]
  node_store["In-memory store<br/>[store.ts]"]
end

subgraph group_backend["Backend foundation"]
  node_app["Spring application"]
  node_identity["User identity<br/>[UserEntity.java]"]
  node_organization["Faculty organization<br/>[FacultyEntity.java]"]
  node_authorization["Roles and permissions<br/>[RoleEntity.java]"]
end

subgraph group_domains["Backend domains"]
  node_teaching["Teaching domain"]
  node_exam["Exam domain"]
  node_allocation["Allocation domain"]
  node_performance["Performance domain"]
  node_notification["Notification domain"]
  node_audit["Audit domain"]
  node_reporting["Reporting domain"]
end

node_user(("Portal user"))
node_postgres[("PostgreSQL")]
node_keycloak["Keycloak"]

node_user -->|"opens portal"| node_bootstrap
node_bootstrap -->|"initializes auth"| node_auth
node_bootstrap -->|"renders"| node_router
node_router -->|"wraps routes"| node_shell
node_router -->|"routes to"| node_faculty
node_router -->|"routes to"| node_hod
node_router -->|"routes to"| node_admin
node_shell -->|"renders"| node_layoutui
node_shell -->|"reads notifications"| node_mockservice
node_faculty -->|"reads workflow data"| node_mockservice
node_hod -->|"reads workflow data"| node_mockservice
node_admin -->|"reads workflow data"| node_mockservice
node_dashboard -->|"reads notifications"| node_portalservice
node_faculty -.->|"uses duty controls"| node_dutyui
node_mockservice -->|"uses store"| node_store
node_app -.->|"domain foundation"| node_identity
node_organization -->|"references user entity"| node_identity
node_authorization -->|"references user entity"| node_identity
node_authorization -->|"references department"| node_organization
node_keycloak -.->|"frontend login"| node_auth
node_keycloak -.->|"validates bearer tokens"| node_app
node_user -.->|"uses demo API"| node_app
node_app -.->|"reads and writes demo data"| node_postgres
node_app -.->|"planned module"| node_teaching
node_app -.->|"planned module"| node_exam
node_app -.->|"planned module"| node_allocation
node_app -.->|"planned module"| node_performance
node_app -.->|"planned module"| node_notification
node_app -.->|"planned module"| node_audit
node_app -.->|"planned module"| node_reporting

click node_bootstrap "https://github.com/rmathznotgeniuz/faculty_portal/blob/main/frontend/src/main.tsx"
click node_router "https://github.com/rmathznotgeniuz/faculty_portal/blob/main/frontend/src/app/App.tsx"
click node_shell "https://github.com/rmathznotgeniuz/faculty_portal/blob/main/frontend/src/layouts/AppShell.tsx"
click node_faculty "https://github.com/rmathznotgeniuz/faculty_portal/tree/main/frontend/src/pages"
click node_hod "https://github.com/rmathznotgeniuz/faculty_portal/tree/main/frontend/src/pages/hod"
click node_admin "https://github.com/rmathznotgeniuz/faculty_portal/tree/main/frontend/src/pages/admin"
click node_dashboard "https://github.com/rmathznotgeniuz/faculty_portal/tree/main/frontend/src/components/dashboard"
click node_dutyui "https://github.com/rmathznotgeniuz/faculty_portal/tree/main/frontend/src/components/duties"
click node_layoutui "https://github.com/rmathznotgeniuz/faculty_portal/tree/main/frontend/src/components/layout"
click node_portalservice "https://github.com/rmathznotgeniuz/faculty_portal/blob/main/frontend/src/services/portalService.ts"
click node_mockservice "https://github.com/rmathznotgeniuz/faculty_portal/blob/main/frontend/src/services/mockService.ts"
click node_store "https://github.com/rmathznotgeniuz/faculty_portal/blob/main/frontend/src/services/store.ts"
click node_auth "https://github.com/rmathznotgeniuz/faculty_portal/blob/main/frontend/src/auth/keycloak.ts"
click node_app "https://github.com/rmathznotgeniuz/faculty_portal/blob/main/backend/src/main/java/com/facultyportal/FacultyPortalApplication.java"
click node_identity "https://github.com/rmathznotgeniuz/faculty_portal/blob/main/backend/src/main/java/com/facultyportal/identity/UserEntity.java"
click node_organization "https://github.com/rmathznotgeniuz/faculty_portal/blob/main/backend/src/main/java/com/facultyportal/organization/FacultyEntity.java"
click node_authorization "https://github.com/rmathznotgeniuz/faculty_portal/blob/main/backend/src/main/java/com/facultyportal/authorization/RoleEntity.java"
click node_teaching "https://github.com/rmathznotgeniuz/faculty_portal/tree/main/backend/src/main/java/com/facultyportal/teaching"
click node_exam "https://github.com/rmathznotgeniuz/faculty_portal/tree/main/backend/src/main/java/com/facultyportal/exam"
click node_allocation "https://github.com/rmathznotgeniuz/faculty_portal/tree/main/backend/src/main/java/com/facultyportal/allocation"
click node_performance "https://github.com/rmathznotgeniuz/faculty_portal/tree/main/backend/src/main/java/com/facultyportal/performance"
click node_notification "https://github.com/rmathznotgeniuz/faculty_portal/tree/main/backend/src/main/java/com/facultyportal/notification"
click node_audit "https://github.com/rmathznotgeniuz/faculty_portal/tree/main/backend/src/main/java/com/facultyportal/audit"
click node_reporting "https://github.com/rmathznotgeniuz/faculty_portal/tree/main/backend/src/main/java/com/facultyportal/reporting"

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_bootstrap,node_router,node_shell,node_faculty,node_hod,node_admin,node_dashboard,node_dutyui,node_layoutui,node_auth,node_user toneBlue
class node_portalservice,node_mockservice,node_store,node_postgres toneAmber
class node_app,node_identity,node_organization,node_authorization toneMint
class node_teaching,node_exam,node_allocation,node_performance,node_notification,node_audit,node_reporting toneRose
class node_keycloak toneIndigo
```

## Components

### Portal frontend

- [App bootstrap](https://github.com/rmathznotgeniuz/faculty_portal/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`
- [Role workflows](https://github.com/rmathznotgeniuz/faculty_portal/blob/main/frontend/src/app/App.tsx): `frontend/src/app/App.tsx`
- [Portal shell](https://github.com/rmathznotgeniuz/faculty_portal/blob/main/frontend/src/layouts/AppShell.tsx): `frontend/src/layouts/AppShell.tsx`
- [Faculty screens](https://github.com/rmathznotgeniuz/faculty_portal/tree/main/frontend/src/pages): `frontend/src/pages`
- [HOD screens](https://github.com/rmathznotgeniuz/faculty_portal/tree/main/frontend/src/pages/hod): `frontend/src/pages/hod`
- [Admin screens](https://github.com/rmathznotgeniuz/faculty_portal/tree/main/frontend/src/pages/admin): `frontend/src/pages/admin`
- [Dashboard widgets](https://github.com/rmathznotgeniuz/faculty_portal/tree/main/frontend/src/components/dashboard): `frontend/src/components/dashboard`
- [Duty components](https://github.com/rmathznotgeniuz/faculty_portal/tree/main/frontend/src/components/duties): `frontend/src/components/duties`
- [Navigation components](https://github.com/rmathznotgeniuz/faculty_portal/tree/main/frontend/src/components/layout): `frontend/src/components/layout`
- [Authentication setup](https://github.com/rmathznotgeniuz/faculty_portal/blob/main/frontend/src/auth/keycloak.ts): `frontend/src/auth/keycloak.ts`

### Mock data services

- [Portal service](https://github.com/rmathznotgeniuz/faculty_portal/blob/main/frontend/src/services/portalService.ts): `frontend/src/services/portalService.ts`
- [Mock workflow service](https://github.com/rmathznotgeniuz/faculty_portal/blob/main/frontend/src/services/mockService.ts): `frontend/src/services/mockService.ts`
- [In-memory store](https://github.com/rmathznotgeniuz/faculty_portal/blob/main/frontend/src/services/store.ts): `frontend/src/services/store.ts`

### Backend foundation

- [Spring application](https://github.com/rmathznotgeniuz/faculty_portal/blob/main/backend/src/main/java/com/facultyportal/FacultyPortalApplication.java): `backend/src/main/java/com/facultyportal/FacultyPortalApplication.java`
- [User identity](https://github.com/rmathznotgeniuz/faculty_portal/blob/main/backend/src/main/java/com/facultyportal/identity/UserEntity.java): `backend/src/main/java/com/facultyportal/identity/UserEntity.java`
- [Faculty organization](https://github.com/rmathznotgeniuz/faculty_portal/blob/main/backend/src/main/java/com/facultyportal/organization/FacultyEntity.java): `backend/src/main/java/com/facultyportal/organization/FacultyEntity.java`
- [Roles and permissions](https://github.com/rmathznotgeniuz/faculty_portal/blob/main/backend/src/main/java/com/facultyportal/authorization/RoleEntity.java): `backend/src/main/java/com/facultyportal/authorization/RoleEntity.java`

### Backend domains

- [Teaching domain](https://github.com/rmathznotgeniuz/faculty_portal/tree/main/backend/src/main/java/com/facultyportal/teaching): `backend/src/main/java/com/facultyportal/teaching`
- [Exam domain](https://github.com/rmathznotgeniuz/faculty_portal/tree/main/backend/src/main/java/com/facultyportal/exam): `backend/src/main/java/com/facultyportal/exam`
- [Allocation domain](https://github.com/rmathznotgeniuz/faculty_portal/tree/main/backend/src/main/java/com/facultyportal/allocation): `backend/src/main/java/com/facultyportal/allocation`
- [Performance domain](https://github.com/rmathznotgeniuz/faculty_portal/tree/main/backend/src/main/java/com/facultyportal/performance): `backend/src/main/java/com/facultyportal/performance`
- [Notification domain](https://github.com/rmathznotgeniuz/faculty_portal/tree/main/backend/src/main/java/com/facultyportal/notification): `backend/src/main/java/com/facultyportal/notification`
- [Audit domain](https://github.com/rmathznotgeniuz/faculty_portal/tree/main/backend/src/main/java/com/facultyportal/audit): `backend/src/main/java/com/facultyportal/audit`
- [Reporting domain](https://github.com/rmathznotgeniuz/faculty_portal/tree/main/backend/src/main/java/com/facultyportal/reporting): `backend/src/main/java/com/facultyportal/reporting`

### Other components

- **Portal user**
- **PostgreSQL**
- **Keycloak**

## Connections

- Portal user → App bootstrap: opens portal
- App bootstrap → Authentication setup: initializes auth (evidence: `frontend/src/main.tsx`)
- App bootstrap → Role workflows: renders (evidence: `frontend/src/main.tsx`)
- Role workflows → Portal shell: wraps routes (evidence: `frontend/src/app/App.tsx`)
- Role workflows → Faculty screens: routes to (evidence: `frontend/src/app/App.tsx`)
- Role workflows → HOD screens: routes to (evidence: `frontend/src/app/App.tsx`)
- Role workflows → Admin screens: routes to (evidence: `frontend/src/app/App.tsx`)
- Portal shell → Navigation components: renders (evidence: `frontend/src/layouts/AppShell.tsx`)
- Portal shell → Mock workflow service: reads notifications (evidence: `frontend/src/layouts/AppShell.tsx`)
- Faculty screens → Mock workflow service: reads workflow data (evidence: `frontend/src/pages/StudentsPage.tsx`)
- HOD screens → Mock workflow service: reads workflow data (evidence: `frontend/src/pages/hod/HodDashboardPage.tsx`)
- Admin screens → Mock workflow service: reads workflow data
- Dashboard widgets → Portal service: reads notifications (evidence: `frontend/src/components/dashboard/NotificationPreview.tsx`)
- Faculty screens → Duty components: uses duty controls
- Mock workflow service → In-memory store: uses store (evidence: `frontend/src/services/mockService.ts`)
- Spring application → User identity: domain foundation
- Faculty organization → User identity: references user entity (evidence: `backend/src/main/java/com/facultyportal/organization/FacultyEntity.java`)
- Roles and permissions → User identity: references user entity
- Roles and permissions → Faculty organization: references department
- Keycloak → Authentication setup: frontend login
- Keycloak → Spring application: validates bearer tokens
- Portal user → Spring application: uses demo API
- Spring application → PostgreSQL: reads and writes demo data
- Spring application → Teaching domain: planned module
- Spring application → Exam domain: planned module
- Spring application → Allocation domain: planned module
- Spring application → Performance domain: planned module
- Spring application → Notification domain: planned module
- Spring application → Audit domain: planned module
- Spring application → Reporting domain: planned module
