# macworldgithub/neximet-backend architecture

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

- Interactive diagram: https://gitdiagram.com/macworldgithub/neximet-backend
- Repository: https://github.com/macworldgithub/neximet-backend

## Overview

Neximet is an enterprise portal backend for employee administration and project delivery. Users authenticate through the API, then use role- and department-scoped project/task, attendance/deduction, leave, and dashboard workflows; managers also maintain project scopes and time logs. The server mounts the documented route families, and controllers perform domain operations through Mongoose models. Sampled controller excerpts support several specific data relationships; unsampled controller internals are represented as domain capabilities without speculative wiring.

Main entry points: [`src/server.js`](https://github.com/macworldgithub/neximet-backend/blob/main/src/server.js) (Express server), [`src/middleware/auth.js`](https://github.com/macworldgithub/neximet-backend/blob/main/src/middleware/auth.js) (Authentication), [`src/middleware/rbac.js`](https://github.com/macworldgithub/neximet-backend/blob/main/src/middleware/rbac.js) (Role authorization), [`src/routes/projectRoutes.js`](https://github.com/macworldgithub/neximet-backend/blob/main/src/routes/projectRoutes.js) (Project routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry"]
  node_server["Express server<br/>[server.js]"]
  node_dbconfig["DB connection<br/>[db.js]"]
end

subgraph group_identity["Identity and access"]
  node_authroutes["Auth routes<br/>[authRoutes.js]"]
  node_authcontroller["Identity management<br/>[authController.js]"]
  node_authmw["Authentication<br/>[auth.js]"]
  node_rbac["Role authorization<br/>[rbac.js]"]
end

subgraph group_delivery["Project delivery"]
  node_projectroutes["Project routes<br/>[projectRoutes.js]"]
  node_projectcontroller["Project operations"]
  node_taskroutes["Task routes<br/>[taskRoutes.js]"]
  node_taskcontroller["Task and time logs<br/>[taskController.js]"]
  node_uploadmw["Scope uploads<br/>[upload.js]"]
end

subgraph group_people["Workforce operations"]
  node_dashroutes["Dashboard routes<br/>[dashboardRoutes.js]"]
  node_dashcontroller["Workforce dashboard"]
  node_attendroutes["Attendance routes"]
  node_attendcontroller["Attendance and pay"]
  node_deductroutes["Deduction routes<br/>[deductionRoutes.js]"]
  node_deductcontroller["Deduction rules"]
  node_leaveroutes["Leave routes<br/>[leaveRoutes.js]"]
  node_leavecontroller["Leave management<br/>[leaveController.js]"]
end

subgraph group_persistence["Persistence"]
  node_usermodel["Employee records<br/>[User.js]"]
  node_projectmodel["Project records<br/>[Project.js]"]
  node_taskmodel["Task records<br/>[Task.js]"]
  node_timelogmodel["Time records<br/>[TimeLog.js]"]
  node_attendmodel["Attendance records<br/>[Attendance.js]"]
  node_deductmodel["Deduction rules<br/>[DeductionRule.js]"]
  node_leavemodel["Leave requests<br/>[LeaveRequest.js]"]
  node_holidaymodel["Holiday records<br/>[Holiday.js]"]
end

node_client(("Portal clients"))
node_mongodb[("MongoDB")]

node_client -->|"sends requests"| node_server
node_server -->|"connects"| node_dbconfig
node_server -->|"mounts API"| node_authroutes
node_server -->|"mounts API"| node_projectroutes
node_server -->|"mounts API"| node_taskroutes
node_server -->|"mounts API"| node_dashroutes
node_server -->|"mounts API"| node_attendroutes
node_server -->|"mounts API"| node_deductroutes
node_server -->|"mounts API"| node_leaveroutes
node_dbconfig -->|"connects"| node_mongodb
node_authroutes -->|"protects routes"| node_authmw
node_authroutes -->|"checks roles"| node_rbac
node_authroutes -->|"dispatches"| node_authcontroller
node_authcontroller -->|"reads and writes"| node_usermodel
node_projectroutes -->|"protects routes"| node_authmw
node_projectroutes -->|"checks roles"| node_rbac
node_projectroutes -->|"parses uploads"| node_uploadmw
node_projectroutes -->|"dispatches"| node_projectcontroller
node_projectcontroller -->|"reads and writes"| node_projectmodel
node_projectcontroller -->|"reads tasks"| node_taskmodel
node_taskroutes -->|"protects routes"| node_authmw
node_taskroutes -->|"checks roles"| node_rbac
node_taskroutes -->|"dispatches"| node_taskcontroller
node_taskcontroller -->|"reads and writes"| node_taskmodel
node_taskcontroller -->|"reads and writes"| node_timelogmodel
node_taskcontroller -->|"reads and updates"| node_projectmodel
node_dashroutes -->|"protects routes"| node_authmw
node_dashroutes -->|"dispatches"| node_dashcontroller
node_dashcontroller -->|"reads projects"| node_projectmodel
node_dashcontroller -->|"reads employees"| node_usermodel
node_dashcontroller -->|"reads attendance"| node_attendmodel
node_dashcontroller -->|"reads leave"| node_leavemodel
node_attendroutes -->|"protects routes"| node_authmw
node_attendroutes -->|"checks roles"| node_rbac
node_attendroutes -->|"dispatches"| node_attendcontroller
node_attendcontroller -->|"reads employee"| node_usermodel
node_attendcontroller -->|"reads rules"| node_deductmodel
node_attendcontroller -->|"reads and writes"| node_attendmodel
node_deductroutes -->|"protects routes"| node_authmw
node_deductroutes -->|"checks roles"| node_rbac
node_deductroutes -->|"dispatches"| node_deductcontroller
node_deductcontroller -->|"reads and writes"| node_deductmodel
node_deductcontroller -->|"reads records"| node_attendmodel
node_leaveroutes -->|"protects routes"| node_authmw
node_leaveroutes -->|"checks roles"| node_rbac
node_leaveroutes -->|"dispatches"| node_leavecontroller
node_leavecontroller -->|"reads and writes"| node_leavemodel
node_leavecontroller -->|"reads and writes"| node_holidaymodel

click node_server "https://github.com/macworldgithub/neximet-backend/blob/main/src/server.js"
click node_dbconfig "https://github.com/macworldgithub/neximet-backend/blob/main/src/config/db.js"
click node_authroutes "https://github.com/macworldgithub/neximet-backend/blob/main/src/routes/authRoutes.js"
click node_authcontroller "https://github.com/macworldgithub/neximet-backend/blob/main/src/controllers/authController.js"
click node_authmw "https://github.com/macworldgithub/neximet-backend/blob/main/src/middleware/auth.js"
click node_rbac "https://github.com/macworldgithub/neximet-backend/blob/main/src/middleware/rbac.js"
click node_projectroutes "https://github.com/macworldgithub/neximet-backend/blob/main/src/routes/projectRoutes.js"
click node_projectcontroller "https://github.com/macworldgithub/neximet-backend/blob/main/src/controllers/projectController.js"
click node_taskroutes "https://github.com/macworldgithub/neximet-backend/blob/main/src/routes/taskRoutes.js"
click node_taskcontroller "https://github.com/macworldgithub/neximet-backend/blob/main/src/controllers/taskController.js"
click node_uploadmw "https://github.com/macworldgithub/neximet-backend/blob/main/src/middleware/upload.js"
click node_dashroutes "https://github.com/macworldgithub/neximet-backend/blob/main/src/routes/dashboardRoutes.js"
click node_dashcontroller "https://github.com/macworldgithub/neximet-backend/blob/main/src/controllers/dashboardController.js"
click node_attendroutes "https://github.com/macworldgithub/neximet-backend/blob/main/src/routes/attendanceRoutes.js"
click node_attendcontroller "https://github.com/macworldgithub/neximet-backend/blob/main/src/controllers/attendanceController.js"
click node_deductroutes "https://github.com/macworldgithub/neximet-backend/blob/main/src/routes/deductionRoutes.js"
click node_deductcontroller "https://github.com/macworldgithub/neximet-backend/blob/main/src/controllers/deductionController.js"
click node_leaveroutes "https://github.com/macworldgithub/neximet-backend/blob/main/src/routes/leaveRoutes.js"
click node_leavecontroller "https://github.com/macworldgithub/neximet-backend/blob/main/src/controllers/leaveController.js"
click node_usermodel "https://github.com/macworldgithub/neximet-backend/blob/main/src/models/User.js"
click node_projectmodel "https://github.com/macworldgithub/neximet-backend/blob/main/src/models/Project.js"
click node_taskmodel "https://github.com/macworldgithub/neximet-backend/blob/main/src/models/Task.js"
click node_timelogmodel "https://github.com/macworldgithub/neximet-backend/blob/main/src/models/TimeLog.js"
click node_attendmodel "https://github.com/macworldgithub/neximet-backend/blob/main/src/models/Attendance.js"
click node_deductmodel "https://github.com/macworldgithub/neximet-backend/blob/main/src/models/DeductionRule.js"
click node_leavemodel "https://github.com/macworldgithub/neximet-backend/blob/main/src/models/LeaveRequest.js"
click node_holidaymodel "https://github.com/macworldgithub/neximet-backend/blob/main/src/models/Holiday.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_server,node_dbconfig,node_client toneBlue
class node_authroutes,node_authcontroller,node_authmw,node_rbac,node_mongodb toneAmber
class node_projectroutes,node_projectcontroller,node_taskroutes,node_taskcontroller,node_uploadmw toneMint
class node_dashroutes,node_dashcontroller,node_attendroutes,node_attendcontroller,node_deductroutes,node_deductcontroller,node_leaveroutes,node_leavecontroller toneRose
class node_usermodel,node_projectmodel,node_taskmodel,node_timelogmodel,node_attendmodel,node_deductmodel,node_leavemodel,node_holidaymodel toneIndigo
```

## Components

### API entry

- [Express server](https://github.com/macworldgithub/neximet-backend/blob/main/src/server.js): `src/server.js`
- [DB connection](https://github.com/macworldgithub/neximet-backend/blob/main/src/config/db.js): `src/config/db.js`

### Identity and access

- [Auth routes](https://github.com/macworldgithub/neximet-backend/blob/main/src/routes/authRoutes.js): `src/routes/authRoutes.js`
- [Identity management](https://github.com/macworldgithub/neximet-backend/blob/main/src/controllers/authController.js): `src/controllers/authController.js`
- [Authentication](https://github.com/macworldgithub/neximet-backend/blob/main/src/middleware/auth.js): `src/middleware/auth.js`
- [Role authorization](https://github.com/macworldgithub/neximet-backend/blob/main/src/middleware/rbac.js): `src/middleware/rbac.js`

### Project delivery

- [Project routes](https://github.com/macworldgithub/neximet-backend/blob/main/src/routes/projectRoutes.js): `src/routes/projectRoutes.js`
- [Project operations](https://github.com/macworldgithub/neximet-backend/blob/main/src/controllers/projectController.js): `src/controllers/projectController.js`
- [Task routes](https://github.com/macworldgithub/neximet-backend/blob/main/src/routes/taskRoutes.js): `src/routes/taskRoutes.js`
- [Task and time logs](https://github.com/macworldgithub/neximet-backend/blob/main/src/controllers/taskController.js): `src/controllers/taskController.js`
- [Scope uploads](https://github.com/macworldgithub/neximet-backend/blob/main/src/middleware/upload.js): `src/middleware/upload.js`

### Workforce operations

- [Dashboard routes](https://github.com/macworldgithub/neximet-backend/blob/main/src/routes/dashboardRoutes.js): `src/routes/dashboardRoutes.js`
- [Workforce dashboard](https://github.com/macworldgithub/neximet-backend/blob/main/src/controllers/dashboardController.js): `src/controllers/dashboardController.js`
- [Attendance routes](https://github.com/macworldgithub/neximet-backend/blob/main/src/routes/attendanceRoutes.js): `src/routes/attendanceRoutes.js`
- [Attendance and pay](https://github.com/macworldgithub/neximet-backend/blob/main/src/controllers/attendanceController.js): `src/controllers/attendanceController.js`
- [Deduction routes](https://github.com/macworldgithub/neximet-backend/blob/main/src/routes/deductionRoutes.js): `src/routes/deductionRoutes.js`
- [Deduction rules](https://github.com/macworldgithub/neximet-backend/blob/main/src/controllers/deductionController.js): `src/controllers/deductionController.js`
- [Leave routes](https://github.com/macworldgithub/neximet-backend/blob/main/src/routes/leaveRoutes.js): `src/routes/leaveRoutes.js`
- [Leave management](https://github.com/macworldgithub/neximet-backend/blob/main/src/controllers/leaveController.js): `src/controllers/leaveController.js`

### Persistence

- [Employee records](https://github.com/macworldgithub/neximet-backend/blob/main/src/models/User.js): `src/models/User.js`
- [Project records](https://github.com/macworldgithub/neximet-backend/blob/main/src/models/Project.js): `src/models/Project.js`
- [Task records](https://github.com/macworldgithub/neximet-backend/blob/main/src/models/Task.js): `src/models/Task.js`
- [Time records](https://github.com/macworldgithub/neximet-backend/blob/main/src/models/TimeLog.js): `src/models/TimeLog.js`
- [Attendance records](https://github.com/macworldgithub/neximet-backend/blob/main/src/models/Attendance.js): `src/models/Attendance.js`
- [Deduction rules](https://github.com/macworldgithub/neximet-backend/blob/main/src/models/DeductionRule.js): `src/models/DeductionRule.js`
- [Leave requests](https://github.com/macworldgithub/neximet-backend/blob/main/src/models/LeaveRequest.js): `src/models/LeaveRequest.js`
- [Holiday records](https://github.com/macworldgithub/neximet-backend/blob/main/src/models/Holiday.js): `src/models/Holiday.js`

### Other components

- **Portal clients**
- **MongoDB**

## Connections

- Portal clients → Express server: sends requests
- Express server → DB connection: connects
- Express server → Auth routes: mounts API
- Express server → Project routes: mounts API
- Express server → Task routes: mounts API
- Express server → Dashboard routes: mounts API
- Express server → Attendance routes: mounts API
- Express server → Deduction routes: mounts API
- Express server → Leave routes: mounts API
- DB connection → MongoDB: connects
- Auth routes → Authentication: protects routes
- Auth routes → Role authorization: checks roles
- Auth routes → Identity management: dispatches
- Identity management → Employee records: reads and writes
- Project routes → Authentication: protects routes
- Project routes → Role authorization: checks roles
- Project routes → Scope uploads: parses uploads
- Project routes → Project operations: dispatches
- Project operations → Project records: reads and writes
- Project operations → Task records: reads tasks
- Task routes → Authentication: protects routes
- Task routes → Role authorization: checks roles
- Task routes → Task and time logs: dispatches
- Task and time logs → Task records: reads and writes
- Task and time logs → Time records: reads and writes
- Task and time logs → Project records: reads and updates
- Dashboard routes → Authentication: protects routes
- Dashboard routes → Workforce dashboard: dispatches
- Workforce dashboard → Project records: reads projects
- Workforce dashboard → Employee records: reads employees
- Workforce dashboard → Attendance records: reads attendance
- Workforce dashboard → Leave requests: reads leave
- Attendance routes → Authentication: protects routes
- Attendance routes → Role authorization: checks roles
- Attendance routes → Attendance and pay: dispatches
- Attendance and pay → Employee records: reads employee
- Attendance and pay → Deduction rules: reads rules
- Attendance and pay → Attendance records: reads and writes
- Deduction routes → Authentication: protects routes
- Deduction routes → Role authorization: checks roles
- Deduction routes → Deduction rules: dispatches
- Deduction rules → Deduction rules: reads and writes
- Deduction rules → Attendance records: reads records
- Leave routes → Authentication: protects routes
- Leave routes → Role authorization: checks roles
- Leave routes → Leave management: dispatches
- Leave management → Leave requests: reads and writes
- Leave management → Holiday records: reads and writes
