# abhishekrk0001/aps-erp architecture

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

- Interactive diagram: https://gitdiagram.com/abhishekrk0001/aps-erp
- Repository: https://github.com/abhishekrk0001/aps-erp

## Overview

APS-ERP is a repository of four campus tools: authentication, leave and substitute management, a noticeboard, and timetable planning. Their main workflows span sign-in and account administration, leave approval and coverage, notices and academic-cycle operations, and timetable setup, generation, validation, and saving. The graph keeps these products separate. Evidence is strongest for authentication, leave, and timetable calls; noticeboard capabilities are represented from the file tree because its sampled index does not establish internal call relationships.

Main entry points: [`timetable/server/controllers/timetableController.js`](https://github.com/abhishekrk0001/aps-erp/blob/main/timetable/server/controllers/timetableController.js) (Generation and edits), [`authentication/src/controllers/userController.js`](https://github.com/abhishekrk0001/aps-erp/blob/main/authentication/src/controllers/userController.js) (User provisioning), [`authentication/src/routes/userRoutes.js`](https://github.com/abhishekrk0001/aps-erp/blob/main/authentication/src/routes/userRoutes.js) (Auth and user routes), [`leave-management/backend/controllers/leaveController.js`](https://github.com/abhishekrk0001/aps-erp/blob/main/leave-management/backend/controllers/leaveController.js) (Leave requests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth["Authentication"]
  node_auth_server["Auth API server<br/>[server.js]"]
  node_auth_routes["Auth and user routes<br/>[userRoutes.js]"]
  node_auth_login["Login and tokens<br/>[authController.js]"]
  node_auth_user["User provisioning<br/>[userController.js]"]
  node_auth_store[("Identity records<br/>[User.js]")]
  node_auth_audit[("Audit records<br/>[AuditLog.js]")]
  node_auth_otp["OTP operations<br/>[otpController.js]"]
  node_auth_limiter["Rate limiting<br/>[rateLimiter.js]"]
end

subgraph group_leave["Leave Management"]
  node_leave_app["Leave dashboards<br/>[App.js]"]
  node_leave_api["Leave API routes<br/>[leaveRoutes.js]"]
  node_leave_controller["Leave requests<br/>[leaveController.js]"]
  node_leave_workflow["Approval workflow<br/>[leaveWorkflow.js]"]
  node_leave_records[("Leave and balances<br/>[Leave.js]")]
  node_sub_routes["Substitute routes"]
  node_sub_controller["Coverage requests"]
  node_sub_records[("Substitute assignments")]
end

subgraph group_notice["Noticeboard"]
  node_notice_ui["Notice portal<br/>[page.tsx]"]
  node_notice_api["Notice publishing<br/>[route.ts]"]
  node_notice_approval["Notice approvals<br/>[route.ts]"]
  node_notice_feed["Campus feed<br/>[route.ts]"]
  node_notice_cycle["Academic cycle<br/>[route.ts]"]
  node_notice_notifications["Notifications<br/>[route.ts]"]
end

subgraph group_timetable["Timetable Planning"]
  node_tt_app["Planning screens<br/>[App.jsx]"]
  node_tt_routes["Timetable API routes<br/>[timetableRoutes.js]"]
  node_tt_controller["Generation and edits"]
  node_tt_generator["Constraint generator<br/>[generator.js]"]
  node_tt_inputs[("Planning records<br/>[Subject.js]")]
  node_tt_saved[("Saved timetables<br/>[Timetable.js]")]
end

node_admin(("Campus administrator"))
node_teacher(("Teacher or approver"))
node_campus_user(("Campus community member"))
node_planner(("Timetable planner"))

node_auth_server -->|"mounts routes"| node_auth_routes
node_auth_routes -->|"dispatches creation"| node_auth_user
node_auth_routes -->|"limits requests"| node_auth_limiter
node_auth_user -->|"creates accounts"| node_auth_store
node_auth_user -->|"logs creation"| node_auth_audit
node_auth_user -->|"creates OTP"| node_auth_otp
node_auth_login -->|"checks credentials"| node_auth_store
node_auth_login -->|"logs login"| node_auth_audit
node_teacher -.->|"uses dashboards"| node_leave_app
node_leave_api -->|"dispatches requests"| node_leave_controller
node_leave_controller -->|"submits approvals"| node_leave_workflow
node_leave_controller -->|"reads leave data"| node_leave_records
node_sub_routes -->|"dispatches coverage"| node_sub_controller
node_sub_controller -->|"requests assignment"| node_leave_workflow
node_sub_controller -->|"reads requests"| node_sub_records
node_campus_user -.->|"uses portal"| node_notice_ui
node_planner -.->|"uses planner"| node_tt_app
node_tt_app -.->|"requests generation"| node_tt_controller
node_tt_routes -->|"dispatches operations"| node_tt_controller
node_tt_controller -->|"generates and validates"| node_tt_generator
node_tt_controller -->|"loads planning data"| node_tt_inputs
node_tt_controller -->|"saves timetable"| node_tt_saved

click node_auth_server "https://github.com/abhishekrk0001/aps-erp/blob/main/authentication/server.js"
click node_auth_routes "https://github.com/abhishekrk0001/aps-erp/blob/main/authentication/src/routes/userRoutes.js"
click node_auth_login "https://github.com/abhishekrk0001/aps-erp/blob/main/authentication/src/controllers/authController.js"
click node_auth_user "https://github.com/abhishekrk0001/aps-erp/blob/main/authentication/src/controllers/userController.js"
click node_auth_store "https://github.com/abhishekrk0001/aps-erp/blob/main/authentication/src/models/User.js"
click node_auth_audit "https://github.com/abhishekrk0001/aps-erp/blob/main/authentication/src/models/AuditLog.js"
click node_auth_otp "https://github.com/abhishekrk0001/aps-erp/blob/main/authentication/src/controllers/otpController.js"
click node_auth_limiter "https://github.com/abhishekrk0001/aps-erp/blob/main/authentication/src/middlewares/rateLimiter.js"
click node_leave_app "https://github.com/abhishekrk0001/aps-erp/blob/main/leave-management/frontend/src/App.js"
click node_leave_api "https://github.com/abhishekrk0001/aps-erp/blob/main/leave-management/backend/routes/leaveRoutes.js"
click node_leave_controller "https://github.com/abhishekrk0001/aps-erp/blob/main/leave-management/backend/controllers/leaveController.js"
click node_leave_workflow "https://github.com/abhishekrk0001/aps-erp/blob/main/leave-management/backend/services/leaveWorkflow.js"
click node_leave_records "https://github.com/abhishekrk0001/aps-erp/blob/main/leave-management/backend/models/Leave.js"
click node_sub_routes "https://github.com/abhishekrk0001/aps-erp/blob/main/leave-management/backend/routes/substituteRoutes.js"
click node_sub_controller "https://github.com/abhishekrk0001/aps-erp/blob/main/leave-management/backend/controllers/substituteController.js"
click node_sub_records "https://github.com/abhishekrk0001/aps-erp/blob/main/leave-management/backend/models/SubstituteRequest.js"
click node_notice_ui "https://github.com/abhishekrk0001/aps-erp/blob/main/noticeboard/app/portal/page.tsx"
click node_notice_api "https://github.com/abhishekrk0001/aps-erp/blob/main/noticeboard/app/api/notices/route.ts"
click node_notice_approval "https://github.com/abhishekrk0001/aps-erp/blob/main/noticeboard/app/api/notices/%5Bid%5D/approval/route.ts"
click node_notice_feed "https://github.com/abhishekrk0001/aps-erp/blob/main/noticeboard/app/api/feed/route.ts"
click node_notice_cycle "https://github.com/abhishekrk0001/aps-erp/blob/main/noticeboard/app/api/academic-cycle/advance/route.ts"
click node_notice_notifications "https://github.com/abhishekrk0001/aps-erp/blob/main/noticeboard/app/api/notifications/route.ts"
click node_tt_app "https://github.com/abhishekrk0001/aps-erp/blob/main/timetable/timetable-frontend/src/App.jsx"
click node_tt_routes "https://github.com/abhishekrk0001/aps-erp/blob/main/timetable/server/routes/timetableRoutes.js"
click node_tt_controller "https://github.com/abhishekrk0001/aps-erp/blob/main/timetable/server/controllers/timetableController.js"
click node_tt_generator "https://github.com/abhishekrk0001/aps-erp/blob/main/timetable/server/services/generator.js"
click node_tt_inputs "https://github.com/abhishekrk0001/aps-erp/blob/main/timetable/server/models/Subject.js"
click node_tt_saved "https://github.com/abhishekrk0001/aps-erp/blob/main/timetable/server/models/Timetable.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_auth_server,node_auth_routes,node_auth_login,node_auth_user,node_auth_store,node_auth_audit,node_auth_otp,node_auth_limiter toneBlue
class node_leave_app,node_leave_api,node_leave_controller,node_leave_workflow,node_leave_records,node_sub_routes,node_sub_controller,node_sub_records toneAmber
class node_notice_ui,node_notice_api,node_notice_approval,node_notice_feed,node_notice_cycle,node_notice_notifications toneMint
class node_tt_app,node_tt_routes,node_tt_controller,node_tt_generator,node_tt_inputs,node_tt_saved toneRose
class node_admin,node_teacher,node_campus_user,node_planner toneIndigo
```

## Components

### Authentication

- [Auth API server](https://github.com/abhishekrk0001/aps-erp/blob/main/authentication/server.js): `authentication/server.js`
- [Auth and user routes](https://github.com/abhishekrk0001/aps-erp/blob/main/authentication/src/routes/userRoutes.js): `authentication/src/routes/userRoutes.js`
- [Login and tokens](https://github.com/abhishekrk0001/aps-erp/blob/main/authentication/src/controllers/authController.js): `authentication/src/controllers/authController.js`
- [User provisioning](https://github.com/abhishekrk0001/aps-erp/blob/main/authentication/src/controllers/userController.js): `authentication/src/controllers/userController.js`
- [Identity records](https://github.com/abhishekrk0001/aps-erp/blob/main/authentication/src/models/User.js): `authentication/src/models/User.js`
- [Audit records](https://github.com/abhishekrk0001/aps-erp/blob/main/authentication/src/models/AuditLog.js): `authentication/src/models/AuditLog.js`
- [OTP operations](https://github.com/abhishekrk0001/aps-erp/blob/main/authentication/src/controllers/otpController.js): `authentication/src/controllers/otpController.js`
- [Rate limiting](https://github.com/abhishekrk0001/aps-erp/blob/main/authentication/src/middlewares/rateLimiter.js): `authentication/src/middlewares/rateLimiter.js`

### Leave Management

- [Leave dashboards](https://github.com/abhishekrk0001/aps-erp/blob/main/leave-management/frontend/src/App.js): `leave-management/frontend/src/App.js`
- [Leave API routes](https://github.com/abhishekrk0001/aps-erp/blob/main/leave-management/backend/routes/leaveRoutes.js): `leave-management/backend/routes/leaveRoutes.js`
- [Leave requests](https://github.com/abhishekrk0001/aps-erp/blob/main/leave-management/backend/controllers/leaveController.js): `leave-management/backend/controllers/leaveController.js`
- [Approval workflow](https://github.com/abhishekrk0001/aps-erp/blob/main/leave-management/backend/services/leaveWorkflow.js): `leave-management/backend/services/leaveWorkflow.js`
- [Leave and balances](https://github.com/abhishekrk0001/aps-erp/blob/main/leave-management/backend/models/Leave.js): `leave-management/backend/models/Leave.js`
- [Substitute routes](https://github.com/abhishekrk0001/aps-erp/blob/main/leave-management/backend/routes/substituteRoutes.js): `leave-management/backend/routes/substituteRoutes.js`
- [Coverage requests](https://github.com/abhishekrk0001/aps-erp/blob/main/leave-management/backend/controllers/substituteController.js): `leave-management/backend/controllers/substituteController.js`
- [Substitute assignments](https://github.com/abhishekrk0001/aps-erp/blob/main/leave-management/backend/models/SubstituteRequest.js): `leave-management/backend/models/SubstituteRequest.js`

### Noticeboard

- [Notice portal](https://github.com/abhishekrk0001/aps-erp/blob/main/noticeboard/app/portal/page.tsx): `noticeboard/app/portal/page.tsx`
- [Notice publishing](https://github.com/abhishekrk0001/aps-erp/blob/main/noticeboard/app/api/notices/route.ts): `noticeboard/app/api/notices/route.ts`
- [Notice approvals](https://github.com/abhishekrk0001/aps-erp/blob/main/noticeboard/app/api/notices/%5Bid%5D/approval/route.ts): `noticeboard/app/api/notices/[id]/approval/route.ts`
- [Campus feed](https://github.com/abhishekrk0001/aps-erp/blob/main/noticeboard/app/api/feed/route.ts): `noticeboard/app/api/feed/route.ts`
- [Academic cycle](https://github.com/abhishekrk0001/aps-erp/blob/main/noticeboard/app/api/academic-cycle/advance/route.ts): `noticeboard/app/api/academic-cycle/advance/route.ts`
- [Notifications](https://github.com/abhishekrk0001/aps-erp/blob/main/noticeboard/app/api/notifications/route.ts): `noticeboard/app/api/notifications/route.ts`

### Timetable Planning

- [Planning screens](https://github.com/abhishekrk0001/aps-erp/blob/main/timetable/timetable-frontend/src/App.jsx): `timetable/timetable-frontend/src/App.jsx`
- [Timetable API routes](https://github.com/abhishekrk0001/aps-erp/blob/main/timetable/server/routes/timetableRoutes.js): `timetable/server/routes/timetableRoutes.js`
- [Generation and edits](https://github.com/abhishekrk0001/aps-erp/blob/main/timetable/server/controllers/timetableController.js): `timetable/server/controllers/timetableController.js`
- [Constraint generator](https://github.com/abhishekrk0001/aps-erp/blob/main/timetable/server/services/generator.js): `timetable/server/services/generator.js`
- [Planning records](https://github.com/abhishekrk0001/aps-erp/blob/main/timetable/server/models/Subject.js): `timetable/server/models/Subject.js`
- [Saved timetables](https://github.com/abhishekrk0001/aps-erp/blob/main/timetable/server/models/Timetable.js): `timetable/server/models/Timetable.js`

### Other components

- **Campus administrator**
- **Teacher or approver**
- **Campus community member**
- **Timetable planner**

## Connections

- Auth API server → Auth and user routes: mounts routes (evidence: `authentication/server.js`)
- Auth and user routes → User provisioning: dispatches creation (evidence: `authentication/src/routes/userRoutes.js`)
- Auth and user routes → Rate limiting: limits requests
- User provisioning → Identity records: creates accounts (evidence: `authentication/src/controllers/userController.js`)
- User provisioning → Audit records: logs creation (evidence: `authentication/src/controllers/userController.js`)
- User provisioning → OTP operations: creates OTP (evidence: `authentication/src/controllers/userController.js`)
- Login and tokens → Identity records: checks credentials (evidence: `authentication/src/controllers/authController.js`)
- Login and tokens → Audit records: logs login (evidence: `authentication/src/controllers/authController.js`)
- Teacher or approver → Leave dashboards: uses dashboards
- Leave API routes → Leave requests: dispatches requests (evidence: `leave-management/backend/routes/leaveRoutes.js`)
- Leave requests → Approval workflow: submits approvals (evidence: `leave-management/backend/controllers/leaveController.js`)
- Leave requests → Leave and balances: reads leave data (evidence: `leave-management/backend/controllers/leaveController.js`)
- Substitute routes → Coverage requests: dispatches coverage (evidence: `leave-management/backend/routes/substituteRoutes.js`)
- Coverage requests → Approval workflow: requests assignment (evidence: `leave-management/backend/controllers/substituteController.js`)
- Coverage requests → Substitute assignments: reads requests (evidence: `leave-management/backend/controllers/substituteController.js`)
- Campus community member → Notice portal: uses portal
- Timetable planner → Planning screens: uses planner
- Planning screens → Generation and edits: requests generation
- Timetable API routes → Generation and edits: dispatches operations (evidence: `timetable/server/routes/timetableRoutes.js`)
- Generation and edits → Constraint generator: generates and validates (evidence: `timetable/server/controllers/timetableController.js`)
- Generation and edits → Planning records: loads planning data (evidence: `timetable/server/controllers/timetableController.js`)
- Generation and edits → Saved timetables: saves timetable (evidence: `timetable/server/controllers/timetableController.js`)
