# mshadow6/hephaestus architecture

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

- Interactive diagram: https://gitdiagram.com/mshadow6/hephaestus
- Repository: https://github.com/mshadow6/hephaestus

## Overview

Hephaestus is a self-hosted VM-provisioning application. Requests enter through GLPI or the native dashboard, wait for explicit human approval, then proceed asynchronously through IP reservation, optional DNS registration, hypervisor provisioning, and Ansible post-install; GLPI-originated requests can receive status notifications. The repository also documents independently managed playbook runs, configurable connections, and group-based permissions. The graph combines README-described workflow links with source-index-supported module references; unsampled implementation details are not assumed.

Main entry points: [`backend/app/worker/tasks.py`](https://github.com/mshadow6/hephaestus/blob/main/backend/app/worker/tasks.py) (Provisioning worker), [`backend/app/main.py`](https://github.com/mshadow6/hephaestus/blob/main/backend/app/main.py) (Web application), [`backend/app/routers/dashboard.py`](https://github.com/mshadow6/hephaestus/blob/main/backend/app/routers/dashboard.py) (Request dashboard), [`backend/app/routers/playbooks.py`](https://github.com/mshadow6/hephaestus/blob/main/backend/app/routers/playbooks.py) (Playbook operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Requests and approval"]
  node_webhook["GLPI webhook<br/>[webhook.py]"]
  node_parser["Form parser"]
  node_dashboard["Request dashboard<br/>[dashboard.py]"]
end

subgraph group_provisioning["VM provisioning"]
  node_worker["Provisioning worker<br/>[tasks.py]"]
  node_ipam["IPAM providers<br/>[base.py]"]
  node_dns["DNS providers<br/>[base.py]"]
  node_terraform["VM provisioning"]
  node_inventory["Ansible inventory<br/>[inventory.py]"]
  node_ansible["Post-install runner<br/>[ansible_runner.py]"]
end

subgraph group_operations["Playbooks and connections"]
  node_connection_store["Connection registry<br/>[store.py]"]
  node_playbook_catalog["Playbook catalog<br/>[store.py]"]
  node_playbook_routes["Playbook operations<br/>[playbooks.py]"]
  node_glpi_client["GLPI notifications<br/>[client.py]"]
  node_connection_routes["Connection settings<br/>[connections.py]"]
end

subgraph group_platform["Application platform"]
  node_request_store[("VM request records<br/>[models.py]")]
  node_queue["Job queue<br/>[queue.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_auth_routes["Login routes<br/>[auth.py]"]
  node_settings_routes["Access settings<br/>[settings.py]"]
  node_audit["Audit log<br/>[audit_log.py]"]
  node_database["Database sessions<br/>[database.py]"]
  node_app_entry["Web application<br/>[main.py]"]
  node_template_support["Page rendering<br/>[templating.py]"]
  node_config["Application config<br/>[config.py]"]
  node_feature_flags["Feature flags<br/>[feature_flags.py]"]
  node_counts["Dashboard counts<br/>[counts.py]"]
end

node_glpi_actor(("GLPI requester"))
node_user_actor(("Dashboard user"))

node_glpi_actor -->|"submits request"| node_webhook
node_webhook -->|"parses form"| node_parser
node_user_actor -->|"submits or reviews"| node_dashboard
node_dashboard -->|"creates and updates"| node_request_store
node_webhook -->|"creates request"| node_request_store
node_dashboard -->|"enqueues approved work"| node_queue
node_queue -->|"dispatches job"| node_worker
node_worker -->|"loads and records status"| node_request_store
node_worker -->|"resolves connectors"| node_connection_store
node_worker -->|"reserves address"| node_ipam
node_worker -->|"creates record"| node_dns
node_worker -->|"creates VM"| node_terraform
node_worker -->|"runs post-install"| node_ansible
node_terraform -->|"uses inventory"| node_inventory
node_ansible -->|"uses inventory"| node_inventory
node_worker -->|"loads selected playbooks"| node_playbook_catalog
node_worker -->|"notifies source"| node_glpi_client
node_user_actor -->|"runs playbook"| node_playbook_routes
node_playbook_routes -->|"enqueues run"| node_queue
node_playbook_routes -->|"manages catalog"| node_playbook_catalog
node_playbook_routes -.->|"uses configured source"| node_connection_store
node_user_actor -->|"configures connectors"| node_connection_routes
node_connection_routes -->|"manages connections"| node_connection_store
node_user_actor -->|"signs in"| node_auth_routes
node_auth_routes -->|"checks credentials"| node_auth
node_user_actor -->|"manages access"| node_settings_routes
node_settings_routes -->|"uses permissions"| node_auth
node_app_entry -->|"routes requests"| node_dashboard
node_app_entry -->|"routes requests"| node_webhook
node_app_entry -->|"routes requests"| node_auth_routes
node_app_entry -->|"routes requests"| node_connection_routes
node_app_entry -->|"routes requests"| node_playbook_routes
node_app_entry -->|"routes requests"| node_settings_routes
node_app_entry -->|"logs requests"| node_audit
node_dashboard -->|"renders pages"| node_template_support
node_dashboard -->|"opens sessions"| node_database
node_dashboard -->|"reads counts"| node_counts
node_template_support -->|"reads form setting"| node_feature_flags
node_database -->|"configures engine"| node_config

click node_webhook "https://github.com/mshadow6/hephaestus/blob/main/backend/app/routers/webhook.py"
click node_parser "https://github.com/mshadow6/hephaestus/blob/main/backend/app/parsers/glpi_formcreator.py"
click node_dashboard "https://github.com/mshadow6/hephaestus/blob/main/backend/app/routers/dashboard.py"
click node_request_store "https://github.com/mshadow6/hephaestus/blob/main/backend/app/models.py"
click node_queue "https://github.com/mshadow6/hephaestus/blob/main/backend/app/queue.py"
click node_worker "https://github.com/mshadow6/hephaestus/blob/main/backend/app/worker/tasks.py"
click node_connection_store "https://github.com/mshadow6/hephaestus/blob/main/backend/app/connections/store.py"
click node_ipam "https://github.com/mshadow6/hephaestus/blob/main/backend/app/ipam/base.py"
click node_dns "https://github.com/mshadow6/hephaestus/blob/main/backend/app/dns/base.py"
click node_terraform "https://github.com/mshadow6/hephaestus/blob/main/backend/app/provisioning/terraform_runner.py"
click node_inventory "https://github.com/mshadow6/hephaestus/blob/main/backend/app/provisioning/inventory.py"
click node_ansible "https://github.com/mshadow6/hephaestus/blob/main/backend/app/provisioning/ansible_runner.py"
click node_playbook_catalog "https://github.com/mshadow6/hephaestus/blob/main/backend/app/playbooks/store.py"
click node_playbook_routes "https://github.com/mshadow6/hephaestus/blob/main/backend/app/routers/playbooks.py"
click node_glpi_client "https://github.com/mshadow6/hephaestus/blob/main/backend/app/glpi/client.py"
click node_connection_routes "https://github.com/mshadow6/hephaestus/blob/main/backend/app/routers/connections.py"
click node_auth "https://github.com/mshadow6/hephaestus/blob/main/backend/app/auth.py"
click node_auth_routes "https://github.com/mshadow6/hephaestus/blob/main/backend/app/routers/auth.py"
click node_settings_routes "https://github.com/mshadow6/hephaestus/blob/main/backend/app/routers/settings.py"
click node_audit "https://github.com/mshadow6/hephaestus/blob/main/backend/app/audit_log.py"
click node_database "https://github.com/mshadow6/hephaestus/blob/main/backend/app/database.py"
click node_app_entry "https://github.com/mshadow6/hephaestus/blob/main/backend/app/main.py"
click node_template_support "https://github.com/mshadow6/hephaestus/blob/main/backend/app/templating.py"
click node_config "https://github.com/mshadow6/hephaestus/blob/main/backend/app/config.py"
click node_feature_flags "https://github.com/mshadow6/hephaestus/blob/main/backend/app/feature_flags.py"
click node_counts "https://github.com/mshadow6/hephaestus/blob/main/backend/app/counts.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_webhook,node_parser,node_dashboard,node_user_actor toneBlue
class node_worker,node_ipam,node_dns,node_terraform,node_inventory,node_ansible toneAmber
class node_connection_store,node_playbook_catalog,node_playbook_routes,node_glpi_client,node_connection_routes,node_glpi_actor toneMint
class node_request_store,node_queue,node_auth,node_auth_routes,node_settings_routes,node_audit,node_database,node_app_entry,node_template_support,node_config,node_feature_flags,node_counts toneRose
```

## Components

### Requests and approval

- [GLPI webhook](https://github.com/mshadow6/hephaestus/blob/main/backend/app/routers/webhook.py): `backend/app/routers/webhook.py`
- [Form parser](https://github.com/mshadow6/hephaestus/blob/main/backend/app/parsers/glpi_formcreator.py): `backend/app/parsers/glpi_formcreator.py`
- [Request dashboard](https://github.com/mshadow6/hephaestus/blob/main/backend/app/routers/dashboard.py): `backend/app/routers/dashboard.py`

### VM provisioning

- [Provisioning worker](https://github.com/mshadow6/hephaestus/blob/main/backend/app/worker/tasks.py): `backend/app/worker/tasks.py`
- [IPAM providers](https://github.com/mshadow6/hephaestus/blob/main/backend/app/ipam/base.py): `backend/app/ipam/base.py`
- [DNS providers](https://github.com/mshadow6/hephaestus/blob/main/backend/app/dns/base.py): `backend/app/dns/base.py`
- [VM provisioning](https://github.com/mshadow6/hephaestus/blob/main/backend/app/provisioning/terraform_runner.py): `backend/app/provisioning/terraform_runner.py`
- [Ansible inventory](https://github.com/mshadow6/hephaestus/blob/main/backend/app/provisioning/inventory.py): `backend/app/provisioning/inventory.py`
- [Post-install runner](https://github.com/mshadow6/hephaestus/blob/main/backend/app/provisioning/ansible_runner.py): `backend/app/provisioning/ansible_runner.py`

### Playbooks and connections

- [Connection registry](https://github.com/mshadow6/hephaestus/blob/main/backend/app/connections/store.py): `backend/app/connections/store.py`
- [Playbook catalog](https://github.com/mshadow6/hephaestus/blob/main/backend/app/playbooks/store.py): `backend/app/playbooks/store.py`
- [Playbook operations](https://github.com/mshadow6/hephaestus/blob/main/backend/app/routers/playbooks.py): `backend/app/routers/playbooks.py`
- [GLPI notifications](https://github.com/mshadow6/hephaestus/blob/main/backend/app/glpi/client.py): `backend/app/glpi/client.py`
- [Connection settings](https://github.com/mshadow6/hephaestus/blob/main/backend/app/routers/connections.py): `backend/app/routers/connections.py`

### Application platform

- [VM request records](https://github.com/mshadow6/hephaestus/blob/main/backend/app/models.py): `backend/app/models.py`
- [Job queue](https://github.com/mshadow6/hephaestus/blob/main/backend/app/queue.py): `backend/app/queue.py`
- [Authentication](https://github.com/mshadow6/hephaestus/blob/main/backend/app/auth.py): `backend/app/auth.py`
- [Login routes](https://github.com/mshadow6/hephaestus/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Access settings](https://github.com/mshadow6/hephaestus/blob/main/backend/app/routers/settings.py): `backend/app/routers/settings.py`
- [Audit log](https://github.com/mshadow6/hephaestus/blob/main/backend/app/audit_log.py): `backend/app/audit_log.py`
- [Database sessions](https://github.com/mshadow6/hephaestus/blob/main/backend/app/database.py): `backend/app/database.py`
- [Web application](https://github.com/mshadow6/hephaestus/blob/main/backend/app/main.py): `backend/app/main.py`
- [Page rendering](https://github.com/mshadow6/hephaestus/blob/main/backend/app/templating.py): `backend/app/templating.py`
- [Application config](https://github.com/mshadow6/hephaestus/blob/main/backend/app/config.py): `backend/app/config.py`
- [Feature flags](https://github.com/mshadow6/hephaestus/blob/main/backend/app/feature_flags.py): `backend/app/feature_flags.py`
- [Dashboard counts](https://github.com/mshadow6/hephaestus/blob/main/backend/app/counts.py): `backend/app/counts.py`

### Other components

- **GLPI requester**
- **Dashboard user**

## Connections

- GLPI requester → GLPI webhook: submits request
- GLPI webhook → Form parser: parses form (evidence: `backend/app/routers/webhook.py`)
- Dashboard user → Request dashboard: submits or reviews
- Request dashboard → VM request records: creates and updates (evidence: `backend/app/routers/dashboard.py`)
- GLPI webhook → VM request records: creates request (evidence: `backend/app/routers/webhook.py`)
- Request dashboard → Job queue: enqueues approved work (evidence: `backend/app/routers/dashboard.py`)
- Job queue → Provisioning worker: dispatches job (evidence: `backend/app/worker/tasks.py`)
- Provisioning worker → VM request records: loads and records status (evidence: `backend/app/worker/tasks.py`)
- Provisioning worker → Connection registry: resolves connectors (evidence: `backend/app/worker/tasks.py`)
- Provisioning worker → IPAM providers: reserves address
- Provisioning worker → DNS providers: creates record (evidence: `backend/app/worker/tasks.py`)
- Provisioning worker → VM provisioning: creates VM (evidence: `backend/app/worker/tasks.py`)
- Provisioning worker → Post-install runner: runs post-install (evidence: `backend/app/worker/tasks.py`)
- VM provisioning → Ansible inventory: uses inventory (evidence: `backend/app/provisioning/terraform_runner.py`)
- Post-install runner → Ansible inventory: uses inventory (evidence: `backend/app/provisioning/ansible_runner.py`)
- Provisioning worker → Playbook catalog: loads selected playbooks (evidence: `backend/app/worker/tasks.py`)
- Provisioning worker → GLPI notifications: notifies source
- Dashboard user → Playbook operations: runs playbook
- Playbook operations → Job queue: enqueues run (evidence: `backend/app/routers/playbooks.py`)
- Playbook operations → Playbook catalog: manages catalog (evidence: `backend/app/routers/playbooks.py`)
- Playbook operations → Connection registry: uses configured source
- Dashboard user → Connection settings: configures connectors
- Connection settings → Connection registry: manages connections (evidence: `backend/app/routers/connections.py`)
- Dashboard user → Login routes: signs in (evidence: `backend/app/routers/auth.py`)
- Login routes → Authentication: checks credentials (evidence: `backend/app/routers/auth.py`)
- Dashboard user → Access settings: manages access
- Access settings → Authentication: uses permissions (evidence: `backend/app/routers/settings.py`)
- Web application → Request dashboard: routes requests (evidence: `backend/app/main.py`)
- Web application → GLPI webhook: routes requests (evidence: `backend/app/main.py`)
- Web application → Login routes: routes requests (evidence: `backend/app/main.py`)
- Web application → Connection settings: routes requests (evidence: `backend/app/main.py`)
- Web application → Playbook operations: routes requests (evidence: `backend/app/main.py`)
- Web application → Access settings: routes requests (evidence: `backend/app/main.py`)
- Web application → Audit log: logs requests (evidence: `backend/app/main.py`)
- Request dashboard → Page rendering: renders pages (evidence: `backend/app/routers/dashboard.py`)
- Request dashboard → Database sessions: opens sessions (evidence: `backend/app/routers/dashboard.py`)
- Request dashboard → Dashboard counts: reads counts (evidence: `backend/app/routers/dashboard.py`)
- Page rendering → Feature flags: reads form setting (evidence: `backend/app/templating.py`)
- Database sessions → Application config: configures engine (evidence: `backend/app/database.py`)
