# opendcim/opendcim architecture

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

- Interactive diagram: https://gitdiagram.com/opendcim/opendcim
- Repository: https://github.com/opendcim/opendcim

## Overview

openDCIM is a web-based data-center infrastructure inventory and management system. Users browse and maintain facilities and equipment through PHP pages or the v1 API; domain classes provide inventory operations, while reports and monitoring expose operational data. Its documented product scope includes SNMP-based device monitoring, and the source tree also contains power, sensor, virtualization, and authentication features. The excerpts show selected page, API, and SNMP relationships; many other capabilities are represented by their exact tree paths, but their internal wiring was not sampled.

Main entry points: [`OSS_SNMP/SNMP.php`](https://github.com/opendcim/opendcim/blob/master/OSS_SNMP/SNMP.php) (SNMP query engine), [`storageroom.php`](https://github.com/opendcim/opendcim/blob/master/storageroom.php) (Management pages), [`api/v1/getRoutes.php`](https://github.com/opendcim/opendcim/blob/master/api/v1/getRoutes.php) (REST API routes), [`classes/Device.class.php`](https://github.com/opendcim/opendcim/blob/master/classes/Device.class.php) (Device inventory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web and API"]
  node_pages["Management pages<br/>[storageroom.php]"]
  node_api["REST API routes<br/>[getRoutes.php]"]
  node_bootstrap["Application bootstrap<br/>[facilities.inc.php]"]
end

subgraph group_inventory["Inventory and Facilities"]
  node_device["Device inventory<br/>[Device.class.php]"]
  node_datacenter["Facility records"]
  node_cabinet["Cabinet inventory<br/>[Cabinet.class.php]"]
  node_templates["Device templates"]
  node_connections["Port connections"]
end

subgraph group_operations["Operations"]
  node_power["Power infrastructure"]
  node_sensors["Sensor readings"]
  node_virtualization["Virtual machines<br/>[VM.class.php]"]
  node_reports["Reports and exports<br/>[report_sensors.php]"]
end

subgraph group_snmp["SNMP Monitoring"]
  node_snmp["SNMP query engine<br/>[SNMP.php]"]
  node_platform["Vendor platforms<br/>[Platform.php]"]
  node_mibs["Vendor MIB modules"]
  node_cache["SNMP cache<br/>[Basic.php]"]
end

node_user(("Data-center user"))
node_db[("MySQL database")]
node_network(("Managed equipment"))

node_user -->|"uses"| node_pages
node_user -->|"calls"| node_api
node_pages -->|"lists and disposes"| node_device
node_pages -->|"loads facility"| node_datacenter
node_api -->|"queries"| node_device
node_api -->|"updates"| node_connections
node_connections -->|"reads and writes"| node_db
node_bootstrap -->|"loads when available"| node_snmp
node_snmp -->|"loads and stores"| node_cache
node_snmp -->|"creates platform"| node_platform
node_platform -.->|"selects vendor modules"| node_mibs
node_snmp -->|"queries"| node_network
node_reports -.->|"reports inventory"| node_device

click node_pages "https://github.com/opendcim/opendcim/blob/master/storageroom.php"
click node_api "https://github.com/opendcim/opendcim/blob/master/api/v1/getRoutes.php"
click node_bootstrap "https://github.com/opendcim/opendcim/blob/master/facilities.inc.php"
click node_device "https://github.com/opendcim/opendcim/blob/master/classes/Device.class.php"
click node_datacenter "https://github.com/opendcim/opendcim/blob/master/classes/DataCenter.class.php"
click node_cabinet "https://github.com/opendcim/opendcim/blob/master/classes/Cabinet.class.php"
click node_templates "https://github.com/opendcim/opendcim/blob/master/classes/DeviceTemplate.class.php"
click node_connections "https://github.com/opendcim/opendcim/blob/master/classes/MediaConnectors.php"
click node_power "https://github.com/opendcim/opendcim/blob/master/classes/PowerDistribution.class.php"
click node_sensors "https://github.com/opendcim/opendcim/blob/master/classes/SensorReadings.class.php"
click node_virtualization "https://github.com/opendcim/opendcim/blob/master/classes/VM.class.php"
click node_reports "https://github.com/opendcim/opendcim/blob/master/report_sensors.php"
click node_snmp "https://github.com/opendcim/opendcim/blob/master/OSS_SNMP/SNMP.php"
click node_platform "https://github.com/opendcim/opendcim/blob/master/OSS_SNMP/Platform.php"
click node_mibs "https://github.com/opendcim/opendcim/tree/master/OSS_SNMP/MIBS"
click node_cache "https://github.com/opendcim/opendcim/blob/master/OSS_SNMP/Cache/Basic.php"

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_pages,node_api,node_bootstrap,node_user toneBlue
class node_device,node_datacenter,node_cabinet,node_templates,node_connections,node_db toneAmber
class node_power,node_sensors,node_virtualization,node_reports toneMint
class node_snmp,node_platform,node_mibs,node_cache toneRose
class node_network toneIndigo
```

## Components

### Web and API

- [Management pages](https://github.com/opendcim/opendcim/blob/master/storageroom.php): `storageroom.php`
- [REST API routes](https://github.com/opendcim/opendcim/blob/master/api/v1/getRoutes.php): `api/v1/getRoutes.php`
- [Application bootstrap](https://github.com/opendcim/opendcim/blob/master/facilities.inc.php): `facilities.inc.php`

### Inventory and Facilities

- [Device inventory](https://github.com/opendcim/opendcim/blob/master/classes/Device.class.php): `classes/Device.class.php`
- [Facility records](https://github.com/opendcim/opendcim/blob/master/classes/DataCenter.class.php): `classes/DataCenter.class.php`
- [Cabinet inventory](https://github.com/opendcim/opendcim/blob/master/classes/Cabinet.class.php): `classes/Cabinet.class.php`
- [Device templates](https://github.com/opendcim/opendcim/blob/master/classes/DeviceTemplate.class.php): `classes/DeviceTemplate.class.php`
- [Port connections](https://github.com/opendcim/opendcim/blob/master/classes/MediaConnectors.php): `classes/MediaConnectors.php`

### Operations

- [Power infrastructure](https://github.com/opendcim/opendcim/blob/master/classes/PowerDistribution.class.php): `classes/PowerDistribution.class.php`
- [Sensor readings](https://github.com/opendcim/opendcim/blob/master/classes/SensorReadings.class.php): `classes/SensorReadings.class.php`
- [Virtual machines](https://github.com/opendcim/opendcim/blob/master/classes/VM.class.php): `classes/VM.class.php`
- [Reports and exports](https://github.com/opendcim/opendcim/blob/master/report_sensors.php): `report_sensors.php`

### SNMP Monitoring

- [SNMP query engine](https://github.com/opendcim/opendcim/blob/master/OSS_SNMP/SNMP.php): `OSS_SNMP/SNMP.php`
- [Vendor platforms](https://github.com/opendcim/opendcim/blob/master/OSS_SNMP/Platform.php): `OSS_SNMP/Platform.php`
- [Vendor MIB modules](https://github.com/opendcim/opendcim/tree/master/OSS_SNMP/MIBS): `OSS_SNMP/MIBS`
- [SNMP cache](https://github.com/opendcim/opendcim/blob/master/OSS_SNMP/Cache/Basic.php): `OSS_SNMP/Cache/Basic.php`

### Other components

- **Data-center user**
- **MySQL database**
- **Managed equipment**

## Connections

- Data-center user → Management pages: uses (evidence: `README.md`)
- Data-center user → REST API routes: calls (evidence: `README.md`)
- Management pages → Device inventory: lists and disposes (evidence: `storageroom.php`)
- Management pages → Facility records: loads facility (evidence: `storageroom.php`)
- REST API routes → Device inventory: queries (evidence: `api/v1/getRoutes.php`)
- REST API routes → Port connections: updates (evidence: `api/v1/getRoutes.php`)
- Port connections → MySQL database: reads and writes (evidence: `classes/MediaConnectors.php`)
- Application bootstrap → SNMP query engine: loads when available (evidence: `facilities.inc.php`)
- SNMP query engine → SNMP cache: loads and stores (evidence: `OSS_SNMP/SNMP.php`)
- SNMP query engine → Vendor platforms: creates platform (evidence: `OSS_SNMP/SNMP.php`)
- Vendor platforms → Vendor MIB modules: selects vendor modules
- SNMP query engine → Managed equipment: queries (evidence: `OSS_SNMP/SNMP.php`)
- Reports and exports → Device inventory: reports inventory
