# 1valcl3b/mininet-web architecture

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

- Interactive diagram: https://gitdiagram.com/1valcl3b/mininet-web
- Repository: https://github.com/1valcl3b/mininet-web

## Overview

Mininet-WEB is a browser-based visual editor for Mininet network topologies. Users load a component catalog, place and connect hosts, switches, routers, controllers, and NAT nodes, then edit, save, or export the topology as JSON or generated Python; generated Python can also be parsed back into the diagram. The README documents a JSON Server catalog API, but the sampled code provides no Mininet execution integration: start, stop, and pingall controls only show messages. The graph follows evidenced frontend calls; backend internals beyond its catalog configuration were not sampled.

Main entry points: [`mininet-web-frontend/script.js`](https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/script.js) (Editor controller), [`mininet-web-frontend/modules/nodes.js`](https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/modules/nodes.js) (Node renderer), [`mininet-web-frontend/modules/components.js`](https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/modules/components.js) (Catalog loader), [`mininet-web-frontend/modules/dom.js`](https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/modules/dom.js) (DOM bindings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Component catalog"]
  node_catalogloader["Catalog loader<br/>[components.js]"]
  node_catalogapi["Catalog API"]
  node_catalogdata[("Component catalog data<br/>[db.json]")]
end

subgraph group_editor["Topology editor"]
  node_frontend["Editor controller<br/>[script.js]"]
  node_dom["DOM bindings<br/>[dom.js]"]
  node_ui["Canvas UI<br/>[ui.js]"]
  node_state["Interaction state<br/>[state.js]"]
end

subgraph group_domain["Topology domain"]
  node_nodeconfig["Node definitions<br/>[node-config.js]"]
  node_nodes["Node renderer<br/>[nodes.js]"]
  node_links["Link renderer<br/>[links.js]"]
end

subgraph group_io["Topology I/O"]
  node_topologyio["Topology conversion<br/>[topology-io.js]"]
end

node_user(("Network designer"))
node_mininet["Mininet runtime"]

node_user -->|"edits topology"| node_frontend
node_frontend -->|"loads catalog"| node_catalogloader
node_catalogloader -->|"fetches components"| node_catalogapi
node_catalogapi -->|"serves catalog"| node_catalogdata
node_catalogloader -->|"validates types"| node_nodeconfig
node_frontend -->|"builds nodes"| node_nodes
node_frontend -->|"builds links"| node_links
node_frontend -->|"imports and exports"| node_topologyio
node_frontend -->|"updates interface"| node_ui
node_frontend -->|"resets sequences"| node_state
node_nodes -->|"uses definitions"| node_nodeconfig
node_nodes -->|"increments sequences"| node_state
node_nodes -->|"renders on canvas"| node_dom
node_links -->|"draws on canvas"| node_dom
node_ui -->|"updates elements"| node_dom
node_user -.->|"runtime controls"| node_mininet

click node_frontend "https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/script.js"
click node_dom "https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/modules/dom.js"
click node_ui "https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/modules/ui.js"
click node_state "https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/modules/state.js"
click node_catalogloader "https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/modules/components.js"
click node_nodeconfig "https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/modules/node-config.js"
click node_nodes "https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/modules/nodes.js"
click node_links "https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/modules/links.js"
click node_topologyio "https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/modules/topology-io.js"
click node_catalogapi "https://github.com/1valcl3b/mininet-web/tree/main/mininet-web-backend"
click node_catalogdata "https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-backend/db.json"

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_catalogloader,node_catalogapi,node_catalogdata toneBlue
class node_frontend,node_dom,node_ui,node_state toneAmber
class node_nodeconfig,node_nodes,node_links toneMint
class node_topologyio toneRose
class node_user,node_mininet toneIndigo
```

## Components

### Component catalog

- [Catalog loader](https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/modules/components.js): `mininet-web-frontend/modules/components.js`
- [Catalog API](https://github.com/1valcl3b/mininet-web/tree/main/mininet-web-backend): `mininet-web-backend`
- [Component catalog data](https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-backend/db.json): `mininet-web-backend/db.json`

### Topology editor

- [Editor controller](https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/script.js): `mininet-web-frontend/script.js`
- [DOM bindings](https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/modules/dom.js): `mininet-web-frontend/modules/dom.js`
- [Canvas UI](https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/modules/ui.js): `mininet-web-frontend/modules/ui.js`
- [Interaction state](https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/modules/state.js): `mininet-web-frontend/modules/state.js`

### Topology domain

- [Node definitions](https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/modules/node-config.js): `mininet-web-frontend/modules/node-config.js`
- [Node renderer](https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/modules/nodes.js): `mininet-web-frontend/modules/nodes.js`
- [Link renderer](https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/modules/links.js): `mininet-web-frontend/modules/links.js`

### Topology I/O

- [Topology conversion](https://github.com/1valcl3b/mininet-web/blob/main/mininet-web-frontend/modules/topology-io.js): `mininet-web-frontend/modules/topology-io.js`

### Other components

- **Network designer**
- **Mininet runtime**

## Connections

- Network designer → Editor controller: edits topology (evidence: `README.md`)
- Editor controller → Catalog loader: loads catalog (evidence: `mininet-web-frontend/script.js`)
- Catalog loader → Catalog API: fetches components (evidence: `mininet-web-frontend/modules/components.js`)
- Catalog API → Component catalog data: serves catalog (evidence: `README.md`)
- Catalog loader → Node definitions: validates types (evidence: `mininet-web-frontend/modules/components.js`)
- Editor controller → Node renderer: builds nodes (evidence: `mininet-web-frontend/script.js`)
- Editor controller → Link renderer: builds links (evidence: `mininet-web-frontend/script.js`)
- Editor controller → Topology conversion: imports and exports (evidence: `mininet-web-frontend/script.js`)
- Editor controller → Canvas UI: updates interface (evidence: `mininet-web-frontend/script.js`)
- Editor controller → Interaction state: resets sequences (evidence: `mininet-web-frontend/script.js`)
- Node renderer → Node definitions: uses definitions (evidence: `mininet-web-frontend/modules/nodes.js`)
- Node renderer → Interaction state: increments sequences (evidence: `mininet-web-frontend/modules/nodes.js`)
- Node renderer → DOM bindings: renders on canvas (evidence: `mininet-web-frontend/modules/nodes.js`)
- Link renderer → DOM bindings: draws on canvas (evidence: `mininet-web-frontend/modules/links.js`)
- Canvas UI → DOM bindings: updates elements (evidence: `mininet-web-frontend/modules/ui.js`)
- Network designer → Mininet runtime: runtime controls
