# kytos-ng/mef_eline architecture

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

- Interactive diagram: https://gitdiagram.com/kytos-ng/mef_eline
- Repository: https://github.com/kytos-ng/mef_eline

## Overview

mef_eline is a Kytos NApp for provisioning and managing point-to-point Layer 2 Ethernet Virtual Circuits (EVCs). A user submits a circuit request through the REST API; the application manages the circuit, selects or validates paths, deploys flows, and keeps circuit state synchronized with persistent storage. Scheduling and link-failure recovery are additional lifecycle branches, and a web UI supports management. The graph combines shown source relationships with README-documented capabilities; several integration and UI implementation details were not sampled.

Main entry points: [`main.py`](https://github.com/kytos-ng/mef_eline/blob/master/main.py) (Lifecycle orchestration), [`models/evc.py`](https://github.com/kytos-ng/mef_eline/blob/master/models/evc.py) (EVC lifecycle), [`controllers/__init__.py`](https://github.com/kytos-ng/mef_eline/blob/master/controllers/__init__.py) (EVC persistence), [`models/path.py`](https://github.com/kytos-ng/mef_eline/blob/master/models/path.py) (Path model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and orchestration"]
  node_rest["Circuit REST API<br/>[main.py]"]
  node_orchestration["Lifecycle orchestration<br/>[main.py]"]
  node_webui["Management UI"]
end

subgraph group_circuit["Circuit lifecycle"]
  node_evc["EVC lifecycle<br/>[evc.py]"]
  node_path["Path model<br/>[path.py]"]
  node_scheduler["Circuit scheduler<br/>[scheduler.py]"]
end

subgraph group_state["Persistence and scheduling"]
  node_dbcontroller["EVC persistence<br/>[__init__.py]"]
  node_dbmodels["Storage schemas<br/>[models.py]"]
  node_mongodb[("MongoDB")]
end

subgraph group_integrations["Network integrations"]
  node_pathfinder["Pathfinder"]
  node_flowmanager["Flow Manager"]
  node_topology["Topology events"]
  node_sdntrace["SDN trace service"]
end

node_user(("Network operator"))

node_user -->|"requests circuits"| node_rest
node_rest -->|"routes requests"| node_orchestration
node_orchestration -->|"deploys circuits"| node_evc
node_evc -->|"uses paths"| node_path
node_path -->|"requests paths"| node_pathfinder
node_evc -.->|"installs flows"| node_flowmanager
node_evc -->|"checks traces"| node_sdntrace
node_orchestration -->|"synchronizes circuits"| node_dbcontroller
node_dbcontroller -->|"validates documents"| node_dbmodels
node_dbcontroller -->|"reads and writes"| node_mongodb
node_orchestration -->|"manages schedules"| node_scheduler
node_scheduler -->|"runs deploy or remove"| node_evc
node_topology -.->|"signals link changes"| node_orchestration
node_webui -.->|"manages circuits"| node_rest

click node_rest "https://github.com/kytos-ng/mef_eline/blob/master/main.py"
click node_orchestration "https://github.com/kytos-ng/mef_eline/blob/master/main.py"
click node_webui "https://github.com/kytos-ng/mef_eline/tree/master/ui"
click node_evc "https://github.com/kytos-ng/mef_eline/blob/master/models/evc.py"
click node_path "https://github.com/kytos-ng/mef_eline/blob/master/models/path.py"
click node_scheduler "https://github.com/kytos-ng/mef_eline/blob/master/scheduler.py"
click node_dbcontroller "https://github.com/kytos-ng/mef_eline/blob/master/controllers/__init__.py"
click node_dbmodels "https://github.com/kytos-ng/mef_eline/blob/master/db/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_rest,node_orchestration,node_webui toneBlue
class node_evc,node_path,node_scheduler toneAmber
class node_dbcontroller,node_dbmodels,node_mongodb toneMint
class node_pathfinder,node_flowmanager,node_topology,node_sdntrace toneRose
class node_user toneIndigo
```

## Components

### API and orchestration

- [Circuit REST API](https://github.com/kytos-ng/mef_eline/blob/master/main.py): `main.py`
- [Lifecycle orchestration](https://github.com/kytos-ng/mef_eline/blob/master/main.py): `main.py`
- [Management UI](https://github.com/kytos-ng/mef_eline/tree/master/ui): `ui`

### Circuit lifecycle

- [EVC lifecycle](https://github.com/kytos-ng/mef_eline/blob/master/models/evc.py): `models/evc.py`
- [Path model](https://github.com/kytos-ng/mef_eline/blob/master/models/path.py): `models/path.py`
- [Circuit scheduler](https://github.com/kytos-ng/mef_eline/blob/master/scheduler.py): `scheduler.py`

### Persistence and scheduling

- [EVC persistence](https://github.com/kytos-ng/mef_eline/blob/master/controllers/__init__.py): `controllers/__init__.py`
- [Storage schemas](https://github.com/kytos-ng/mef_eline/blob/master/db/models.py): `db/models.py`
- **MongoDB**

### Network integrations

- **Pathfinder**
- **Flow Manager**
- **Topology events**
- **SDN trace service**

### Other components

- **Network operator**

## Connections

- Network operator → Circuit REST API: requests circuits (evidence: `README.rst`)
- Circuit REST API → Lifecycle orchestration: routes requests (evidence: `README.rst`)
- Lifecycle orchestration → EVC lifecycle: deploys circuits (evidence: `main.py`)
- EVC lifecycle → Path model: uses paths (evidence: `models/evc.py`)
- Path model → Pathfinder: requests paths (evidence: `models/path.py`)
- EVC lifecycle → Flow Manager: installs flows
- EVC lifecycle → SDN trace service: checks traces (evidence: `models/evc.py`)
- Lifecycle orchestration → EVC persistence: synchronizes circuits (evidence: `README.rst`)
- EVC persistence → Storage schemas: validates documents (evidence: `controllers/__init__.py`)
- EVC persistence → MongoDB: reads and writes (evidence: `controllers/__init__.py`)
- Lifecycle orchestration → Circuit scheduler: manages schedules (evidence: `README.rst`)
- Circuit scheduler → EVC lifecycle: runs deploy or remove (evidence: `scheduler.py`)
- Topology events → Lifecycle orchestration: signals link changes (evidence: `README.rst`)
- Management UI → Circuit REST API: manages circuits (evidence: `README.rst`)
