# sdiawa/lab-devops architecture

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

- Interactive diagram: https://gitdiagram.com/sdiawa/lab-devops
- Repository: https://github.com/sdiawa/lab-devops

## Overview

DSK Stock is a stock-management web application used as the shared business workload across seven DevOps labs. The user workflow is to sign in, browse products, create or edit stock records, record stock movements, and review dashboard or movement-history results. The graph shows the frontend-to-API boundary, domain handlers, and persistence layer. The README documents the deployment-lab topics, but this tree contains application source rather than those lab configurations; frontend-to-backend links are therefore marked unverified.

Main entry points: [`dsk-stock-lab01-docker/apps/frontend/src/lib/api.ts`](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/frontend/src/lib/api.ts) (API client), [`dsk-stock-lab01-docker/apps/frontend/src/App.tsx`](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/frontend/src/App.tsx) (App pages), [`dsk-stock-lab01-docker/apps/backend/src/products/products.controller.ts`](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/backend/src/products/products.controller.ts) (Product endpoints), [`dsk-stock-lab01-docker/apps/backend/src/prisma/prisma.service.ts`](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/backend/src/prisma/prisma.service.ts) (Prisma service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_pages["App pages<br/>[App.tsx]"]
  node_login["Login page<br/>[LoginPage.tsx]"]
  node_authstate["Auth state<br/>[auth-provider.tsx]"]
  node_productui["Product pages<br/>[ProductsPage.tsx]"]
  node_detailui["Product detail"]
  node_dashboardui["Dashboard page<br/>[DashboardPage.tsx]"]
  node_settings["Settings page<br/>[SettingsPage.tsx]"]
  node_apiclient["API client<br/>[api.ts]"]
end

subgraph group_api["API and identity"]
  node_authcontroller["Auth endpoints<br/>[auth.controller.ts]"]
  node_authservice["Auth service<br/>[auth.service.ts]"]
  node_guard["JWT guard<br/>[jwt-auth.guard.ts]"]
end

subgraph group_domain["Stock operations"]
  node_productscontroller["Product endpoints"]
  node_productsservice["Product service"]
  node_productdto["Product inputs"]
  node_dashboardcontroller["Dashboard endpoint"]
  node_dashboardservice["Dashboard service"]
end

subgraph group_data["Persistence"]
  node_prisma["Prisma service<br/>[prisma.service.ts]"]
  node_database[("PostgreSQL")]
end

node_user(("Stock user"))

node_user -.->|"uses"| node_pages
node_pages -.->|"routes"| node_login
node_pages -.->|"routes"| node_productui
node_pages -.->|"routes"| node_detailui
node_pages -.->|"routes"| node_dashboardui
node_pages -.->|"routes"| node_settings
node_login -.->|"uses"| node_authstate
node_authstate -.->|"requests"| node_apiclient
node_productui -.->|"requests"| node_apiclient
node_detailui -.->|"requests"| node_apiclient
node_dashboardui -.->|"requests"| node_apiclient
node_settings -.->|"requests"| node_apiclient
node_apiclient -.->|"HTTP API"| node_authcontroller
node_apiclient -.->|"HTTP API"| node_productscontroller
node_apiclient -.->|"HTTP API"| node_dashboardcontroller
node_authcontroller -.->|"delegates to"| node_authservice
node_authservice -->|"queries"| node_prisma
node_productscontroller -->|"delegates to"| node_productsservice
node_productscontroller -->|"guards routes"| node_guard
node_productscontroller -->|"accepts inputs"| node_productdto
node_dashboardcontroller -->|"delegates to"| node_dashboardservice
node_dashboardcontroller -->|"guards routes"| node_guard
node_dashboardservice -->|"queries"| node_prisma
node_productsservice -.->|"persists stock"| node_prisma
node_prisma -.->|"stores data"| node_database

click node_pages "https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/frontend/src/App.tsx"
click node_login "https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/frontend/src/pages/LoginPage.tsx"
click node_authstate "https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/frontend/src/providers/auth-provider.tsx"
click node_productui "https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/frontend/src/pages/ProductsPage.tsx"
click node_detailui "https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/frontend/src/pages/ProductDetailPage.tsx"
click node_dashboardui "https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/frontend/src/pages/DashboardPage.tsx"
click node_settings "https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/frontend/src/pages/SettingsPage.tsx"
click node_apiclient "https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/frontend/src/lib/api.ts"
click node_authcontroller "https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/backend/src/auth/auth.controller.ts"
click node_authservice "https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/backend/src/auth/auth.service.ts"
click node_guard "https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/backend/src/common/jwt-auth.guard.ts"
click node_productscontroller "https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/backend/src/products/products.controller.ts"
click node_productsservice "https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/backend/src/products/products.service.ts"
click node_productdto "https://github.com/sdiawa/lab-devops/tree/main/dsk-stock-lab01-docker/apps/backend/src/products/dto"
click node_dashboardcontroller "https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/backend/src/dashboard/dashboard.controller.ts"
click node_dashboardservice "https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/backend/src/dashboard/dashboard.service.ts"
click node_prisma "https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/backend/src/prisma/prisma.service.ts"

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_pages,node_login,node_authstate,node_productui,node_detailui,node_dashboardui,node_settings,node_apiclient,node_user toneBlue
class node_authcontroller,node_authservice,node_guard toneAmber
class node_productscontroller,node_productsservice,node_productdto,node_dashboardcontroller,node_dashboardservice toneMint
class node_prisma,node_database toneRose
```

## Components

### Web interface

- [App pages](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/frontend/src/App.tsx): `dsk-stock-lab01-docker/apps/frontend/src/App.tsx`
- [Login page](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/frontend/src/pages/LoginPage.tsx): `dsk-stock-lab01-docker/apps/frontend/src/pages/LoginPage.tsx`
- [Auth state](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/frontend/src/providers/auth-provider.tsx): `dsk-stock-lab01-docker/apps/frontend/src/providers/auth-provider.tsx`
- [Product pages](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/frontend/src/pages/ProductsPage.tsx): `dsk-stock-lab01-docker/apps/frontend/src/pages/ProductsPage.tsx`
- [Product detail](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/frontend/src/pages/ProductDetailPage.tsx): `dsk-stock-lab01-docker/apps/frontend/src/pages/ProductDetailPage.tsx`
- [Dashboard page](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/frontend/src/pages/DashboardPage.tsx): `dsk-stock-lab01-docker/apps/frontend/src/pages/DashboardPage.tsx`
- [Settings page](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/frontend/src/pages/SettingsPage.tsx): `dsk-stock-lab01-docker/apps/frontend/src/pages/SettingsPage.tsx`
- [API client](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/frontend/src/lib/api.ts): `dsk-stock-lab01-docker/apps/frontend/src/lib/api.ts`

### API and identity

- [Auth endpoints](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/backend/src/auth/auth.controller.ts): `dsk-stock-lab01-docker/apps/backend/src/auth/auth.controller.ts`
- [Auth service](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/backend/src/auth/auth.service.ts): `dsk-stock-lab01-docker/apps/backend/src/auth/auth.service.ts`
- [JWT guard](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/backend/src/common/jwt-auth.guard.ts): `dsk-stock-lab01-docker/apps/backend/src/common/jwt-auth.guard.ts`

### Stock operations

- [Product endpoints](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/backend/src/products/products.controller.ts): `dsk-stock-lab01-docker/apps/backend/src/products/products.controller.ts`
- [Product service](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/backend/src/products/products.service.ts): `dsk-stock-lab01-docker/apps/backend/src/products/products.service.ts`
- [Product inputs](https://github.com/sdiawa/lab-devops/tree/main/dsk-stock-lab01-docker/apps/backend/src/products/dto): `dsk-stock-lab01-docker/apps/backend/src/products/dto`
- [Dashboard endpoint](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/backend/src/dashboard/dashboard.controller.ts): `dsk-stock-lab01-docker/apps/backend/src/dashboard/dashboard.controller.ts`
- [Dashboard service](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/backend/src/dashboard/dashboard.service.ts): `dsk-stock-lab01-docker/apps/backend/src/dashboard/dashboard.service.ts`

### Persistence

- [Prisma service](https://github.com/sdiawa/lab-devops/blob/main/dsk-stock-lab01-docker/apps/backend/src/prisma/prisma.service.ts): `dsk-stock-lab01-docker/apps/backend/src/prisma/prisma.service.ts`
- **PostgreSQL**

### Other components

- **Stock user**

## Connections

- Stock user → App pages: uses
- App pages → Login page: routes
- App pages → Product pages: routes
- App pages → Product detail: routes
- App pages → Dashboard page: routes
- App pages → Settings page: routes
- Login page → Auth state: uses
- Auth state → API client: requests
- Product pages → API client: requests
- Product detail → API client: requests
- Dashboard page → API client: requests
- Settings page → API client: requests
- API client → Auth endpoints: HTTP API
- API client → Product endpoints: HTTP API
- API client → Dashboard endpoint: HTTP API
- Auth endpoints → Auth service: delegates to
- Auth service → Prisma service: queries (evidence: `dsk-stock-lab01-docker/apps/backend/src/auth/auth.service.ts`)
- Product endpoints → Product service: delegates to (evidence: `dsk-stock-lab01-docker/apps/backend/src/products/products.controller.ts`)
- Product endpoints → JWT guard: guards routes (evidence: `dsk-stock-lab01-docker/apps/backend/src/products/products.controller.ts`)
- Product endpoints → Product inputs: accepts inputs (evidence: `dsk-stock-lab01-docker/apps/backend/src/products/products.controller.ts`)
- Dashboard endpoint → Dashboard service: delegates to (evidence: `dsk-stock-lab01-docker/apps/backend/src/dashboard/dashboard.controller.ts`)
- Dashboard endpoint → JWT guard: guards routes (evidence: `dsk-stock-lab01-docker/apps/backend/src/dashboard/dashboard.controller.ts`)
- Dashboard service → Prisma service: queries (evidence: `dsk-stock-lab01-docker/apps/backend/src/dashboard/dashboard.service.ts`)
- Product service → Prisma service: persists stock (evidence: `dsk-stock-lab01-docker/apps/backend/src/products/products.service.ts`)
- Prisma service → PostgreSQL: stores data
