# sagegallant/eoms architecture

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

- Interactive diagram: https://gitdiagram.com/sagegallant/eoms
- Repository: https://github.com/sagegallant/eoms

## Overview

EOMS is an employee onboarding and statutory-compliance platform. Staff sign in, receive role-specific workspaces, and manage employee setup through phased onboarding, tasks, document review, asset provisioning, and required training; dashboards and reports expose progress, while audit and RBAC support oversight. The graph distinguishes the web workflow from API/domain handling and persistent data. README describes the overall server-to-database architecture; source-index references and excerpts support selected links, so unsampled feature internals and some server dispatch details are not expanded.

Main entry points: [`client/src/api/client.js`](https://github.com/sagegallant/eoms/blob/main/client/src/api/client.js) (HTTP client), [`server/src/controllers`](https://github.com/sagegallant/eoms/tree/main/server/src/controllers) (Domain controllers), [`client/src/routes/AppRoutes.jsx`](https://github.com/sagegallant/eoms/blob/main/client/src/routes/AppRoutes.jsx) (Role-based routes), [`server/src/routes`](https://github.com/sagegallant/eoms/tree/main/server/src/routes) (REST routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_routes["Role-based routes<br/>[AppRoutes.jsx]"]
  node_shell["Application shell<br/>[AppShell.jsx]"]
  node_authstate["Session state<br/>[authStore.js]"]
  node_views["Role dashboards"]
end

subgraph group_lifecycle["Employee lifecycle"]
  node_directory["Employee directory"]
  node_onboarding["Onboarding plans<br/>[OnboardingView.jsx]"]
  node_tasks["Checklist tasks<br/>[TasksView.jsx]"]
  node_documents["Statutory documents<br/>[DocumentsView.jsx]"]
  node_assets["IT assets"]
  node_training["Required training<br/>[TrainingView.jsx]"]
  node_notifications["Notifications"]
  node_reports["Reports and audit<br/>[ReportsView.jsx]"]
end

subgraph group_api["API and security"]
  node_http["HTTP client<br/>[client.js]"]
  node_authguard["Authentication and RBAC"]
  node_router["REST routes"]
end

subgraph group_domains["Server domains"]
  node_controllers["Domain controllers"]
  node_audit["Audit logging<br/>[audit.service.js]"]
  node_files["Document storage<br/>[storage.service.js]"]
end

subgraph group_data["Persistence"]
  node_models["Relational models"]
  node_mysql[("MySQL database<br/>[db.js]")]
end

node_user(("Staff user"))

node_user -->|"uses"| node_routes
node_routes -->|"selects dashboard"| node_views
node_routes -->|"renders within"| node_shell
node_shell -->|"reads session"| node_authstate
node_authstate -->|"authenticates through"| node_http
node_directory -->|"requests employee data"| node_http
node_onboarding -->|"requests plan data"| node_http
node_tasks -->|"requests task data"| node_http
node_documents -->|"requests documents"| node_http
node_training -->|"requests courses"| node_http
node_http -->|"sends HTTP requests"| node_router
node_router -->|"guards routes"| node_authguard
node_router -->|"dispatches requests"| node_controllers
node_controllers -->|"reads and writes"| node_models
node_controllers -->|"records actions"| node_audit
node_controllers -->|"uses upload storage"| node_files
node_models -->|"persists relational data"| node_mysql
node_audit -->|"creates audit records"| node_models
node_views -.->|"includes observability"| node_reports
node_onboarding -.->|"organizes milestones"| node_tasks
node_documents -->|"stores uploads"| node_files

click node_routes "https://github.com/sagegallant/eoms/blob/main/client/src/routes/AppRoutes.jsx"
click node_shell "https://github.com/sagegallant/eoms/blob/main/client/src/components/layout/AppShell.jsx"
click node_authstate "https://github.com/sagegallant/eoms/blob/main/client/src/store/authStore.js"
click node_views "https://github.com/sagegallant/eoms/tree/main/client/src/features/dashboard"
click node_directory "https://github.com/sagegallant/eoms/blob/main/client/src/features/employees/EmployeeDirectory.jsx"
click node_onboarding "https://github.com/sagegallant/eoms/blob/main/client/src/features/onboarding/OnboardingView.jsx"
click node_tasks "https://github.com/sagegallant/eoms/blob/main/client/src/features/tasks/TasksView.jsx"
click node_documents "https://github.com/sagegallant/eoms/blob/main/client/src/features/documents/DocumentsView.jsx"
click node_assets "https://github.com/sagegallant/eoms/tree/main/client/src/features"
click node_training "https://github.com/sagegallant/eoms/blob/main/client/src/features/training/TrainingView.jsx"
click node_notifications "https://github.com/sagegallant/eoms/blob/main/client/src/features/notifications/NotificationsView.jsx"
click node_reports "https://github.com/sagegallant/eoms/blob/main/client/src/features/reports/ReportsView.jsx"
click node_http "https://github.com/sagegallant/eoms/blob/main/client/src/api/client.js"
click node_authguard "https://github.com/sagegallant/eoms/tree/main/server/src/middleware"
click node_router "https://github.com/sagegallant/eoms/tree/main/server/src/routes"
click node_controllers "https://github.com/sagegallant/eoms/tree/main/server/src/controllers"
click node_audit "https://github.com/sagegallant/eoms/blob/main/server/src/services/audit.service.js"
click node_files "https://github.com/sagegallant/eoms/blob/main/server/src/services/storage.service.js"
click node_models "https://github.com/sagegallant/eoms/tree/main/server/src/models"
click node_mysql "https://github.com/sagegallant/eoms/blob/main/server/src/config/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_routes,node_shell,node_authstate,node_views,node_user toneBlue
class node_directory,node_onboarding,node_tasks,node_documents,node_assets,node_training,node_notifications,node_reports toneAmber
class node_http,node_authguard,node_router toneMint
class node_controllers,node_audit,node_files toneRose
class node_models,node_mysql toneIndigo
```

## Components

### Web experience

- [Role-based routes](https://github.com/sagegallant/eoms/blob/main/client/src/routes/AppRoutes.jsx): `client/src/routes/AppRoutes.jsx`
- [Application shell](https://github.com/sagegallant/eoms/blob/main/client/src/components/layout/AppShell.jsx): `client/src/components/layout/AppShell.jsx`
- [Session state](https://github.com/sagegallant/eoms/blob/main/client/src/store/authStore.js): `client/src/store/authStore.js`
- [Role dashboards](https://github.com/sagegallant/eoms/tree/main/client/src/features/dashboard): `client/src/features/dashboard`

### Employee lifecycle

- [Employee directory](https://github.com/sagegallant/eoms/blob/main/client/src/features/employees/EmployeeDirectory.jsx): `client/src/features/employees/EmployeeDirectory.jsx`
- [Onboarding plans](https://github.com/sagegallant/eoms/blob/main/client/src/features/onboarding/OnboardingView.jsx): `client/src/features/onboarding/OnboardingView.jsx`
- [Checklist tasks](https://github.com/sagegallant/eoms/blob/main/client/src/features/tasks/TasksView.jsx): `client/src/features/tasks/TasksView.jsx`
- [Statutory documents](https://github.com/sagegallant/eoms/blob/main/client/src/features/documents/DocumentsView.jsx): `client/src/features/documents/DocumentsView.jsx`
- [IT assets](https://github.com/sagegallant/eoms/tree/main/client/src/features): `client/src/features`
- [Required training](https://github.com/sagegallant/eoms/blob/main/client/src/features/training/TrainingView.jsx): `client/src/features/training/TrainingView.jsx`
- [Notifications](https://github.com/sagegallant/eoms/blob/main/client/src/features/notifications/NotificationsView.jsx): `client/src/features/notifications/NotificationsView.jsx`
- [Reports and audit](https://github.com/sagegallant/eoms/blob/main/client/src/features/reports/ReportsView.jsx): `client/src/features/reports/ReportsView.jsx`

### API and security

- [HTTP client](https://github.com/sagegallant/eoms/blob/main/client/src/api/client.js): `client/src/api/client.js`
- [Authentication and RBAC](https://github.com/sagegallant/eoms/tree/main/server/src/middleware): `server/src/middleware`
- [REST routes](https://github.com/sagegallant/eoms/tree/main/server/src/routes): `server/src/routes`

### Server domains

- [Domain controllers](https://github.com/sagegallant/eoms/tree/main/server/src/controllers): `server/src/controllers`
- [Audit logging](https://github.com/sagegallant/eoms/blob/main/server/src/services/audit.service.js): `server/src/services/audit.service.js`
- [Document storage](https://github.com/sagegallant/eoms/blob/main/server/src/services/storage.service.js): `server/src/services/storage.service.js`

### Persistence

- [Relational models](https://github.com/sagegallant/eoms/tree/main/server/src/models): `server/src/models`
- [MySQL database](https://github.com/sagegallant/eoms/blob/main/server/src/config/db.js): `server/src/config/db.js`

### Other components

- **Staff user**

## Connections

- Staff user → Role-based routes: uses
- Role-based routes → Role dashboards: selects dashboard (evidence: `client/src/routes/AppRoutes.jsx`)
- Role-based routes → Application shell: renders within (evidence: `client/src/routes/AppRoutes.jsx`)
- Application shell → Session state: reads session (evidence: `client/src/components/layout/AppShell.jsx`)
- Session state → HTTP client: authenticates through (evidence: `client/src/store/authStore.js`)
- Employee directory → HTTP client: requests employee data (evidence: `client/src/features/employees/EmployeeDirectory.jsx`)
- Onboarding plans → HTTP client: requests plan data (evidence: `client/src/features/onboarding/OnboardingView.jsx`)
- Checklist tasks → HTTP client: requests task data (evidence: `client/src/features/tasks/TasksView.jsx`)
- Statutory documents → HTTP client: requests documents (evidence: `client/src/features/documents/DocumentsView.jsx`)
- Required training → HTTP client: requests courses (evidence: `client/src/features/training/TrainingView.jsx`)
- HTTP client → REST routes: sends HTTP requests
- REST routes → Authentication and RBAC: guards routes (evidence: `server/src/routes/task.routes.js`)
- REST routes → Domain controllers: dispatches requests (evidence: `server/src/routes/task.routes.js`)
- Domain controllers → Relational models: reads and writes (evidence: `server/src/controllers/training.controller.js`)
- Domain controllers → Audit logging: records actions (evidence: `server/src/controllers/training.controller.js`)
- Domain controllers → Document storage: uses upload storage (evidence: `server/src/controllers/document.controller.js`)
- Relational models → MySQL database: persists relational data (evidence: `server/src/models/index.js`)
- Audit logging → Relational models: creates audit records (evidence: `server/src/services/audit.service.js`)
- Role dashboards → Reports and audit: includes observability
- Onboarding plans → Checklist tasks: organizes milestones
- Statutory documents → Document storage: stores uploads
