# yash1026-hash/qms-gp architecture

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

- Interactive diagram: https://gitdiagram.com/yash1026-hash/qms-gp
- Repository: https://github.com/yash1026-hash/qms-gp

## Overview

QMS is a role-based quality-management starter: users sign in, then work through document control, deviations and investigation reports, and change requests, with supervisor review and administrator oversight. The README documents the Web/API login boundary, shared cookie, role authorization, and SQLite or SQL Server persistence. The tree shows broader role-specific pages and API controllers, but most page-to-endpoint calls were not sampled; those connections are therefore omitted rather than inferred.

Main entry points: [`QMSSystem.Api/Data/UserDbContext.cs`](https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Data/UserDbContext.cs) (QMS database), [`QMSSystem.Api/Program.cs`](https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Program.cs) (API host), [`QMSSystem.Api/Controllers/DocumentsController.cs`](https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Controllers/DocumentsController.cs) (Document endpoints), [`QMSSystem.Web/Pages/Operator`](https://github.com/yash1026-hash/qms-gp/tree/master/QMSSystem.Web/Pages/Operator) (Operator work)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_login["Sign in<br/>[login.cshtml.cs]"]
  node_operator["Operator work<br/>[Operator]"]
  node_documents_ui["Document control<br/>[Documents]"]
  node_supervisor["Supervisor review<br/>[Supervisor]"]
  node_admin["Admin oversight<br/>[Admin]"]
  node_web_program["Web host<br/>[Program.cs]"]
end

subgraph group_api["API workflows"]
  node_api_host["API host<br/>[Program.cs]"]
  node_doc_api["Document endpoints"]
  node_change_api["Change approvals"]
  node_deviation_api["Deviation endpoints"]
  node_deviation_review["Deviation review"]
  node_report_api["Investigation reports"]
  node_admin_api["Admin operations<br/>[AdminController.cs]"]
end

subgraph group_identity["Identity and access"]
  node_user_store["User lookup<br/>[UserStore.cs]"]
  node_accounts["Accounts and roles<br/>[UserAccount.cs]"]
end

subgraph group_data["Persistence"]
  node_documents[("Controlled documents")]
  node_deviations[("Deviation records")]
  node_db[("QMS database<br/>[UserDbContext.cs]")]
end

node_user(("QMS user"))

node_user -->|"signs in"| node_login
node_login -->|"posts login"| node_api_host
node_web_program -->|"forwards cookie"| node_api_host
node_api_host -->|"registers service"| node_user_store
node_api_host -->|"configures context"| node_db
node_api_host -->|"maps controllers"| node_doc_api
node_api_host -->|"registers service"| node_deviation_review
node_doc_api -->|"reads and writes"| node_db
node_deviation_review -->|"reads and updates"| node_db
node_admin_api -->|"queries records"| node_db
node_user_store -->|"loads accounts"| node_db
node_db -->|"maps entity"| node_documents
node_db -->|"maps entity"| node_deviations
node_operator -.->|"uses endpoints"| node_doc_api
node_operator -.->|"uses endpoints"| node_deviation_api
node_operator -.->|"submits reports"| node_report_api
node_documents_ui -.->|"uses endpoints"| node_doc_api
node_supervisor -.->|"reviews cases"| node_deviation_review
node_supervisor -.->|"reviews changes"| node_change_api
node_supervisor -.->|"reviews reports"| node_report_api
node_admin -.->|"uses endpoints"| node_admin_api

click node_login "https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Web/Pages/Account/login.cshtml.cs"
click node_operator "https://github.com/yash1026-hash/qms-gp/tree/master/QMSSystem.Web/Pages/Operator"
click node_documents_ui "https://github.com/yash1026-hash/qms-gp/tree/master/QMSSystem.Web/Pages/Documents"
click node_supervisor "https://github.com/yash1026-hash/qms-gp/tree/master/QMSSystem.Web/Pages/Supervisor"
click node_admin "https://github.com/yash1026-hash/qms-gp/tree/master/QMSSystem.Web/Pages/Admin"
click node_web_program "https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Web/Program.cs"
click node_api_host "https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Program.cs"
click node_doc_api "https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Controllers/DocumentsController.cs"
click node_change_api "https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Controllers/ChangeRequestApprovalController.cs"
click node_deviation_api "https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Controllers/DeviationController.cs"
click node_deviation_review "https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Services/DeviationReviewService.cs"
click node_report_api "https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Controllers/DeviationReportsController.cs"
click node_admin_api "https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Controllers/AdminController.cs"
click node_user_store "https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Services/UserStore.cs"
click node_accounts "https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Shared/Models/UserAccount.cs"
click node_documents "https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Shared/Models/DocumentCreation.cs"
click node_deviations "https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Shared/Models/DeviationRequest.cs"
click node_db "https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Data/UserDbContext.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_login,node_operator,node_documents_ui,node_supervisor,node_admin,node_web_program,node_user toneBlue
class node_api_host,node_doc_api,node_change_api,node_deviation_api,node_deviation_review,node_report_api,node_admin_api toneAmber
class node_user_store,node_accounts toneMint
class node_documents,node_deviations,node_db toneRose
```

## Components

### Web experience

- [Sign in](https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Web/Pages/Account/login.cshtml.cs): `QMSSystem.Web/Pages/Account/login.cshtml.cs`
- [Operator work](https://github.com/yash1026-hash/qms-gp/tree/master/QMSSystem.Web/Pages/Operator): `QMSSystem.Web/Pages/Operator`
- [Document control](https://github.com/yash1026-hash/qms-gp/tree/master/QMSSystem.Web/Pages/Documents): `QMSSystem.Web/Pages/Documents`
- [Supervisor review](https://github.com/yash1026-hash/qms-gp/tree/master/QMSSystem.Web/Pages/Supervisor): `QMSSystem.Web/Pages/Supervisor`
- [Admin oversight](https://github.com/yash1026-hash/qms-gp/tree/master/QMSSystem.Web/Pages/Admin): `QMSSystem.Web/Pages/Admin`
- [Web host](https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Web/Program.cs): `QMSSystem.Web/Program.cs`

### API workflows

- [API host](https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Program.cs): `QMSSystem.Api/Program.cs`
- [Document endpoints](https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Controllers/DocumentsController.cs): `QMSSystem.Api/Controllers/DocumentsController.cs`
- [Change approvals](https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Controllers/ChangeRequestApprovalController.cs): `QMSSystem.Api/Controllers/ChangeRequestApprovalController.cs`
- [Deviation endpoints](https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Controllers/DeviationController.cs): `QMSSystem.Api/Controllers/DeviationController.cs`
- [Deviation review](https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Services/DeviationReviewService.cs): `QMSSystem.Api/Services/DeviationReviewService.cs`
- [Investigation reports](https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Controllers/DeviationReportsController.cs): `QMSSystem.Api/Controllers/DeviationReportsController.cs`
- [Admin operations](https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Controllers/AdminController.cs): `QMSSystem.Api/Controllers/AdminController.cs`

### Identity and access

- [User lookup](https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Services/UserStore.cs): `QMSSystem.Api/Services/UserStore.cs`
- [Accounts and roles](https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Shared/Models/UserAccount.cs): `QMSSystem.Shared/Models/UserAccount.cs`

### Persistence

- [Controlled documents](https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Shared/Models/DocumentCreation.cs): `QMSSystem.Shared/Models/DocumentCreation.cs`
- [Deviation records](https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Shared/Models/DeviationRequest.cs): `QMSSystem.Shared/Models/DeviationRequest.cs`
- [QMS database](https://github.com/yash1026-hash/qms-gp/blob/master/QMSSystem.Api/Data/UserDbContext.cs): `QMSSystem.Api/Data/UserDbContext.cs`

### Other components

- **QMS user**

## Connections

- QMS user → Sign in: signs in
- Sign in → API host: posts login
- Web host → API host: forwards cookie (evidence: `QMSSystem.Web/Program.cs`)
- API host → User lookup: registers service (evidence: `QMSSystem.Api/Program.cs`)
- API host → QMS database: configures context (evidence: `QMSSystem.Api/Program.cs`)
- API host → Document endpoints: maps controllers (evidence: `QMSSystem.Api/Program.cs`)
- API host → Deviation review: registers service (evidence: `QMSSystem.Api/Program.cs`)
- Document endpoints → QMS database: reads and writes (evidence: `QMSSystem.Api/Controllers/DocumentsController.cs`)
- Deviation review → QMS database: reads and updates (evidence: `QMSSystem.Api/Services/DeviationReviewService.cs`)
- Admin operations → QMS database: queries records (evidence: `QMSSystem.Api/Controllers/AdminController.cs`)
- User lookup → QMS database: loads accounts (evidence: `QMSSystem.Api/Services/UserStore.cs`)
- QMS database → Controlled documents: maps entity (evidence: `QMSSystem.Api/Data/UserDbContext.cs`)
- QMS database → Deviation records: maps entity (evidence: `QMSSystem.Api/Data/UserDbContext.cs`)
- Operator work → Document endpoints: uses endpoints
- Operator work → Deviation endpoints: uses endpoints
- Operator work → Investigation reports: submits reports
- Document control → Document endpoints: uses endpoints
- Supervisor review → Deviation review: reviews cases
- Supervisor review → Change approvals: reviews changes
- Supervisor review → Investigation reports: reviews reports
- Admin oversight → Admin operations: uses endpoints
