# engsafaaj/smsystemproject architecture

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

- Interactive diagram: https://gitdiagram.com/engsafaaj/smsystemproject
- Repository: https://github.com/engsafaaj/smsystemproject

## Overview

SMSystem is primarily a Windows Forms store-management application: users navigate its main window to manage stock, receipts, outgoing orders, damage, customers, suppliers, and related records. The README also documents multi-store operation, expiry alerts and disposal, user roles, analysis, receipts, and backup/restore. The Web project appears to be a separate, limited interface; its broader role is unclear from the sampled code. Edges are limited to relationships shown in excerpts or the source index; unsampled capabilities are retained without guessed connections.

Main entry points: [`SMSystem/Main.cs`](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Main.cs) (Main Navigation), [`SMSystem/Gui/MaterailsGui/MaterailsUserControl.cs`](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/MaterailsGui/MaterailsUserControl.cs) (Materials and Stock), [`SMSystem/Gui/OutComeGui/OutComeUserControl.cs`](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/OutComeGui/OutComeUserControl.cs) (Outgoing Orders), [`SMSystem.Data`](https://github.com/engsafaaj/smsystemproject/tree/master/SMSystem.Data) (Data Access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop Application"]
  node_main["Main Navigation<br/>[Main.cs]"]
  node_home["Home View<br/>[HomeUserControl.cs]"]
end

subgraph group_operations["Inventory Operations"]
  node_stock["Materials and Stock"]
  node_income["Incoming Stock"]
  node_outcome["Outgoing Orders"]
  node_damage["Damage Records"]
  node_disposal["Expiry Disposal"]
end

subgraph group_records["Business Records"]
  node_stores["Store Management"]
  node_customers["Customer Records"]
  node_suppliers["Supplier Records"]
  node_users["User Administration<br/>[UserUserControl.cs]"]
  node_analysis["System Analysis"]
  node_receipt["Receipt Output"]
end

subgraph group_platform["Data and Administration"]
  node_settings["System Settings<br/>[SettingsForm.cs]"]
  node_backup["Database Backup"]
  node_models["Domain Models<br/>[SMSystem.Core]"]
  node_data["Data Access<br/>[SMSystem.Data]"]
  node_sql[("SQL Server Context<br/>[DBContext.cs]")]
end

subgraph group_web["Web Interface"]
  node_webapp["Web Startup<br/>[Startup.cs]"]
  node_storepage["Store List Page<br/>[List.cshtml.cs]"]
end

node_user(("Staff User"))

node_user -->|"uses"| node_main
node_main -->|"loads"| node_home
node_main -->|"loads"| node_stock
node_main -->|"loads"| node_income
node_main -->|"loads"| node_outcome
node_main -->|"loads"| node_damage
node_main -->|"loads"| node_disposal
node_main -->|"loads"| node_stores
node_main -->|"loads"| node_customers
node_main -->|"loads"| node_suppliers
node_main -->|"loads"| node_users
node_main -->|"loads"| node_analysis
node_stock -->|"opens form"| node_income
node_stock -->|"opens form"| node_outcome
node_stock -->|"reads and edits"| node_data
node_outcome -->|"records orders"| node_data
node_models -->|"mapped as tables"| node_sql
node_settings -->|"uses backup"| node_backup
node_webapp -->|"configures page"| node_storepage
node_storepage -->|"uses data contract"| node_data

click node_main "https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Main.cs"
click node_home "https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/HomeGui/HomeUserControl.cs"
click node_stock "https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/MaterailsGui/MaterailsUserControl.cs"
click node_income "https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/IncomeGui/IncomeUserControl.cs"
click node_outcome "https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/OutComeGui/OutComeUserControl.cs"
click node_damage "https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/DamageGui/DamageUserControl.cs"
click node_disposal "https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/OutOfConscince/OutOfConscenseUserControl.cs"
click node_stores "https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/StoresGui/StoreUserControl.cs"
click node_customers "https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/CustomersGui/CustomerUserControl.cs"
click node_suppliers "https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/SuppliersGui/SupplierUserControl.cs"
click node_users "https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/UserGui/UserUserControl.cs"
click node_analysis "https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/Analyze/AnalyzeUserControl.cs"
click node_receipt "https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/Reports/ReceiptUserControl.cs"
click node_settings "https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/SettingsForm.cs"
click node_backup "https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem.Data/EFSqlServer/DataBaseBackUpAndRestor.cs"
click node_models "https://github.com/engsafaaj/smsystemproject/tree/master/SMSystem.Core"
click node_data "https://github.com/engsafaaj/smsystemproject/tree/master/SMSystem.Data"
click node_sql "https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem.Data/EFSqlServer/DBContext.cs"
click node_webapp "https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem.Web/Startup.cs"
click node_storepage "https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem.Web/Pages/Store/List.cshtml.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_main,node_home,node_user toneBlue
class node_stock,node_income,node_outcome,node_damage,node_disposal toneAmber
class node_stores,node_customers,node_suppliers,node_users,node_analysis,node_receipt toneMint
class node_settings,node_backup,node_models,node_data,node_sql toneRose
class node_webapp,node_storepage toneIndigo
```

## Components

### Desktop Application

- [Main Navigation](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Main.cs): `SMSystem/Main.cs`
- [Home View](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/HomeGui/HomeUserControl.cs): `SMSystem/Gui/HomeGui/HomeUserControl.cs`

### Inventory Operations

- [Materials and Stock](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/MaterailsGui/MaterailsUserControl.cs): `SMSystem/Gui/MaterailsGui/MaterailsUserControl.cs`
- [Incoming Stock](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/IncomeGui/IncomeUserControl.cs): `SMSystem/Gui/IncomeGui/IncomeUserControl.cs`
- [Outgoing Orders](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/OutComeGui/OutComeUserControl.cs): `SMSystem/Gui/OutComeGui/OutComeUserControl.cs`
- [Damage Records](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/DamageGui/DamageUserControl.cs): `SMSystem/Gui/DamageGui/DamageUserControl.cs`
- [Expiry Disposal](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/OutOfConscince/OutOfConscenseUserControl.cs): `SMSystem/Gui/OutOfConscince/OutOfConscenseUserControl.cs`

### Business Records

- [Store Management](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/StoresGui/StoreUserControl.cs): `SMSystem/Gui/StoresGui/StoreUserControl.cs`
- [Customer Records](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/CustomersGui/CustomerUserControl.cs): `SMSystem/Gui/CustomersGui/CustomerUserControl.cs`
- [Supplier Records](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/SuppliersGui/SupplierUserControl.cs): `SMSystem/Gui/SuppliersGui/SupplierUserControl.cs`
- [User Administration](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/UserGui/UserUserControl.cs): `SMSystem/Gui/UserGui/UserUserControl.cs`
- [System Analysis](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/Analyze/AnalyzeUserControl.cs): `SMSystem/Gui/Analyze/AnalyzeUserControl.cs`
- [Receipt Output](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/Reports/ReceiptUserControl.cs): `SMSystem/Gui/Reports/ReceiptUserControl.cs`

### Data and Administration

- [System Settings](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem/Gui/SettingsForm.cs): `SMSystem/Gui/SettingsForm.cs`
- [Database Backup](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem.Data/EFSqlServer/DataBaseBackUpAndRestor.cs): `SMSystem.Data/EFSqlServer/DataBaseBackUpAndRestor.cs`
- [Domain Models](https://github.com/engsafaaj/smsystemproject/tree/master/SMSystem.Core): `SMSystem.Core`
- [Data Access](https://github.com/engsafaaj/smsystemproject/tree/master/SMSystem.Data): `SMSystem.Data`
- [SQL Server Context](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem.Data/EFSqlServer/DBContext.cs): `SMSystem.Data/EFSqlServer/DBContext.cs`

### Web Interface

- [Web Startup](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem.Web/Startup.cs): `SMSystem.Web/Startup.cs`
- [Store List Page](https://github.com/engsafaaj/smsystemproject/blob/master/SMSystem.Web/Pages/Store/List.cshtml.cs): `SMSystem.Web/Pages/Store/List.cshtml.cs`

### Other components

- **Staff User**

## Connections

- Staff User → Main Navigation: uses (evidence: `SMSystem/Main.cs`)
- Main Navigation → Home View: loads (evidence: `SMSystem/Main.cs`)
- Main Navigation → Materials and Stock: loads (evidence: `SMSystem/Main.cs`)
- Main Navigation → Incoming Stock: loads (evidence: `SMSystem/Main.cs`)
- Main Navigation → Outgoing Orders: loads (evidence: `SMSystem/Main.cs`)
- Main Navigation → Damage Records: loads (evidence: `SMSystem/Main.cs`)
- Main Navigation → Expiry Disposal: loads (evidence: `SMSystem/Main.cs`)
- Main Navigation → Store Management: loads (evidence: `SMSystem/Main.cs`)
- Main Navigation → Customer Records: loads (evidence: `SMSystem/Main.cs`)
- Main Navigation → Supplier Records: loads (evidence: `SMSystem/Main.cs`)
- Main Navigation → User Administration: loads (evidence: `SMSystem/Main.cs`)
- Main Navigation → System Analysis: loads (evidence: `SMSystem/Main.cs`)
- Materials and Stock → Incoming Stock: opens form (evidence: `SMSystem/Gui/MaterailsGui/MaterailsUserControl.cs`)
- Materials and Stock → Outgoing Orders: opens form (evidence: `SMSystem/Gui/MaterailsGui/MaterailsUserControl.cs`)
- Materials and Stock → Data Access: reads and edits (evidence: `SMSystem/Gui/MaterailsGui/MaterailsUserControl.cs`)
- Outgoing Orders → Data Access: records orders (evidence: `SMSystem/Gui/OutComeGui/OutComeAddForm.cs`)
- Domain Models → SQL Server Context: mapped as tables (evidence: `SMSystem.Data/EFSqlServer/DBContext.cs`)
- System Settings → Database Backup: uses backup (evidence: `SMSystem/Gui/SettingsForm.cs`)
- Web Startup → Store List Page: configures page (evidence: `SMSystem.Web/Startup.cs`)
- Store List Page → Data Access: uses data contract (evidence: `SMSystem.Web/Pages/Store/List.cshtml.cs`)
