# aiyiyi121/sxdevops architecture

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

- Interactive diagram: https://gitdiagram.com/aiyiyi121/sxdevops
- Repository: https://github.com/aiyiyi121/sxdevops

## Overview

SxDevOps is an operations platform that combines observability evidence, event history, task execution, approvals, and a controlled AIOps agent. The main user journey starts in the Vue workbench, reaches Django APIs (or Channels for interactive shells), and returns diagnostic evidence or a governed action result. The README documents the agent’s preflight/confirmation and feedback loop, plus major product branches. Source excerpts confirm selected task, event, RBAC, Kubernetes, and cloud-service responsibilities; unsampled subsystem links are included only where the README explicitly documents them.

Main entry points: [`backend/aiops`](https://github.com/aiyiyi121/sxdevops/tree/main/backend/aiops) (Agent and tools), [`backend/sxdevops/urls.py`](https://github.com/aiyiyi121/sxdevops/blob/main/backend/sxdevops/urls.py) (Django API), [`backend/ops/host_tasks.py`](https://github.com/aiyiyi121/sxdevops/blob/main/backend/ops/host_tasks.py) (Host task execution), [`frontend/src/main.js`](https://github.com/aiyiyi121/sxdevops/blob/main/frontend/src/main.js) (Vue workbench)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workbench["User workbench"]
  node_frontend["Vue workbench<br/>[main.js]"]
  node_api["Django API<br/>[urls.py]"]
  node_channels["Interactive channels<br/>[routing.py]"]
end

subgraph group_agent["AIOps agent"]
  node_agent_router["Action routing<br/>[action_handlers.py]"]
  node_agent_core["Agent and tools"]
  node_agent_preflight["Preflight and confirmation"]
  node_agent_audit[("Agent audit")]
end

subgraph group_evidence["Evidence and events"]
  node_observability["Observability"]
  node_alerts["Alerts<br/>[alerting.py]"]
  node_events[("Event center<br/>[services.py]")]
  node_cmdb[("Configuration inventory<br/>[models.py]")]
end

subgraph group_execution["Operations and workflows"]
  node_tasks["Host task execution<br/>[host_tasks.py]"]
  node_schedules["Task schedules"]
  node_kubernetes["Kubernetes management<br/>[k8s_views.py]"]
  node_workorders[("Deployments and approvals<br/>[models.py]")]
  node_sql_audit["SQL audit"]
  node_cloud["Multicloud inventory<br/>[services.py]"]
end

subgraph group_governance["Access and records"]
  node_rbac["RBAC<br/>[services.py]"]
  node_audit[("Operations audit<br/>[models.py]")]
end

node_operator(("Operator"))
node_external_systems{{"Infrastructure and telemetry"}}
node_redis[("Redis")]

node_operator -->|"uses"| node_frontend
node_frontend -->|"calls APIs"| node_api
node_frontend -->|"opens sessions"| node_channels
node_api -.->|"dispatches requests"| node_agent_router
node_agent_router -->|"selects mode"| node_agent_core
node_agent_core -->|"preflights actions"| node_agent_preflight
node_agent_preflight -->|"permits tool use"| node_agent_core
node_agent_core -->|"queries evidence"| node_observability
node_agent_core -->|"queries events"| node_events
node_agent_core -->|"queries tasks"| node_tasks
node_agent_core -->|"records calls"| node_agent_audit
node_agent_preflight -->|"checks permissions"| node_rbac
node_agent_preflight -->|"submits confirmed work"| node_tasks
node_tasks -->|"records outcomes"| node_events
node_tasks -->|"executes remotely"| node_external_systems
node_schedules -->|"triggers tasks"| node_tasks
node_kubernetes -->|"manages clusters"| node_external_systems
node_observability -->|"reads telemetry"| node_external_systems
node_alerts -.->|"contributes evidence"| node_observability
node_api -->|"handles workflows"| node_workorders
node_api -->|"handles SQL review"| node_sql_audit
node_cloud -->|"syncs configuration items"| node_cmdb
node_cmdb -.->|"represents infrastructure"| node_external_systems
node_api -->|"enforces access"| node_rbac
node_rbac -.->|"supports audit trail"| node_audit
node_channels -->|"uses channel layer"| node_redis
node_events -.->|"retains operations history"| node_audit

click node_frontend "https://github.com/aiyiyi121/sxdevops/blob/main/frontend/src/main.js"
click node_api "https://github.com/aiyiyi121/sxdevops/blob/main/backend/sxdevops/urls.py"
click node_channels "https://github.com/aiyiyi121/sxdevops/blob/main/backend/ops/routing.py"
click node_agent_router "https://github.com/aiyiyi121/sxdevops/blob/main/backend/aiops/action_handlers.py"
click node_agent_core "https://github.com/aiyiyi121/sxdevops/tree/main/backend/aiops"
click node_agent_preflight "https://github.com/aiyiyi121/sxdevops/tree/main/backend/aiops"
click node_agent_audit "https://github.com/aiyiyi121/sxdevops/tree/main/backend/aiops"
click node_observability "https://github.com/aiyiyi121/sxdevops/blob/main/backend/ops/observability_views.py"
click node_alerts "https://github.com/aiyiyi121/sxdevops/blob/main/backend/ops/alerting.py"
click node_events "https://github.com/aiyiyi121/sxdevops/blob/main/backend/eventwall/services.py"
click node_cmdb "https://github.com/aiyiyi121/sxdevops/blob/main/backend/cmdb/models.py"
click node_tasks "https://github.com/aiyiyi121/sxdevops/blob/main/backend/ops/host_tasks.py"
click node_schedules "https://github.com/aiyiyi121/sxdevops/blob/main/backend/ops/host_task_schedules.py"
click node_kubernetes "https://github.com/aiyiyi121/sxdevops/blob/main/backend/ops/k8s_views.py"
click node_workorders "https://github.com/aiyiyi121/sxdevops/blob/main/backend/ops/models.py"
click node_sql_audit "https://github.com/aiyiyi121/sxdevops/tree/main/backend/sqlaudit"
click node_cloud "https://github.com/aiyiyi121/sxdevops/blob/main/backend/multicloud/services.py"
click node_rbac "https://github.com/aiyiyi121/sxdevops/blob/main/backend/rbac/services.py"
click node_audit "https://github.com/aiyiyi121/sxdevops/blob/main/backend/ops/models.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_api,node_channels toneBlue
class node_agent_router,node_agent_core,node_agent_preflight,node_agent_audit,node_redis toneAmber
class node_observability,node_alerts,node_events,node_cmdb toneMint
class node_tasks,node_schedules,node_kubernetes,node_workorders,node_sql_audit,node_cloud toneRose
class node_rbac,node_audit,node_operator,node_external_systems toneIndigo
```

## Components

### User workbench

- [Vue workbench](https://github.com/aiyiyi121/sxdevops/blob/main/frontend/src/main.js): `frontend/src/main.js`
- [Django API](https://github.com/aiyiyi121/sxdevops/blob/main/backend/sxdevops/urls.py): `backend/sxdevops/urls.py`
- [Interactive channels](https://github.com/aiyiyi121/sxdevops/blob/main/backend/ops/routing.py): `backend/ops/routing.py`

### AIOps agent

- [Action routing](https://github.com/aiyiyi121/sxdevops/blob/main/backend/aiops/action_handlers.py): `backend/aiops/action_handlers.py`
- [Agent and tools](https://github.com/aiyiyi121/sxdevops/tree/main/backend/aiops): `backend/aiops`
- [Preflight and confirmation](https://github.com/aiyiyi121/sxdevops/tree/main/backend/aiops): `backend/aiops`
- [Agent audit](https://github.com/aiyiyi121/sxdevops/tree/main/backend/aiops): `backend/aiops`

### Evidence and events

- [Observability](https://github.com/aiyiyi121/sxdevops/blob/main/backend/ops/observability_views.py): `backend/ops/observability_views.py`
- [Alerts](https://github.com/aiyiyi121/sxdevops/blob/main/backend/ops/alerting.py): `backend/ops/alerting.py`
- [Event center](https://github.com/aiyiyi121/sxdevops/blob/main/backend/eventwall/services.py): `backend/eventwall/services.py`
- [Configuration inventory](https://github.com/aiyiyi121/sxdevops/blob/main/backend/cmdb/models.py): `backend/cmdb/models.py`

### Operations and workflows

- [Host task execution](https://github.com/aiyiyi121/sxdevops/blob/main/backend/ops/host_tasks.py): `backend/ops/host_tasks.py`
- [Task schedules](https://github.com/aiyiyi121/sxdevops/blob/main/backend/ops/host_task_schedules.py): `backend/ops/host_task_schedules.py`
- [Kubernetes management](https://github.com/aiyiyi121/sxdevops/blob/main/backend/ops/k8s_views.py): `backend/ops/k8s_views.py`
- [Deployments and approvals](https://github.com/aiyiyi121/sxdevops/blob/main/backend/ops/models.py): `backend/ops/models.py`
- [SQL audit](https://github.com/aiyiyi121/sxdevops/tree/main/backend/sqlaudit): `backend/sqlaudit`
- [Multicloud inventory](https://github.com/aiyiyi121/sxdevops/blob/main/backend/multicloud/services.py): `backend/multicloud/services.py`

### Access and records

- [RBAC](https://github.com/aiyiyi121/sxdevops/blob/main/backend/rbac/services.py): `backend/rbac/services.py`
- [Operations audit](https://github.com/aiyiyi121/sxdevops/blob/main/backend/ops/models.py): `backend/ops/models.py`

### Other components

- **Operator**
- **Infrastructure and telemetry**
- **Redis**

## Connections

- Operator → Vue workbench: uses (evidence: `README.md`)
- Vue workbench → Django API: calls APIs (evidence: `README.md`)
- Vue workbench → Interactive channels: opens sessions (evidence: `README.md`)
- Django API → Action routing: dispatches requests (evidence: `README.md`)
- Action routing → Agent and tools: selects mode (evidence: `README.md`)
- Agent and tools → Preflight and confirmation: preflights actions (evidence: `README.md`)
- Preflight and confirmation → Agent and tools: permits tool use (evidence: `README.md`)
- Agent and tools → Observability: queries evidence (evidence: `README.md`)
- Agent and tools → Event center: queries events (evidence: `README.md`)
- Agent and tools → Host task execution: queries tasks (evidence: `README.md`)
- Agent and tools → Agent audit: records calls (evidence: `README.md`)
- Preflight and confirmation → RBAC: checks permissions (evidence: `README.md`)
- Preflight and confirmation → Host task execution: submits confirmed work (evidence: `README.md`)
- Host task execution → Event center: records outcomes (evidence: `backend/ops/host_tasks.py`)
- Host task execution → Infrastructure and telemetry: executes remotely (evidence: `README.md`)
- Task schedules → Host task execution: triggers tasks (evidence: `backend/ops/host_task_schedules.py`)
- Kubernetes management → Infrastructure and telemetry: manages clusters (evidence: `README.md`)
- Observability → Infrastructure and telemetry: reads telemetry (evidence: `README.md`)
- Alerts → Observability: contributes evidence (evidence: `README.md`)
- Django API → Deployments and approvals: handles workflows (evidence: `README.md`)
- Django API → SQL audit: handles SQL review (evidence: `README.md`)
- Multicloud inventory → Configuration inventory: syncs configuration items (evidence: `backend/multicloud/services.py`)
- Configuration inventory → Infrastructure and telemetry: represents infrastructure (evidence: `README.md`)
- Django API → RBAC: enforces access (evidence: `README.md`)
- RBAC → Operations audit: supports audit trail (evidence: `README.md`)
- Interactive channels → Redis: uses channel layer (evidence: `README.md`)
- Event center → Operations audit: retains operations history (evidence: `README.md`)
