# lina123-alt/k8s-security-pipeline architecture

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

- Interactive diagram: https://gitdiagram.com/lina123-alt/k8s-security-pipeline
- Repository: https://github.com/lina123-alt/k8s-security-pipeline

## Overview

Orderly is an order-management application: users register or sign in, then view a product catalog, create orders, and track them; operator/admin roles can advance order status or delete orders. The React client calls a FastAPI backend, which authenticates requests, applies role checks, and persists order and user data. The tree and sampled source establish these primary paths; product definitions and some model details are represented only by their exact tree paths, so their internal behavior is not expanded.

Main entry points: [`backend/app/api/orders.py`](https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/api/orders.py) (Order endpoints), [`backend/app/auth/router.py`](https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/auth/router.py) (Auth endpoints), [`backend/app/main.py`](https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/main.py) (FastAPI application), [`frontend/src/App.jsx`](https://github.com/lina123-alt/k8s-security-pipeline/blob/main/frontend/src/App.jsx) (Orderly interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_frontend["Orderly interface<br/>[App.jsx]"]
  node_session[("Browser session")]
  node_app_entry["React entry<br/>[main.jsx]"]
end

subgraph group_api["API services"]
  node_api_entry["FastAPI application<br/>[main.py]"]
  node_orders_api["Order endpoints<br/>[orders.py]"]
  node_products["Product catalog<br/>[products.py]"]
  node_order_schema["Order input schema<br/>[order.py]"]
  node_limiter["Rate limiter<br/>[limiter.py]"]
end

subgraph group_identity["Identity and access"]
  node_auth_router["Auth endpoints<br/>[router.py]"]
  node_auth_model["User model<br/>[models.py]"]
  node_security["Token security<br/>[security.py]"]
  node_rbac["Role checks<br/>[rbac.py]"]
  node_blacklist["Revoked tokens<br/>[blacklist.py]"]
end

subgraph group_persistence["Persistence"]
  node_order_model["Order model<br/>[order.py]"]
  node_database["Database sessions<br/>[database.py]"]
  node_sql_store[("SQL database")]
  node_redis[("Redis")]
end

node_user(("User"))

node_user -->|"uses"| node_frontend
node_app_entry -->|"renders"| node_frontend
node_frontend -->|"reads/writes"| node_session
node_frontend -->|"HTTP requests"| node_api_entry
node_api_entry -->|"mounts"| node_auth_router
node_api_entry -->|"mounts"| node_orders_api
node_api_entry -->|"configures"| node_limiter
node_auth_router -->|"opens sessions"| node_database
node_auth_router -->|"queries users"| node_auth_model
node_auth_router -->|"hashes/verifies"| node_security
node_auth_router -->|"checks roles"| node_rbac
node_auth_router -->|"revokes tokens"| node_blacklist
node_auth_router -->|"limits requests"| node_limiter
node_orders_api -->|"opens sessions"| node_database
node_orders_api -->|"verifies tokens"| node_security
node_orders_api -->|"checks roles"| node_rbac
node_orders_api -->|"reads catalog"| node_products
node_orders_api -->|"validates input"| node_order_schema
node_orders_api -->|"queries/mutates"| node_order_model
node_database -->|"connects"| node_sql_store
node_blacklist -->|"checks/revokes"| node_redis
node_rbac -->|"verifies token"| node_security
node_security -->|"checks revocation"| node_blacklist

click node_frontend "https://github.com/lina123-alt/k8s-security-pipeline/blob/main/frontend/src/App.jsx"
click node_app_entry "https://github.com/lina123-alt/k8s-security-pipeline/blob/main/frontend/src/main.jsx"
click node_api_entry "https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/main.py"
click node_orders_api "https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/api/orders.py"
click node_products "https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/api/products.py"
click node_order_schema "https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/schemas/order.py"
click node_order_model "https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/models/order.py"
click node_auth_router "https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/auth/router.py"
click node_auth_model "https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/auth/models.py"
click node_security "https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/auth/security.py"
click node_rbac "https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/auth/rbac.py"
click node_blacklist "https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/auth/blacklist.py"
click node_limiter "https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/limiter.py"
click node_database "https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/database/database.py"

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_frontend,node_session,node_app_entry,node_user toneBlue
class node_api_entry,node_orders_api,node_products,node_order_schema,node_limiter toneAmber
class node_auth_router,node_auth_model,node_security,node_rbac,node_blacklist toneMint
class node_order_model,node_database,node_sql_store,node_redis toneRose
```

## Components

### Web client

- [Orderly interface](https://github.com/lina123-alt/k8s-security-pipeline/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- **Browser session**
- [React entry](https://github.com/lina123-alt/k8s-security-pipeline/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`

### API services

- [FastAPI application](https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/main.py): `backend/app/main.py`
- [Order endpoints](https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/api/orders.py): `backend/app/api/orders.py`
- [Product catalog](https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/api/products.py): `backend/app/api/products.py`
- [Order input schema](https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/schemas/order.py): `backend/app/schemas/order.py`
- [Rate limiter](https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/limiter.py): `backend/app/limiter.py`

### Identity and access

- [Auth endpoints](https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/auth/router.py): `backend/app/auth/router.py`
- [User model](https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/auth/models.py): `backend/app/auth/models.py`
- [Token security](https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/auth/security.py): `backend/app/auth/security.py`
- [Role checks](https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/auth/rbac.py): `backend/app/auth/rbac.py`
- [Revoked tokens](https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/auth/blacklist.py): `backend/app/auth/blacklist.py`

### Persistence

- [Order model](https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/models/order.py): `backend/app/models/order.py`
- [Database sessions](https://github.com/lina123-alt/k8s-security-pipeline/blob/main/backend/app/database/database.py): `backend/app/database/database.py`
- **SQL database**
- **Redis**

### Other components

- **User**

## Connections

- User → Orderly interface: uses
- React entry → Orderly interface: renders
- Orderly interface → Browser session: reads/writes
- Orderly interface → FastAPI application: HTTP requests
- FastAPI application → Auth endpoints: mounts
- FastAPI application → Order endpoints: mounts
- FastAPI application → Rate limiter: configures
- Auth endpoints → Database sessions: opens sessions
- Auth endpoints → User model: queries users
- Auth endpoints → Token security: hashes/verifies
- Auth endpoints → Role checks: checks roles
- Auth endpoints → Revoked tokens: revokes tokens
- Auth endpoints → Rate limiter: limits requests
- Order endpoints → Database sessions: opens sessions
- Order endpoints → Token security: verifies tokens
- Order endpoints → Role checks: checks roles
- Order endpoints → Product catalog: reads catalog
- Order endpoints → Order input schema: validates input
- Order endpoints → Order model: queries/mutates
- Database sessions → SQL database: connects
- Revoked tokens → Redis: checks/revokes
- Role checks → Token security: verifies token
- Token security → Revoked tokens: checks revocation
