# sayonarakoto/gen-c_login architecture

> Architecture diagram of the GitHub repository sayonarakoto/gen-c_login, 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/sayonarakoto/gen-c_login
- Repository: https://github.com/sayonarakoto/gen-c_login

## Overview

GEN-C_LOGIN is a campus access and services system for students, faculty, HODs, librarians, and security staff. Users enter through role-based React pages and dashboards to request and review gate passes, special passes, late-entry approvals, and library services; security verifies passes, while the backend records decisions and supports notifications and generated documents. The source index and excerpts establish several controller-to-model and routing relationships. Other unsampled domain routes are retained as capability nodes, but their internal call paths are not inferred.

Main entry points: [`server/Genc.DAL/models`](https://github.com/sayonarakoto/gen-c_login/tree/dev/server/Genc.DAL/models) (Campus records), [`server/Genc.BL/controllers/gatepassController.js`](https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/controllers/gatepassController.js) (Gate pass handling), [`server/index.js`](https://github.com/sayonarakoto/gen-c_login/blob/dev/server/index.js) (Express application), [`src/api/client.js`](https://github.com/sayonarakoto/gen-c_login/blob/dev/src/api/client.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Role-based app<br/>[App.jsx]"]
  node_dashboards["Role dashboards"]
  node_studentpassui["Student pass requests"]
  node_libraryui["Library screens"]
  node_api_client["API client<br/>[client.js]"]
end

subgraph group_api["API and access"]
  node_backend["Express application<br/>[index.js]"]
  node_auth["Authentication<br/>[auth.js]"]
  node_gate_routes["Gate pass routes<br/>[gatepass.js]"]
  node_library_routes["Library routes<br/>[libraryRoutes.js]"]
  node_auth_controller["Sign-in and accounts<br/>[authController.js]"]
end

subgraph group_passes["Pass workflows"]
  node_gate_controller["Gate pass handling"]
  node_special_controller["Special pass handling"]
  node_verification["Pass verification"]
  node_late_controller["Late entry handling"]
end

subgraph group_campus["Campus services"]
  node_library_controller["Library services"]
  node_faculty["Faculty and access"]
end

subgraph group_data["Persistence and support"]
  node_models[("Campus records<br/>[models]")]
  node_audit["Audit logging<br/>[auditService.js]"]
  node_notifications["Notifications"]
  node_pdf["Pass documents"]
end

node_users(("Campus users"))
node_mongo[("MongoDB")]

node_users -->|"uses"| node_app
node_app -->|"routes to"| node_dashboards
node_dashboards -->|"requests data"| node_api_client
node_studentpassui -->|"submits requests"| node_api_client
node_libraryui -.->|"uses API"| node_api_client
node_api_client -.->|"sends HTTP"| node_backend
node_backend -->|"mounts routes"| node_auth
node_backend -->|"mounts routes"| node_gate_routes
node_backend -->|"mounts routes"| node_library_routes
node_library_routes -->|"requires roles"| node_auth
node_library_routes -->|"dispatches to"| node_library_controller
node_gate_controller -->|"reads and writes"| node_models
node_gate_controller -->|"notifies"| node_notifications
node_gate_controller -->|"verifies QR"| node_verification
node_gate_controller -->|"records events"| node_audit
node_special_controller -->|"reads and writes"| node_models
node_special_controller -->|"records events"| node_audit
node_special_controller -->|"notifies"| node_notifications
node_late_controller -->|"reads and writes"| node_models
node_late_controller -->|"notifies"| node_notifications
node_library_controller -->|"reads and writes"| node_models
node_library_controller -->|"generates pass"| node_pdf
node_faculty -.->|"accesses records"| node_models
node_auth_controller -.->|"checks accounts"| node_models
node_audit -->|"writes logs"| node_models
node_verification -->|"checks pass records"| node_models
node_models -.->|"persists records"| node_mongo

click node_app "https://github.com/sayonarakoto/gen-c_login/blob/dev/src/App.jsx"
click node_dashboards "https://github.com/sayonarakoto/gen-c_login/tree/dev/src/Dashboards"
click node_studentpassui "https://github.com/sayonarakoto/gen-c_login/blob/dev/src/student/StudentActiveGatePass.jsx"
click node_libraryui "https://github.com/sayonarakoto/gen-c_login/tree/dev/src/Pages/librarian"
click node_api_client "https://github.com/sayonarakoto/gen-c_login/blob/dev/src/api/client.js"
click node_backend "https://github.com/sayonarakoto/gen-c_login/blob/dev/server/index.js"
click node_auth "https://github.com/sayonarakoto/gen-c_login/blob/dev/server/middleware/auth.js"
click node_gate_routes "https://github.com/sayonarakoto/gen-c_login/blob/dev/server/routes/gatepass.js"
click node_library_routes "https://github.com/sayonarakoto/gen-c_login/blob/dev/server/routes/libraryRoutes.js"
click node_gate_controller "https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/controllers/gatepassController.js"
click node_special_controller "https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/controllers/specialPassController.js"
click node_verification "https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/services/verificationService.js"
click node_late_controller "https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/controllers/latecomerController.js"
click node_library_controller "https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/controllers/libraryController.js"
click node_faculty "https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/controllers/departmentAccessController.js"
click node_auth_controller "https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/controllers/authController.js"
click node_models "https://github.com/sayonarakoto/gen-c_login/tree/dev/server/Genc.DAL/models"
click node_audit "https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/services/auditService.js"
click node_notifications "https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/services/notificationService.js"
click node_pdf "https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/services/pdfGenerationService.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_dashboards,node_studentpassui,node_libraryui,node_api_client,node_users toneBlue
class node_backend,node_auth,node_gate_routes,node_library_routes,node_auth_controller,node_mongo toneAmber
class node_gate_controller,node_special_controller,node_verification,node_late_controller toneMint
class node_library_controller,node_faculty toneRose
class node_models,node_audit,node_notifications,node_pdf toneIndigo
```

## Components

### Web application

- [Role-based app](https://github.com/sayonarakoto/gen-c_login/blob/dev/src/App.jsx): `src/App.jsx`
- [Role dashboards](https://github.com/sayonarakoto/gen-c_login/tree/dev/src/Dashboards): `src/Dashboards`
- [Student pass requests](https://github.com/sayonarakoto/gen-c_login/blob/dev/src/student/StudentActiveGatePass.jsx): `src/student/StudentActiveGatePass.jsx`
- [Library screens](https://github.com/sayonarakoto/gen-c_login/tree/dev/src/Pages/librarian): `src/Pages/librarian`
- [API client](https://github.com/sayonarakoto/gen-c_login/blob/dev/src/api/client.js): `src/api/client.js`

### API and access

- [Express application](https://github.com/sayonarakoto/gen-c_login/blob/dev/server/index.js): `server/index.js`
- [Authentication](https://github.com/sayonarakoto/gen-c_login/blob/dev/server/middleware/auth.js): `server/middleware/auth.js`
- [Gate pass routes](https://github.com/sayonarakoto/gen-c_login/blob/dev/server/routes/gatepass.js): `server/routes/gatepass.js`
- [Library routes](https://github.com/sayonarakoto/gen-c_login/blob/dev/server/routes/libraryRoutes.js): `server/routes/libraryRoutes.js`
- [Sign-in and accounts](https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/controllers/authController.js): `server/Genc.BL/controllers/authController.js`

### Pass workflows

- [Gate pass handling](https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/controllers/gatepassController.js): `server/Genc.BL/controllers/gatepassController.js`
- [Special pass handling](https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/controllers/specialPassController.js): `server/Genc.BL/controllers/specialPassController.js`
- [Pass verification](https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/services/verificationService.js): `server/Genc.BL/services/verificationService.js`
- [Late entry handling](https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/controllers/latecomerController.js): `server/Genc.BL/controllers/latecomerController.js`

### Campus services

- [Library services](https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/controllers/libraryController.js): `server/Genc.BL/controllers/libraryController.js`
- [Faculty and access](https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/controllers/departmentAccessController.js): `server/Genc.BL/controllers/departmentAccessController.js`

### Persistence and support

- [Campus records](https://github.com/sayonarakoto/gen-c_login/tree/dev/server/Genc.DAL/models): `server/Genc.DAL/models`
- [Audit logging](https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/services/auditService.js): `server/Genc.BL/services/auditService.js`
- [Notifications](https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/services/notificationService.js): `server/Genc.BL/services/notificationService.js`
- [Pass documents](https://github.com/sayonarakoto/gen-c_login/blob/dev/server/Genc.BL/services/pdfGenerationService.js): `server/Genc.BL/services/pdfGenerationService.js`

### Other components

- **Campus users**
- **MongoDB**

## Connections

- Campus users → Role-based app: uses (evidence: `src/App.jsx`)
- Role-based app → Role dashboards: routes to (evidence: `src/App.jsx`)
- Role dashboards → API client: requests data (evidence: `src/Dashboards/StudentDashboard.jsx`)
- Student pass requests → API client: submits requests (evidence: `src/student/StudentActiveGatePass.jsx`)
- Library screens → API client: uses API
- API client → Express application: sends HTTP
- Express application → Authentication: mounts routes (evidence: `server/index.js`)
- Express application → Gate pass routes: mounts routes (evidence: `server/index.js`)
- Express application → Library routes: mounts routes (evidence: `server/index.js`)
- Library routes → Authentication: requires roles (evidence: `server/routes/libraryRoutes.js`)
- Library routes → Library services: dispatches to (evidence: `server/routes/libraryRoutes.js`)
- Gate pass handling → Campus records: reads and writes (evidence: `server/Genc.BL/controllers/gatepassController.js`)
- Gate pass handling → Notifications: notifies (evidence: `server/Genc.BL/controllers/gatepassController.js`)
- Gate pass handling → Pass verification: verifies QR (evidence: `server/Genc.BL/controllers/gatepassController.js`)
- Gate pass handling → Audit logging: records events (evidence: `server/Genc.BL/controllers/gatepassController.js`)
- Special pass handling → Campus records: reads and writes (evidence: `server/Genc.BL/controllers/specialPassController.js`)
- Special pass handling → Audit logging: records events (evidence: `server/Genc.BL/controllers/specialPassController.js`)
- Special pass handling → Notifications: notifies (evidence: `server/Genc.BL/controllers/specialPassController.js`)
- Late entry handling → Campus records: reads and writes (evidence: `server/Genc.BL/controllers/latecomerController.js`)
- Late entry handling → Notifications: notifies (evidence: `server/Genc.BL/controllers/latecomerController.js`)
- Library services → Campus records: reads and writes (evidence: `server/Genc.BL/controllers/libraryController.js`)
- Library services → Pass documents: generates pass (evidence: `server/Genc.BL/controllers/libraryController.js`)
- Faculty and access → Campus records: accesses records
- Sign-in and accounts → Campus records: checks accounts
- Audit logging → Campus records: writes logs (evidence: `server/Genc.BL/services/auditService.js`)
- Pass verification → Campus records: checks pass records (evidence: `server/Genc.BL/services/verificationService.js`)
- Campus records → MongoDB: persists records
