# naf7111/workforge architecture

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

- Interactive diagram: https://gitdiagram.com/naf7111/workforge
- Repository: https://github.com/naf7111/workforge

## Overview

WorkForge is an internal workforce lifecycle platform: staff coordinate employee onboarding, approvals and task fulfillment, with optional asset assignment and manually evidenced access; the product also covers employee changes and offboarding. HR and IT users work through the web application, while a separate worker handles approved directory operations. The graph preserves the major README capabilities, including automation, assets, directory reconciliation and reporting. The excerpts show selected controller/service behavior; links among other subsystems are included only where supported by the README or source paths, not as a claim that every implementation detail was inspected.

Main entry points: [`WorkForge.Infrastructure/Persistence/ApplicationDbContext.cs`](https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Persistence/ApplicationDbContext.cs) (Application data access), [`WorkForge.Web/Program.cs`](https://github.com/naf7111/workforge/blob/master/WorkForge.Web/Program.cs) (WorkForge web), [`WorkForge.Infrastructure/Services/AutomationService.cs`](https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/AutomationService.cs) (Automation runs), [`WorkForge.Infrastructure/Services/OnboardingWorkflowCoordinator.cs`](https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/OnboardingWorkflowCoordinator.cs) (Onboarding workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_webapp["WorkForge web<br/>[Program.cs]"]
  node_employeeui["Employee and lifecycle endpoints"]
  node_onboardui["Onboarding endpoints"]
  node_offboardui["Offboarding endpoints"]
  node_directoryui["Directory workspace"]
  node_automationui["Automation workspace"]
end

subgraph group_people["Workforce lifecycle"]
  node_employee["Employee administration<br/>[EmployeeService.cs]"]
  node_onboarding["Onboarding workflows"]
  node_employeechanges["Employee changes"]
  node_offboarding["Offboarding cases"]
end

subgraph group_fulfillment["Fulfillment and automation"]
  node_assets["Asset fulfillment"]
  node_access["Access fulfillment"]
  node_automation["Automation runs"]
  node_outbox["Automation outbox"]
end

subgraph group_directory["Directory integration"]
  node_directoryservices["Directory planning and operations"]
  node_adclient["AD connector"]
  node_dirqueue["Directory job processor"]
  node_dirworker["Directory worker host"]
end

subgraph group_data["Persistence"]
  node_dbcontext["Application data access"]
end

node_staff(("HR and IT staff"))
node_ad["Active Directory"]
node_sql[("SQL Server")]
node_power["PowerShell runner"]
node_webhook["Webhook endpoints"]

node_staff -->|"use"| node_webapp
node_webapp -->|"routes"| node_employeeui
node_webapp -->|"routes"| node_onboardui
node_webapp -->|"routes"| node_offboardui
node_webapp -->|"routes"| node_directoryui
node_webapp -->|"routes"| node_automationui
node_employeeui -->|"manages employees"| node_employee
node_onboardui -->|"manages cases"| node_onboarding
node_offboardui -->|"manages cases"| node_offboarding
node_directoryui -->|"requests operations"| node_directoryservices
node_automationui -->|"manages runs"| node_automation
node_onboarding -->|"records triggers"| node_outbox
node_automation -->|"records triggers"| node_outbox
node_outbox -->|"creates runs"| node_automation
node_onboarding -->|"coordinates fulfillment"| node_assets
node_onboarding -->|"coordinates fulfillment"| node_access
node_dirworker -->|"processes jobs"| node_dirqueue
node_dirqueue -->|"executes operations"| node_adclient
node_adclient -->|"LDAP operations"| node_ad
node_automation -.->|"runs approved packages"| node_power
node_automation -.->|"delivers webhooks"| node_webhook
node_employee -->|"reads and writes"| node_dbcontext
node_onboarding -->|"reads and writes"| node_dbcontext
node_employeechanges -->|"reads and writes"| node_dbcontext
node_offboarding -->|"reads and writes"| node_dbcontext
node_assets -->|"reads and writes"| node_dbcontext
node_access -->|"reads and writes"| node_dbcontext
node_automation -->|"reads and writes"| node_dbcontext
node_directoryservices -->|"reads and writes"| node_dbcontext
node_dirqueue -->|"leases jobs"| node_dbcontext
node_dbcontext -->|"persists state"| node_sql

click node_webapp "https://github.com/naf7111/workforge/blob/master/WorkForge.Web/Program.cs"
click node_employeeui "https://github.com/naf7111/workforge/blob/master/WorkForge.Web/Controllers/EmployeesController.cs"
click node_onboardui "https://github.com/naf7111/workforge/blob/master/WorkForge.Web/Controllers/OnboardingCasesController.cs"
click node_offboardui "https://github.com/naf7111/workforge/blob/master/WorkForge.Web/Controllers/OffboardingCasesController.cs"
click node_directoryui "https://github.com/naf7111/workforge/blob/master/WorkForge.Web/Controllers/DirectoryController.cs"
click node_automationui "https://github.com/naf7111/workforge/blob/master/WorkForge.Web/Controllers/AutomationController.cs"
click node_employee "https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/EmployeeService.cs"
click node_onboarding "https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/OnboardingWorkflowCoordinator.cs"
click node_employeechanges "https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/EmployeeChangeCaseService.cs"
click node_offboarding "https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/OffboardingCaseService.cs"
click node_assets "https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/AssetFulfillmentService.cs"
click node_access "https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/AccessProvisioningService.cs"
click node_automation "https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/AutomationService.cs"
click node_outbox "https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/AutomationOutboxProcessor.cs"
click node_directoryservices "https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/DirectoryServices.cs"
click node_adclient "https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Directory/ActiveDirectoryClients.cs"
click node_dirqueue "https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/DirectoryQueueProcessor.cs"
click node_dirworker "https://github.com/naf7111/workforge/blob/master/WorkForge.DirectoryWorker/DirectoryWorkerService.cs"
click node_dbcontext "https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Persistence/ApplicationDbContext.cs"

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_webapp,node_employeeui,node_onboardui,node_offboardui,node_directoryui,node_automationui toneBlue
class node_employee,node_onboarding,node_employeechanges,node_offboarding,node_sql toneAmber
class node_assets,node_access,node_automation,node_outbox,node_webhook toneMint
class node_directoryservices,node_adclient,node_dirqueue,node_dirworker toneRose
class node_dbcontext,node_staff,node_ad,node_power toneIndigo
```

## Components

### Web application

- [WorkForge web](https://github.com/naf7111/workforge/blob/master/WorkForge.Web/Program.cs): `WorkForge.Web/Program.cs`
- [Employee and lifecycle endpoints](https://github.com/naf7111/workforge/blob/master/WorkForge.Web/Controllers/EmployeesController.cs): `WorkForge.Web/Controllers/EmployeesController.cs`
- [Onboarding endpoints](https://github.com/naf7111/workforge/blob/master/WorkForge.Web/Controllers/OnboardingCasesController.cs): `WorkForge.Web/Controllers/OnboardingCasesController.cs`
- [Offboarding endpoints](https://github.com/naf7111/workforge/blob/master/WorkForge.Web/Controllers/OffboardingCasesController.cs): `WorkForge.Web/Controllers/OffboardingCasesController.cs`
- [Directory workspace](https://github.com/naf7111/workforge/blob/master/WorkForge.Web/Controllers/DirectoryController.cs): `WorkForge.Web/Controllers/DirectoryController.cs`
- [Automation workspace](https://github.com/naf7111/workforge/blob/master/WorkForge.Web/Controllers/AutomationController.cs): `WorkForge.Web/Controllers/AutomationController.cs`

### Workforce lifecycle

- [Employee administration](https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/EmployeeService.cs): `WorkForge.Infrastructure/Services/EmployeeService.cs`
- [Onboarding workflows](https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/OnboardingWorkflowCoordinator.cs): `WorkForge.Infrastructure/Services/OnboardingWorkflowCoordinator.cs`
- [Employee changes](https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/EmployeeChangeCaseService.cs): `WorkForge.Infrastructure/Services/EmployeeChangeCaseService.cs`
- [Offboarding cases](https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/OffboardingCaseService.cs): `WorkForge.Infrastructure/Services/OffboardingCaseService.cs`

### Fulfillment and automation

- [Asset fulfillment](https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/AssetFulfillmentService.cs): `WorkForge.Infrastructure/Services/AssetFulfillmentService.cs`
- [Access fulfillment](https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/AccessProvisioningService.cs): `WorkForge.Infrastructure/Services/AccessProvisioningService.cs`
- [Automation runs](https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/AutomationService.cs): `WorkForge.Infrastructure/Services/AutomationService.cs`
- [Automation outbox](https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/AutomationOutboxProcessor.cs): `WorkForge.Infrastructure/Services/AutomationOutboxProcessor.cs`

### Directory integration

- [Directory planning and operations](https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/DirectoryServices.cs): `WorkForge.Infrastructure/Services/DirectoryServices.cs`
- [AD connector](https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Directory/ActiveDirectoryClients.cs): `WorkForge.Infrastructure/Directory/ActiveDirectoryClients.cs`
- [Directory job processor](https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Services/DirectoryQueueProcessor.cs): `WorkForge.Infrastructure/Services/DirectoryQueueProcessor.cs`
- [Directory worker host](https://github.com/naf7111/workforge/blob/master/WorkForge.DirectoryWorker/DirectoryWorkerService.cs): `WorkForge.DirectoryWorker/DirectoryWorkerService.cs`

### Persistence

- [Application data access](https://github.com/naf7111/workforge/blob/master/WorkForge.Infrastructure/Persistence/ApplicationDbContext.cs): `WorkForge.Infrastructure/Persistence/ApplicationDbContext.cs`

### Other components

- **HR and IT staff**
- **Active Directory**
- **SQL Server**
- **PowerShell runner**
- **Webhook endpoints**

## Connections

- HR and IT staff → WorkForge web: use
- WorkForge web → Employee and lifecycle endpoints: routes
- WorkForge web → Onboarding endpoints: routes
- WorkForge web → Offboarding endpoints: routes
- WorkForge web → Directory workspace: routes
- WorkForge web → Automation workspace: routes
- Employee and lifecycle endpoints → Employee administration: manages employees
- Onboarding endpoints → Onboarding workflows: manages cases
- Offboarding endpoints → Offboarding cases: manages cases
- Directory workspace → Directory planning and operations: requests operations
- Automation workspace → Automation runs: manages runs
- Onboarding workflows → Automation outbox: records triggers
- Automation runs → Automation outbox: records triggers
- Automation outbox → Automation runs: creates runs
- Onboarding workflows → Asset fulfillment: coordinates fulfillment
- Onboarding workflows → Access fulfillment: coordinates fulfillment
- Directory worker host → Directory job processor: processes jobs
- Directory job processor → AD connector: executes operations
- AD connector → Active Directory: LDAP operations
- Automation runs → PowerShell runner: runs approved packages
- Automation runs → Webhook endpoints: delivers webhooks
- Employee administration → Application data access: reads and writes
- Onboarding workflows → Application data access: reads and writes
- Employee changes → Application data access: reads and writes
- Offboarding cases → Application data access: reads and writes
- Asset fulfillment → Application data access: reads and writes
- Access fulfillment → Application data access: reads and writes
- Automation runs → Application data access: reads and writes
- Directory planning and operations → Application data access: reads and writes
- Directory job processor → Application data access: leases jobs
- Application data access → SQL Server: persists state
