# openbackhaul/macaddresstablerecorder architecture

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

- Interactive diagram: https://gitdiagram.com/openbackhaul/macaddresstablerecorder
- Repository: https://github.com/openbackhaul/macaddresstablerecorder

## Overview

MacAddressTableRecorder is a service for collecting microwave-device MAC tables, storing them in Elasticsearch, and exposing device and path-based results. Its main workflow is a cyclic, parallel device readout; an immediate readout can also be requested, with results optionally returned to the requestor. The graph preserves the documented query capabilities and application-pattern interfaces. Several service implementations are only indexed or partially excerpted, so uncertain internal call paths are omitted; documented and excerpted relationships are cited.

Main entry points: [`server/service/IndividualServicesService.js`](https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/service/IndividualServicesService.js) (MAC readout and queries), [`server/index.js`](https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/index.js) (HTTP application runtime), [`server/service/individualServices/CyclicProcessService/cyclicProcess.js`](https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/service/individualServices/CyclicProcessService/cyclicProcess.js) (Cyclic scheduler), [`server/controllers/BasicServices.js`](https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/controllers/BasicServices.js) (Basic services API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["REST interfaces"]
  node_basic_api["Basic services API<br/>[BasicServices.js]"]
  node_individual_api["Individual services API"]
  node_elk_api["Elasticsearch API"]
  node_interface_apis["Pattern interface APIs"]
end

subgraph group_workflow["Collection workflow"]
  node_individual_services["MAC readout and queries"]
  node_cyclic["Cyclic scheduler<br/>[cyclicProcess.js]"]
  node_utility["Profile and forwarding lookup"]
end

subgraph group_integration["Integrations and storage"]
  node_mwdi["Microwave inventory"]
  node_elasticsearch[("Elasticsearch")]
  node_es_preparation["Elasticsearch preparation"]
  node_es_service["Elasticsearch client service"]
  node_interface_services["Pattern interface services"]
end

subgraph group_runtime["Application runtime"]
  node_runtime["HTTP application runtime<br/>[index.js]"]
  node_logging["Logging<br/>[LoggingService.js]"]
end

node_caller(("Service caller"))
node_microwave_devices["Microwave devices"]
node_requestor(("Immediate-readout requestor"))

node_caller -.->|"invokes services"| node_basic_api
node_caller -.->|"requests readout or data"| node_individual_api
node_caller -.->|"configures Elasticsearch"| node_elk_api
node_basic_api -.->|"exposes pattern operations"| node_interface_apis
node_individual_api -->|"delegates operations"| node_individual_services
node_elk_api -->|"delegates configuration"| node_es_service
node_runtime -->|"starts cycle"| node_cyclic
node_runtime -->|"resolves forwarding"| node_utility
node_cyclic -->|"requests device readout"| node_individual_services
node_cyclic -->|"loads profiles"| node_utility
node_individual_services -->|"gets device inventory"| node_mwdi
node_individual_services -.->|"reads MAC tables"| node_microwave_devices
node_individual_services -.->|"stores and queries tables"| node_elasticsearch
node_individual_services -->|"returns requested data"| node_requestor
node_es_preparation -->|"prepares index"| node_elasticsearch
node_es_service -->|"configures client"| node_elasticsearch
node_interface_apis -.->|"delegates configuration"| node_interface_services
node_runtime -->|"creates logger"| node_logging

click node_basic_api "https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/controllers/BasicServices.js"
click node_individual_api "https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/controllers/IndividualServices.js"
click node_elk_api "https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/controllers/ElasticsearchClient.js"
click node_interface_apis "https://github.com/openbackhaul/macaddresstablerecorder/tree/develop/server/controllers"
click node_individual_services "https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/service/IndividualServicesService.js"
click node_cyclic "https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/service/individualServices/CyclicProcessService/cyclicProcess.js"
click node_utility "https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/service/individualServices/IndividualServicesUtility.js"
click node_es_preparation "https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/service/individualServices/ElasticsearchPreparation.js"
click node_es_service "https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/service/ElasticsearchClientService.js"
click node_interface_services "https://github.com/openbackhaul/macaddresstablerecorder/tree/develop/server/service"
click node_runtime "https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/index.js"
click node_logging "https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/service/LoggingService.js"

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_basic_api,node_individual_api,node_elk_api,node_interface_apis toneBlue
class node_individual_services,node_cyclic,node_utility toneAmber
class node_mwdi,node_elasticsearch,node_es_preparation,node_es_service,node_interface_services,node_requestor toneMint
class node_runtime,node_logging toneRose
class node_caller,node_microwave_devices toneIndigo
```

## Components

### REST interfaces

- [Basic services API](https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/controllers/BasicServices.js): `server/controllers/BasicServices.js`
- [Individual services API](https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/controllers/IndividualServices.js): `server/controllers/IndividualServices.js`
- [Elasticsearch API](https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/controllers/ElasticsearchClient.js): `server/controllers/ElasticsearchClient.js`
- [Pattern interface APIs](https://github.com/openbackhaul/macaddresstablerecorder/tree/develop/server/controllers): `server/controllers`

### Collection workflow

- [MAC readout and queries](https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/service/IndividualServicesService.js): `server/service/IndividualServicesService.js`
- [Cyclic scheduler](https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/service/individualServices/CyclicProcessService/cyclicProcess.js): `server/service/individualServices/CyclicProcessService/cyclicProcess.js`
- [Profile and forwarding lookup](https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/service/individualServices/IndividualServicesUtility.js): `server/service/individualServices/IndividualServicesUtility.js`

### Integrations and storage

- **Microwave inventory**
- **Elasticsearch**
- [Elasticsearch preparation](https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/service/individualServices/ElasticsearchPreparation.js): `server/service/individualServices/ElasticsearchPreparation.js`
- [Elasticsearch client service](https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/service/ElasticsearchClientService.js): `server/service/ElasticsearchClientService.js`
- [Pattern interface services](https://github.com/openbackhaul/macaddresstablerecorder/tree/develop/server/service): `server/service`

### Application runtime

- [HTTP application runtime](https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/index.js): `server/index.js`
- [Logging](https://github.com/openbackhaul/macaddresstablerecorder/blob/develop/server/service/LoggingService.js): `server/service/LoggingService.js`

### Other components

- **Service caller**
- **Microwave devices**
- **Immediate-readout requestor**

## Connections

- Service caller → Basic services API: invokes services (evidence: `README.md`)
- Service caller → Individual services API: requests readout or data (evidence: `README.md`)
- Service caller → Elasticsearch API: configures Elasticsearch (evidence: `README.md`)
- Basic services API → Pattern interface APIs: exposes pattern operations (evidence: `server/controllers/BasicServices.js`)
- Individual services API → MAC readout and queries: delegates operations (evidence: `server/controllers/IndividualServices.js`)
- Elasticsearch API → Elasticsearch client service: delegates configuration (evidence: `server/controllers/ElasticsearchClient.js`)
- HTTP application runtime → Cyclic scheduler: starts cycle (evidence: `server/index.js`)
- HTTP application runtime → Profile and forwarding lookup: resolves forwarding (evidence: `server/index.js`)
- Cyclic scheduler → MAC readout and queries: requests device readout (evidence: `server/service/individualServices/CyclicProcessService/cyclicProcess.js`)
- Cyclic scheduler → Profile and forwarding lookup: loads profiles (evidence: `server/service/individualServices/CyclicProcessService/cyclicProcess.js`)
- MAC readout and queries → Microwave inventory: gets device inventory (evidence: `server/service/IndividualServicesService.js`)
- MAC readout and queries → Microwave devices: reads MAC tables (evidence: `README.md`)
- MAC readout and queries → Elasticsearch: stores and queries tables (evidence: `README.md`)
- MAC readout and queries → Immediate-readout requestor: returns requested data (evidence: `server/service/IndividualServicesService.js`)
- Elasticsearch preparation → Elasticsearch: prepares index (evidence: `server/service/individualServices/ElasticsearchPreparation.js`)
- Elasticsearch client service → Elasticsearch: configures client (evidence: `server/service/ElasticsearchClientService.js`)
- Pattern interface APIs → Pattern interface services: delegates configuration (evidence: `server/controllers/ElasticsearchClient.js`)
- HTTP application runtime → Logging: creates logger (evidence: `server/index.js`)
