# njabulo240/inventorysystem architecture

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

- Interactive diagram: https://gitdiagram.com/njabulo240/inventorysystem
- Repository: https://github.com/njabulo240/inventorysystem

## Overview

Inventory Management System combines an Angular asset-management interface with an ASP.NET Core API and SQL Server persistence. The main workflow is users managing inventory and assignments through the UI, which communicates with API controllers; controllers use a repository manager to access database-backed repositories. Separate capabilities include identity and JWT authentication, user/role administration, maintenance and service history, and reporting. The README documents these product features, while the sampled code gives direct evidence for assignment updates, repository wiring, and authentication. Unsampled feature connections are omitted where their runtime paths are not shown.

Main entry points: [`Repository/RepositoryManager.cs`](https://github.com/njabulo240/inventorysystem/blob/master/Repository/RepositoryManager.cs) (Repository manager), [`InventryUI/src/app`](https://github.com/njabulo240/inventorysystem/tree/master/InventryUI/src/app) (Angular app), [`Repository/RepositoryContext.cs`](https://github.com/njabulo240/inventorysystem/blob/master/Repository/RepositoryContext.cs) (EF repository context), [`InventrySystem/Controllers/AccountsController.cs`](https://github.com/njabulo240/inventorysystem/blob/master/InventrySystem/Controllers/AccountsController.cs) (Accounts controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Angular interface"]
  node_ui["Angular app"]
  node_auth_ui["Authentication client"]
  node_inventory_pages["Asset and admin pages"]
end

subgraph group_api["API and identity"]
  node_api_controllers["Inventory controllers"]
  node_accounts["Accounts controller"]
  node_jwt["JWT handler<br/>[JwtHandler.cs]"]
  node_user_identity["Identity user<br/>[User.cs]"]
end

subgraph group_inventory["Inventory operations"]
  node_assignments["Device assignments"]
  node_devices["Device inventory"]
end

subgraph group_persistence["Persistence"]
  node_repo_manager["Repository manager"]
  node_repositories["Domain repositories"]
  node_repo_context["EF repository context"]
end

subgraph group_support["Product capabilities"]
  node_maintenance["Maintenance schedules"]
  node_service_history["Service history"]
  node_reports["Reports and analytics<br/>[Report.cs]"]
  node_email["Email sender<br/>[EmailSender.cs]"]
  node_roles["Roles and permissions<br/>[RoleController.cs]"]
end

node_user(("Inventory user"))
node_sql[("SQL Server")]

node_user -->|"uses"| node_ui
node_ui -->|"calls API"| node_api_controllers
node_ui -->|"uses"| node_auth_ui
node_auth_ui -.->|"auth requests"| node_accounts
node_ui -->|"routes users"| node_inventory_pages
node_assignments -->|"uses repositories"| node_repo_manager
node_assignments -->|"updates device"| node_devices
node_api_controllers -.->|"uses repositories"| node_repo_manager
node_repo_manager -->|"creates"| node_repositories
node_repo_manager -->|"shares context"| node_repo_context
node_repositories -->|"accesses data"| node_repo_context
node_repo_context -->|"persists data"| node_sql
node_accounts -->|"generates token"| node_jwt
node_jwt -->|"reads claims"| node_user_identity
node_accounts -->|"sends messages"| node_email
node_repo_context -->|"maps entity"| node_reports
node_maintenance -.->|"uses repositories"| node_repo_manager
node_service_history -.->|"uses repositories"| node_repo_manager
node_roles -.->|"manages roles"| node_user_identity

click node_ui "https://github.com/njabulo240/inventorysystem/tree/master/InventryUI/src/app"
click node_auth_ui "https://github.com/njabulo240/inventorysystem/blob/master/InventryUI/src/app/shared/services/authentication.service.ts"
click node_inventory_pages "https://github.com/njabulo240/inventorysystem/tree/master/InventryUI/src/app/pages/ui-components"
click node_api_controllers "https://github.com/njabulo240/inventorysystem/tree/master/InventrySystem/Controllers"
click node_accounts "https://github.com/njabulo240/inventorysystem/blob/master/InventrySystem/Controllers/AccountsController.cs"
click node_jwt "https://github.com/njabulo240/inventorysystem/blob/master/InventrySystem/JwtFeatures/JwtHandler.cs"
click node_user_identity "https://github.com/njabulo240/inventorysystem/blob/master/Entities/Identity/User.cs"
click node_repo_manager "https://github.com/njabulo240/inventorysystem/blob/master/Repository/RepositoryManager.cs"
click node_repositories "https://github.com/njabulo240/inventorysystem/tree/master/Repository"
click node_repo_context "https://github.com/njabulo240/inventorysystem/blob/master/Repository/RepositoryContext.cs"
click node_assignments "https://github.com/njabulo240/inventorysystem/blob/master/InventrySystem/Controllers/DeviceAssignmentController.cs"
click node_devices "https://github.com/njabulo240/inventorysystem/blob/master/InventrySystem/Controllers/DeviceController.cs"
click node_maintenance "https://github.com/njabulo240/inventorysystem/blob/master/InventrySystem/Controllers/MaintenanceScheduleController.cs"
click node_service_history "https://github.com/njabulo240/inventorysystem/blob/master/InventrySystem/Controllers/ServiceHistoryController.cs"
click node_reports "https://github.com/njabulo240/inventorysystem/blob/master/Entities/Models/Report.cs"
click node_email "https://github.com/njabulo240/inventorysystem/blob/master/EmailService/EmailSender.cs"
click node_roles "https://github.com/njabulo240/inventorysystem/blob/master/InventrySystem/Controllers/RoleController.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_ui,node_auth_ui,node_inventory_pages,node_user toneBlue
class node_api_controllers,node_accounts,node_jwt,node_user_identity,node_sql toneAmber
class node_assignments,node_devices toneMint
class node_repo_manager,node_repositories,node_repo_context toneRose
class node_maintenance,node_service_history,node_reports,node_email,node_roles toneIndigo
```

## Components

### Angular interface

- [Angular app](https://github.com/njabulo240/inventorysystem/tree/master/InventryUI/src/app): `InventryUI/src/app`
- [Authentication client](https://github.com/njabulo240/inventorysystem/blob/master/InventryUI/src/app/shared/services/authentication.service.ts): `InventryUI/src/app/shared/services/authentication.service.ts`
- [Asset and admin pages](https://github.com/njabulo240/inventorysystem/tree/master/InventryUI/src/app/pages/ui-components): `InventryUI/src/app/pages/ui-components`

### API and identity

- [Inventory controllers](https://github.com/njabulo240/inventorysystem/tree/master/InventrySystem/Controllers): `InventrySystem/Controllers`
- [Accounts controller](https://github.com/njabulo240/inventorysystem/blob/master/InventrySystem/Controllers/AccountsController.cs): `InventrySystem/Controllers/AccountsController.cs`
- [JWT handler](https://github.com/njabulo240/inventorysystem/blob/master/InventrySystem/JwtFeatures/JwtHandler.cs): `InventrySystem/JwtFeatures/JwtHandler.cs`
- [Identity user](https://github.com/njabulo240/inventorysystem/blob/master/Entities/Identity/User.cs): `Entities/Identity/User.cs`

### Inventory operations

- [Device assignments](https://github.com/njabulo240/inventorysystem/blob/master/InventrySystem/Controllers/DeviceAssignmentController.cs): `InventrySystem/Controllers/DeviceAssignmentController.cs`
- [Device inventory](https://github.com/njabulo240/inventorysystem/blob/master/InventrySystem/Controllers/DeviceController.cs): `InventrySystem/Controllers/DeviceController.cs`

### Persistence

- [Repository manager](https://github.com/njabulo240/inventorysystem/blob/master/Repository/RepositoryManager.cs): `Repository/RepositoryManager.cs`
- [Domain repositories](https://github.com/njabulo240/inventorysystem/tree/master/Repository): `Repository`
- [EF repository context](https://github.com/njabulo240/inventorysystem/blob/master/Repository/RepositoryContext.cs): `Repository/RepositoryContext.cs`

### Product capabilities

- [Maintenance schedules](https://github.com/njabulo240/inventorysystem/blob/master/InventrySystem/Controllers/MaintenanceScheduleController.cs): `InventrySystem/Controllers/MaintenanceScheduleController.cs`
- [Service history](https://github.com/njabulo240/inventorysystem/blob/master/InventrySystem/Controllers/ServiceHistoryController.cs): `InventrySystem/Controllers/ServiceHistoryController.cs`
- [Reports and analytics](https://github.com/njabulo240/inventorysystem/blob/master/Entities/Models/Report.cs): `Entities/Models/Report.cs`
- [Email sender](https://github.com/njabulo240/inventorysystem/blob/master/EmailService/EmailSender.cs): `EmailService/EmailSender.cs`
- [Roles and permissions](https://github.com/njabulo240/inventorysystem/blob/master/InventrySystem/Controllers/RoleController.cs): `InventrySystem/Controllers/RoleController.cs`

### Other components

- **Inventory user**
- **SQL Server**

## Connections

- Inventory user → Angular app: uses (evidence: `README.md`)
- Angular app → Inventory controllers: calls API (evidence: `README.md`)
- Angular app → Authentication client: uses (evidence: `InventryUI/src/app/app.component.ts`)
- Authentication client → Accounts controller: auth requests
- Angular app → Asset and admin pages: routes users (evidence: `InventryUI/src/app/pages/ui-components/ui-components.routing.ts`)
- Device assignments → Repository manager: uses repositories (evidence: `InventrySystem/Controllers/DeviceAssignmentController.cs`)
- Device assignments → Device inventory: updates device (evidence: `InventrySystem/Controllers/DeviceAssignmentController.cs`)
- Inventory controllers → Repository manager: uses repositories
- Repository manager → Domain repositories: creates (evidence: `Repository/RepositoryManager.cs`)
- Repository manager → EF repository context: shares context (evidence: `Repository/RepositoryManager.cs`)
- Domain repositories → EF repository context: accesses data (evidence: `Repository/DeviceRepository.cs`)
- EF repository context → SQL Server: persists data (evidence: `README.md`)
- Accounts controller → JWT handler: generates token (evidence: `InventrySystem/Controllers/AccountsController.cs`)
- JWT handler → Identity user: reads claims (evidence: `InventrySystem/JwtFeatures/JwtHandler.cs`)
- Accounts controller → Email sender: sends messages (evidence: `InventrySystem/Controllers/AccountsController.cs`)
- EF repository context → Reports and analytics: maps entity (evidence: `Repository/RepositoryContext.cs`)
- Maintenance schedules → Repository manager: uses repositories
- Service history → Repository manager: uses repositories
- Roles and permissions → Identity user: manages roles
