How pkanderi-abio/vmware-dashboard works
Purpose and Entry Points
VMware Dashboard is a full-stack operations dashboard for monitoring multiple vCenter environments and enriching VM inventory with historical CMDB and optional PuppetDB data. The backend FastAPI application starts at main.py; the React/Vite SPA starts at src/main.tsx and composes routes in src/App.tsx.
Backend API and Application Boundary
main.py is the API boundary for browser clients: it exposes inventory, configuration, health, search, action, CMDB, and integration endpoints, applies CORS, and coordinates backend services. Browser API targeting is centralized in src/config/api.ts and consumed through src/lib/api.ts; the frontend supports a runtime backend URL override rather than requiring rebuilds.
vCenter Connection and Collection Pipeline
vCenter endpoints and server-local credentials are managed through the backend, with credentials persisted outside the repository under the user cache directory. Parallel pyVmomi PropertyCollector-based inventory gathering is implemented in vcenter_fast.py; related VMware domains are separated into lifecycle, tags, certificate, and health modules:
• vcenter_fast.py
• vcenter_health.py
• vcenter_lifecycle.py
• vcenter_tags.py
• vcenter_certs.py
The collector is the core external-system boundary to vCenter over HTTPS/443 and supplies hosts, VMs, datastores, networks, and snapshots for API responses.
Inventory, Cache, and Operational Actions
The backend converts collected vCenter state into dashboard resources, supports cached refresh behavior, and retains historical CMDB state for decommission tracking. cmdb_history.py owns inventory history; global_search.py provides cross-resource search; action_guard.py gates operational actions before they reach VMware-facing logic. Snapshot and VM action affordances are surfaced from:
• src/components/vm-actions.tsx
• src/components/snapshot-actions.tsx
• src/pages/snapshots.tsx
CMDB and Puppet Enrichment
CMDB records combine vCenter VM facts with optional PuppetDB data, allowing detail views and exports to show operational classification, facts, and history. puppet_client.py is the PuppetDB REST boundary, while cmdb_history.py persists local historical state. Primary UI consumers are:
• src/pages/cmdb.tsx
• src/pages/vm-detail.tsx
• puppet_client.py
Frontend Presentation and Navigation
The SPA uses React 18, TypeScript, React Router, Tailwind, and shadcn-style components. The app shell/sidebar and global search live in src/pages/_layout.tsx; resource pages render independent inventory perspectives, notably src/pages/index.tsx, src/pages/vms.tsx, src/pages/hosts.tsx, and src/pages/observability.tsx. Theme state persists client-side via src/lib/theme.tsx.
Deployment and Runtime Infrastructure
Backend runtime is Python 3.9+ with FastAPI/Uvicorn and pyVmomi; frontend is built by Vite and served as static assets or behind a reverse proxy. Container builds are split by tier in docker/api.Dockerfile and docker/frontend.Dockerfile. Kubernetes manifests define API/frontend deployments, ingress, persistent storage, HPA, network policy, secrets, and an in-cluster runner:
• k8s/kustomization.yaml
• k8s/api-deployment.yaml
• k8s/frontend-deployment.yaml
• k8s/runner/deployment.yaml
GitHub Actions validates frontend builds and supports self-hosted-runner deployment through .github/workflows/ci.yml and .github/workflows/deploy.yml.
Main entry points: main.py API application · _layout.tsx Shell, sidebar & search · kustomization.yaml Kubernetes deployment · api.ts API client & runtime URL
Components 21
React SPA
- SPA entry
src/main.tsx - App routes
src/App.tsx - Shell, sidebar & search
src/pages/_layout.tsx - Inventory views · Dashboard, VM, host, and observability perspectives.
src/pages/index.tsx - CMDB & VM detail
src/pages/cmdb.tsx - VM & snapshot actions
src/components/vm-actions.tsx - API client & runtime URL · Supports runtime backend URL override.
src/config/api.ts - Theme state
src/lib/theme.tsx
FastAPI backend
- API application · CORS-enabled boundary for dashboard APIs.
main.py - Parallel inventory collector · Collects VMs, hosts, datastores, networks, and snapshots.
vcenter_fast.py - vCenter domain services · Health, lifecycle, tags, and certificate operations.
vcenter_health.py - Action guard · Gates VMware-facing operational actions.
action_guard.py - Global search
global_search.py - CMDB history · Retains historical inventory for decommission tracking.
cmdb_history.py - PuppetDB client
puppet_client.py
Data systems
- vCenter environments · HTTPS inventory and action boundary.
- Optional PuppetDB
- Local credentials · Server-local vCenter credentials outside the repository.
Delivery runtime
- Tiered container builds · Separate API and frontend images.
docker/api.Dockerfile - Kubernetes deployment · API/frontend workloads, ingress, storage, policy, HPA, and runner.
k8s/kustomization.yaml - CI & deployment · Build validation and self-hosted-runner deployment.
.github/workflows/ci.yml
Connections 25
- SPA entry → App routes: mounts
- App routes → Shell, sidebar & search: composes
- Shell, sidebar & search → Inventory views: navigates
- Shell, sidebar & search → CMDB & VM detail: navigates
- Shell, sidebar & search → Theme state: uses
- Inventory views → API client & runtime URL: queries
- CMDB & VM detail → API client & runtime URL: queries
- VM & snapshot actions → API client & runtime URL: submits actions
- API client & runtime URL → API application: browser API requests
- API application → Parallel inventory collector: serves inventory
- API application → vCenter domain services: coordinates VMware domains
- API application → Global search: searches resources
- API application → CMDB history: reads and records history
- API application → PuppetDB client: enriches CMDB
- API application → Action guard: authorizes actions
- Parallel inventory collector → vCenter environments: collects over HTTPS
- vCenter domain services → vCenter environments: manages domains
- Action guard → vCenter environments: permits operations
- Parallel inventory collector → Local credentials: uses credentials
- PuppetDB client → Optional PuppetDB: REST queries
- Tiered container builds → Kubernetes deployment: produces workload images
- CI & deployment → Tiered container builds: builds and validates
- CI & deployment → Kubernetes deployment: deploys
- Kubernetes deployment → API application: runs API tier
- Kubernetes deployment → SPA entry: serves frontend tier