# mohamadzuheer6-gif/aegis-full-stack-project architecture

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

- Interactive diagram: https://gitdiagram.com/mohamadzuheer6-gif/aegis-full-stack-project
- Repository: https://github.com/mohamadzuheer6-gif/aegis-full-stack-project

## Overview

AEGIS is a campus platform for grievance resolution, academic tools, and faculty–student opportunities. Users enter through the React application, whose protected pages use a shared API service to reach the Express API; backend routes apply JWT/role checks, controllers handle domain operations, and PostgreSQL persists relational data. The graph preserves the documented grievance, calendar/resources, and opportunity/application/task/messaging capabilities. Several UI-to-API links are documented or indicated by the API service, but unsampled pages and controllers limit detail on their exact calls.

Main entry points: [`aegis-frontend/src/services/api.js`](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/services/api.js) (API service), [`aegis-backend/server.js`](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/server.js) (Express API server), [`aegis-frontend/src/App.jsx`](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/App.jsx) (React routes), [`aegis-backend/db.js`](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/db.js) (PostgreSQL access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client application"]
  node_app["React routes<br/>[App.jsx]"]
  node_api_client["API service<br/>[api.js]"]
end

subgraph group_identity["Identity and access"]
  node_login["Login and registration<br/>[Login.jsx]"]
  node_protected["Protected routes<br/>[ProtectedRoute.jsx]"]
  node_auth_routes["Authentication endpoints<br/>[auth.routes.js]"]
  node_auth_controller["Authentication<br/>[auth.controller.js]"]
  node_auth_middleware["JWT and role checks<br/>[auth.middleware.js]"]
end

subgraph group_grievances["Grievance management"]
  node_grievance_ui["Grievance submission and tracking"]
  node_authority_ui["Authority grievance dashboard"]
  node_grievance_routes["Grievance endpoints"]
  node_grievance_controller["Grievance operations"]
  node_authority_controller["Assignment and analytics"]
end

subgraph group_academics["Academic tools"]
  node_academic_ui["Calendar, resources, courses"]
  node_resources_routes["Resource search and upload"]
  node_events_controller["Academic events"]
end

subgraph group_opportunities["Opportunity management"]
  node_opportunity_ui["Opportunities and applications"]
  node_faculty_ui["Faculty portal and inbox<br/>[FacultyPortal.jsx]"]
  node_ledger_ui["Scholar task manager<br/>[ScholarLedger.jsx]"]
  node_opportunity_routes["Opportunity endpoints"]
  node_application_controller["Applications and resumes"]
  node_other_opportunity_services["Bookmarks, tasks, messaging"]
end

subgraph group_data["API and persistence"]
  node_server["Express API server<br/>[server.js]"]
  node_db_access["PostgreSQL access<br/>[db.js]"]
  node_postgres[("PostgreSQL")]
end

node_campus_users(("Campus users"))

node_campus_users -->|"use"| node_app
node_app -->|"routes to"| node_login
node_app -->|"guards pages"| node_protected
node_app -->|"routes to"| node_grievance_ui
node_app -->|"routes to"| node_authority_ui
node_app -->|"routes to"| node_academic_ui
node_app -->|"routes to"| node_opportunity_ui
node_login -->|"uses"| node_api_client
node_api_client -->|"requests"| node_auth_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_protected -.->|"checks session"| node_api_client
node_app -->|"uses API layer"| node_api_client
node_api_client -->|"sends REST requests"| node_server
node_server -->|"mounts"| node_auth_routes
node_server -->|"mounts"| node_grievance_routes
node_server -->|"mounts"| node_resources_routes
node_server -->|"mounts"| node_opportunity_routes
node_server -.->|"mounts events route"| node_events_controller
node_grievance_ui -.->|"uses grievance API"| node_api_client
node_authority_ui -.->|"uses authority API"| node_api_client
node_api_client -->|"requests"| node_grievance_routes
node_api_client -->|"requests"| node_resources_routes
node_api_client -->|"requests"| node_opportunity_routes
node_grievance_routes -->|"dispatches"| node_grievance_controller
node_grievance_routes -->|"authenticates"| node_auth_middleware
node_authority_ui -.->|"uses authority endpoints"| node_api_client
node_api_client -->|"requests"| node_authority_controller
node_authority_controller -->|"queries and updates"| node_db_access
node_grievance_controller -->|"queries and updates"| node_db_access
node_academic_ui -.->|"uses academic APIs"| node_api_client
node_api_client -->|"requests events"| node_events_controller
node_resources_routes -->|"queries and stores"| node_db_access
node_server -->|"mounts"| node_resources_routes
node_opportunity_ui -.->|"uses opportunity APIs"| node_api_client
node_faculty_ui -.->|"uses opportunity APIs"| node_api_client
node_ledger_ui -.->|"uses task API"| node_api_client
node_opportunity_routes -->|"authenticates"| node_auth_middleware
node_api_client -->|"requests applications"| node_application_controller
node_application_controller -->|"reads and writes"| node_db_access
node_api_client -->|"requests features"| node_other_opportunity_services
node_server -->|"mounts feature routes"| node_other_opportunity_services
node_events_controller -->|"queries data"| node_db_access
node_auth_middleware -.->|"protects API routes"| node_server
node_db_access -->|"queries"| node_postgres

click node_app "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/App.jsx"
click node_api_client "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/services/api.js"
click node_login "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/pages/Login.jsx"
click node_protected "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/components/ProtectedRoute.jsx"
click node_auth_routes "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/routes/auth.routes.js"
click node_auth_controller "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/controllers/auth.controller.js"
click node_auth_middleware "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/middleware/auth.middleware.js"
click node_grievance_ui "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/pages/GrievanceSubmit.jsx"
click node_authority_ui "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/pages/AuthorityGrievanceDashboard.jsx"
click node_grievance_routes "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/routes/grievance.routes.js"
click node_grievance_controller "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/controllers/grievance.controller.js"
click node_authority_controller "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/controllers/authority.controller.js"
click node_academic_ui "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/pages/ChronosCalendar.jsx"
click node_resources_routes "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/routes/resources.routes.js"
click node_events_controller "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/controllers/academic_events.controller.js"
click node_opportunity_ui "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/pages/OpportunityDetail.jsx"
click node_faculty_ui "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/pages/FacultyPortal.jsx"
click node_ledger_ui "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/pages/ScholarLedger.jsx"
click node_opportunity_routes "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/routes/opportunities.routes.js"
click node_application_controller "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/controllers/applications.controller.js"
click node_other_opportunity_services "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/tree/main/aegis-backend/controllers"
click node_server "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/server.js"
click node_db_access "https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/db.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_app,node_api_client,node_campus_users toneBlue
class node_login,node_protected,node_auth_routes,node_auth_controller,node_auth_middleware toneAmber
class node_grievance_ui,node_authority_ui,node_grievance_routes,node_grievance_controller,node_authority_controller toneMint
class node_academic_ui,node_resources_routes,node_events_controller toneRose
class node_opportunity_ui,node_faculty_ui,node_ledger_ui,node_opportunity_routes,node_application_controller,node_other_opportunity_services toneIndigo
class node_server,node_db_access,node_postgres toneTeal
```

## Components

### Client application

- [React routes](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/App.jsx): `aegis-frontend/src/App.jsx`
- [API service](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/services/api.js): `aegis-frontend/src/services/api.js`

### Identity and access

- [Login and registration](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/pages/Login.jsx): `aegis-frontend/src/pages/Login.jsx`
- [Protected routes](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/components/ProtectedRoute.jsx): `aegis-frontend/src/components/ProtectedRoute.jsx`
- [Authentication endpoints](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/routes/auth.routes.js): `aegis-backend/routes/auth.routes.js`
- [Authentication](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/controllers/auth.controller.js): `aegis-backend/controllers/auth.controller.js`
- [JWT and role checks](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/middleware/auth.middleware.js): `aegis-backend/middleware/auth.middleware.js`

### Grievance management

- [Grievance submission and tracking](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/pages/GrievanceSubmit.jsx): `aegis-frontend/src/pages/GrievanceSubmit.jsx`
- [Authority grievance dashboard](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/pages/AuthorityGrievanceDashboard.jsx): `aegis-frontend/src/pages/AuthorityGrievanceDashboard.jsx`
- [Grievance endpoints](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/routes/grievance.routes.js): `aegis-backend/routes/grievance.routes.js`
- [Grievance operations](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/controllers/grievance.controller.js): `aegis-backend/controllers/grievance.controller.js`
- [Assignment and analytics](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/controllers/authority.controller.js): `aegis-backend/controllers/authority.controller.js`

### Academic tools

- [Calendar, resources, courses](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/pages/ChronosCalendar.jsx): `aegis-frontend/src/pages/ChronosCalendar.jsx`
- [Resource search and upload](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/routes/resources.routes.js): `aegis-backend/routes/resources.routes.js`
- [Academic events](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/controllers/academic_events.controller.js): `aegis-backend/controllers/academic_events.controller.js`

### Opportunity management

- [Opportunities and applications](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/pages/OpportunityDetail.jsx): `aegis-frontend/src/pages/OpportunityDetail.jsx`
- [Faculty portal and inbox](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/pages/FacultyPortal.jsx): `aegis-frontend/src/pages/FacultyPortal.jsx`
- [Scholar task manager](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-frontend/src/pages/ScholarLedger.jsx): `aegis-frontend/src/pages/ScholarLedger.jsx`
- [Opportunity endpoints](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/routes/opportunities.routes.js): `aegis-backend/routes/opportunities.routes.js`
- [Applications and resumes](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/controllers/applications.controller.js): `aegis-backend/controllers/applications.controller.js`
- [Bookmarks, tasks, messaging](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/tree/main/aegis-backend/controllers): `aegis-backend/controllers`

### API and persistence

- [Express API server](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/server.js): `aegis-backend/server.js`
- [PostgreSQL access](https://github.com/mohamadzuheer6-gif/aegis-full-stack-project/blob/main/aegis-backend/db.js): `aegis-backend/db.js`
- **PostgreSQL**

### Other components

- **Campus users**

## Connections

- Campus users → React routes: use (evidence: `README.md`)
- React routes → Login and registration: routes to (evidence: `aegis-frontend/src/App.jsx`)
- React routes → Protected routes: guards pages (evidence: `aegis-frontend/src/App.jsx`)
- React routes → Grievance submission and tracking: routes to (evidence: `aegis-frontend/src/App.jsx`)
- React routes → Authority grievance dashboard: routes to (evidence: `aegis-frontend/src/App.jsx`)
- React routes → Calendar, resources, courses: routes to (evidence: `aegis-frontend/src/App.jsx`)
- React routes → Opportunities and applications: routes to (evidence: `aegis-frontend/src/App.jsx`)
- Login and registration → API service: uses (evidence: `aegis-frontend/src/pages/Login.jsx`)
- API service → Authentication endpoints: requests (evidence: `aegis-frontend/src/services/api.js`)
- Authentication endpoints → Authentication: dispatches (evidence: `aegis-backend/routes/auth.routes.js`)
- Protected routes → API service: checks session
- React routes → API service: uses API layer (evidence: `README.md`)
- API service → Express API server: sends REST requests (evidence: `README.md`)
- Express API server → Authentication endpoints: mounts (evidence: `aegis-backend/server.js`)
- Express API server → Grievance endpoints: mounts (evidence: `aegis-backend/server.js`)
- Express API server → Resource search and upload: mounts (evidence: `aegis-backend/server.js`)
- Express API server → Opportunity endpoints: mounts (evidence: `aegis-backend/server.js`)
- Express API server → Academic events: mounts events route
- Grievance submission and tracking → API service: uses grievance API
- Authority grievance dashboard → API service: uses authority API
- API service → Grievance endpoints: requests (evidence: `aegis-frontend/src/services/api.js`)
- API service → Resource search and upload: requests (evidence: `aegis-frontend/src/services/api.js`)
- API service → Opportunity endpoints: requests (evidence: `aegis-frontend/src/services/api.js`)
- Grievance endpoints → Grievance operations: dispatches (evidence: `aegis-backend/routes/grievance.routes.js`)
- Grievance endpoints → JWT and role checks: authenticates (evidence: `aegis-backend/routes/grievance.routes.js`)
- Authority grievance dashboard → API service: uses authority endpoints
- API service → Assignment and analytics: requests (evidence: `aegis-frontend/src/services/api.js`)
- Assignment and analytics → PostgreSQL access: queries and updates (evidence: `aegis-backend/controllers/authority.controller.js`)
- Grievance operations → PostgreSQL access: queries and updates (evidence: `aegis-backend/controllers/grievance.controller.js`)
- Calendar, resources, courses → API service: uses academic APIs
- API service → Academic events: requests events (evidence: `aegis-frontend/src/services/api.js`)
- Resource search and upload → PostgreSQL access: queries and stores (evidence: `aegis-backend/routes/resources.routes.js`)
- Express API server → Resource search and upload: mounts (evidence: `aegis-backend/server.js`)
- Opportunities and applications → API service: uses opportunity APIs
- Faculty portal and inbox → API service: uses opportunity APIs
- Scholar task manager → API service: uses task API
- Opportunity endpoints → JWT and role checks: authenticates (evidence: `aegis-backend/routes/opportunities.routes.js`)
- API service → Applications and resumes: requests applications (evidence: `aegis-frontend/src/services/api.js`)
- Applications and resumes → PostgreSQL access: reads and writes (evidence: `aegis-backend/controllers/applications.controller.js`)
- API service → Bookmarks, tasks, messaging: requests features (evidence: `aegis-frontend/src/services/api.js`)
- Express API server → Bookmarks, tasks, messaging: mounts feature routes (evidence: `aegis-backend/server.js`)
- Academic events → PostgreSQL access: queries data (evidence: `aegis-backend/controllers/academic_events.controller.js`)
- JWT and role checks → Express API server: protects API routes
- PostgreSQL access → PostgreSQL: queries (evidence: `README.md`)
