# abdelkaderbenhmida/stage architecture

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

- Interactive diagram: https://gitdiagram.com/abdelkaderbenhmida/stage
- Repository: https://github.com/abdelkaderbenhmida/stage

## Overview

DevOps Central Platform is a multi-tenant self-service system for provisioning isolated environments and deploying tenant Git repositories. The main workflow runs from the console through the control-plane API to background workers, which build and scan images before deployment; projects can alternatively provision VMs. The graph also includes documented operator, observability, catalogue, team, and expiry capabilities. Some subsystem links rely on README descriptions because their implementation was not sampled.

Main entry points: [`controlplane/workers/tasks.py`](https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/workers/tasks.py) (Job workflows), [`controlplane/api/main.py`](https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/api/main.py) (REST API), [`controlplane/workers/celery_app.py`](https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/workers/celery_app.py) (Task broker), [`controlplane/web/static/app.js`](https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/web/static/app.js) (Web console)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_console["Web console<br/>[app.js]"]
end

subgraph group_control["Control plane"]
  node_api["REST API<br/>[main.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_deployments["Deployments API<br/>[deployments.py]"]
  node_projects["Projects API<br/>[projects.py]"]
  node_webhooks["Webhook intake<br/>[webhooks.py]"]
  node_state[("Platform state<br/>[db.py]")]
  node_models["Domain records"]
end

subgraph group_execution["Jobs and execution"]
  node_celery["Task broker<br/>[celery_app.py]"]
  node_tasks["Job workflows<br/>[tasks.py]"]
  node_sandbox["Command sandbox<br/>[sandbox.py]"]
  node_pipeline["Pipeline stages<br/>[pipeline_graph.py]"]
  node_scanners["Security scanners"]
  node_parsers["Finding parsers"]
  node_provisioning["Infrastructure provisioning"]
end

subgraph group_platform["Platform operations"]
  node_operations["Operator console backend<br/>[platform_ops.py]"]
  node_monitoring["Metrics and logs<br/>[monitoring.py]"]
  node_catalogue["Service catalogue<br/>[catalogue.py]"]
  node_demo["Platform demo services"]
end

node_tenant(("Tenant"))
node_operator(("Operator"))
node_git["Tenant Git repository"]
node_registry[("Image registry")]
node_cluster["Tenant environment"]

node_tenant -->|"uses"| node_console
node_operator -->|"uses"| node_console
node_console -->|"REST requests"| node_api
node_api -->|"routes"| node_auth
node_api -->|"routes"| node_deployments
node_api -->|"routes"| node_projects
node_api -->|"routes"| node_webhooks
node_auth -->|"reads and writes"| node_state
node_deployments -->|"queues jobs"| node_celery
node_projects -->|"queues jobs"| node_celery
node_webhooks -->|"queues redeploy"| node_celery
node_api -->|"persists state"| node_state
node_state -->|"stores records"| node_models
node_celery -->|"dispatches"| node_tasks
node_tasks -->|"clones source"| node_git
node_tasks -->|"runs commands"| node_sandbox
node_tasks -->|"scans images and source"| node_scanners
node_scanners -->|"normalizes findings"| node_parsers
node_tasks -->|"pushes images"| node_registry
node_tasks -->|"deploys workloads"| node_cluster
node_tasks -->|"renders infrastructure"| node_provisioning
node_tasks -.->|"records job stages"| node_pipeline
node_operator -->|"inspects platform"| node_operations
node_operations -->|"manages services"| node_demo
node_tenant -->|"views telemetry"| node_monitoring
node_tenant -->|"views workloads"| node_catalogue
node_monitoring -->|"reads namespace telemetry"| node_cluster

click node_console "https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/web/static/app.js"
click node_api "https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/api/main.py"
click node_auth "https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/api/routers/auth.py"
click node_deployments "https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/api/routers/deployments.py"
click node_projects "https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/api/routers/projects.py"
click node_webhooks "https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/api/routers/webhooks.py"
click node_state "https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/db.py"
click node_models "https://github.com/abdelkaderbenhmida/stage/tree/main/controlplane/models"
click node_celery "https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/workers/celery_app.py"
click node_tasks "https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/workers/tasks.py"
click node_sandbox "https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/runners/sandbox.py"
click node_pipeline "https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/core/pipeline_graph.py"
click node_scanners "https://github.com/abdelkaderbenhmida/stage/tree/main/controlplane/runners/scanners"
click node_parsers "https://github.com/abdelkaderbenhmida/stage/tree/main/controlplane/parsers"
click node_provisioning "https://github.com/abdelkaderbenhmida/stage/tree/main/controlplane/renderers"
click node_operations "https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/platform_ops.py"
click node_monitoring "https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/api/routers/monitoring.py"
click node_catalogue "https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/api/routers/catalogue.py"
click node_demo "https://github.com/abdelkaderbenhmida/stage/tree/main/app"

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_console toneBlue
class node_api,node_auth,node_deployments,node_projects,node_webhooks,node_state,node_models,node_registry toneAmber
class node_celery,node_tasks,node_sandbox,node_pipeline,node_scanners,node_parsers,node_provisioning toneMint
class node_operations,node_monitoring,node_catalogue,node_demo toneRose
class node_tenant,node_operator,node_git,node_cluster toneIndigo
```

## Components

### User experience

- [Web console](https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/web/static/app.js): `controlplane/web/static/app.js`

### Control plane

- [REST API](https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/api/main.py): `controlplane/api/main.py`
- [Authentication](https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/api/routers/auth.py): `controlplane/api/routers/auth.py`
- [Deployments API](https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/api/routers/deployments.py): `controlplane/api/routers/deployments.py`
- [Projects API](https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/api/routers/projects.py): `controlplane/api/routers/projects.py`
- [Webhook intake](https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/api/routers/webhooks.py): `controlplane/api/routers/webhooks.py`
- [Platform state](https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/db.py): `controlplane/db.py`
- [Domain records](https://github.com/abdelkaderbenhmida/stage/tree/main/controlplane/models): `controlplane/models`

### Jobs and execution

- [Task broker](https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/workers/celery_app.py): `controlplane/workers/celery_app.py`
- [Job workflows](https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/workers/tasks.py): `controlplane/workers/tasks.py`
- [Command sandbox](https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/runners/sandbox.py): `controlplane/runners/sandbox.py`
- [Pipeline stages](https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/core/pipeline_graph.py): `controlplane/core/pipeline_graph.py`
- [Security scanners](https://github.com/abdelkaderbenhmida/stage/tree/main/controlplane/runners/scanners): `controlplane/runners/scanners`
- [Finding parsers](https://github.com/abdelkaderbenhmida/stage/tree/main/controlplane/parsers): `controlplane/parsers`
- [Infrastructure provisioning](https://github.com/abdelkaderbenhmida/stage/tree/main/controlplane/renderers): `controlplane/renderers`

### Platform operations

- [Operator console backend](https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/platform_ops.py): `controlplane/platform_ops.py`
- [Metrics and logs](https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/api/routers/monitoring.py): `controlplane/api/routers/monitoring.py`
- [Service catalogue](https://github.com/abdelkaderbenhmida/stage/blob/main/controlplane/api/routers/catalogue.py): `controlplane/api/routers/catalogue.py`
- [Platform demo services](https://github.com/abdelkaderbenhmida/stage/tree/main/app): `app`

### Other components

- **Tenant**
- **Operator**
- **Tenant Git repository**
- **Image registry**
- **Tenant environment**

## Connections

- Tenant → Web console: uses (evidence: `README.md`)
- Operator → Web console: uses (evidence: `README.md`)
- Web console → REST API: REST requests (evidence: `README.md`)
- REST API → Authentication: routes (evidence: `controlplane/api/main.py`)
- REST API → Deployments API: routes (evidence: `controlplane/api/main.py`)
- REST API → Projects API: routes (evidence: `controlplane/api/main.py`)
- REST API → Webhook intake: routes (evidence: `controlplane/api/main.py`)
- Authentication → Platform state: reads and writes (evidence: `controlplane/api/routers/auth.py`)
- Deployments API → Task broker: queues jobs (evidence: `README.md`)
- Projects API → Task broker: queues jobs (evidence: `README.md`)
- Webhook intake → Task broker: queues redeploy (evidence: `controlplane/api/routers/webhooks.py`)
- REST API → Platform state: persists state (evidence: `README.md`)
- Platform state → Domain records: stores records (evidence: `controlplane/db.py`)
- Task broker → Job workflows: dispatches (evidence: `README.md`)
- Job workflows → Tenant Git repository: clones source (evidence: `README.md`)
- Job workflows → Command sandbox: runs commands (evidence: `README.md`)
- Job workflows → Security scanners: scans images and source (evidence: `README.md`)
- Security scanners → Finding parsers: normalizes findings (evidence: `controlplane/parsers/__init__.py`)
- Job workflows → Image registry: pushes images (evidence: `README.md`)
- Job workflows → Tenant environment: deploys workloads (evidence: `README.md`)
- Job workflows → Infrastructure provisioning: renders infrastructure (evidence: `README.md`)
- Job workflows → Pipeline stages: records job stages
- Operator → Operator console backend: inspects platform (evidence: `README.md`)
- Operator console backend → Platform demo services: manages services (evidence: `README.md`)
- Tenant → Metrics and logs: views telemetry (evidence: `README.md`)
- Tenant → Service catalogue: views workloads (evidence: `README.md`)
- Metrics and logs → Tenant environment: reads namespace telemetry (evidence: `README.md`)
