# palisadoesfoundation/switchmap-ng architecture

> Architecture diagram of the GitHub repository palisadoesfoundation/switchmap-ng, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/palisadoesfoundation/switchmap-ng
- Repository: https://github.com/palisadoesfoundation/switchmap-ng

## Overview

##### Main Components Identification

a) Poller Service (/switchmap/poller/)
- SNMP polling functionality
- MIB handling for different vendors (Cisco, Juniper, Generic)
- Device data collection

b) Server Component (/switchmap/server/)
- Database management
- API endpoints
- Data ingestion system

c) Dashboard (/switchmap/dashboard/)
- Web interface
- Data visualization
- Search functionality
- Device monitoring

d) Database Layer (/switchmap/server/db/)
- Multiple tables (device, event, IP, MAC, VLAN, etc.)
- Data models and schemas

**[Network Devices]**
- ↓ SNMP
**[Poller Service] → [Server Component] ← [Dashboard]**
- ↓              ↕                     ↑
- [Database Layer]    [Web Browser]

##### Component Details

For each component, include these specific elements:

Poller Service:
- SNMP Manager
- MIB Handlers (Cisco, Juniper, Generic)
- Device Update System

Server Component:
- GraphQL API
- REST Endpoints
- Data Ingest Pipeline
- Database Connectors

Dashboard:
- HTML Templates
- Device Pages
- Search Interface
- Event Monitoring

Database Layer:
- Device Tables
- MAC/IP Tables
- VLAN Tables
- Event Logging

##### Data Flow Indicators

- SNMP polling flow from devices
- Data ingestion path
- API requests/responses
- User interface interactions

##### Integration Points

Highlight:
- API endpoints
- Database connections
- SNMP communication channels
- Web server interfaces

##### Additional Elements

Include:
- Version information
- System requirements
- Key dependencies

##### Technical Details

Specifications:
- Python-based implementation
- SNMP protocol usage
- Web framework details
- Database technology

##### Deployment Context

Show:
- System boundaries
- External dependencies
- Network boundaries
- Security zones

Remember to include notes about:
- Scalability considerations
- Security boundaries
- Data flow directions
- Component dependencies

This will provide a clear understanding of how Switchmap-NG operates as a complete system for monitoring and visualizing Ethernet switch information.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph External
        ND[Network Devices]:::external
        WB[Web Browser]:::external
    end

    subgraph Poller["Poller Service"]
        SNMP[SNMP Manager]:::poller
        MIB[MIB Handlers]:::poller
        DUS[Device Update System]:::poller
    end

    subgraph Server["Server Component"]
        GQL[GraphQL API]:::server
        REST[REST Endpoints]:::server
        DIP[Data Ingest Pipeline]:::server
    end

    subgraph Dashboard
        HTML[HTML Templates]:::dashboard
        DP[Device Pages]:::dashboard
        SI[Search Interface]:::dashboard
        EM[Event Monitoring]:::dashboard
    end

    subgraph DB["Database Layer"]
        DT[Device Tables]:::database
        MT[MAC/IP Tables]:::database
        VT[VLAN Tables]:::database
        EL[Event Logging]:::database
    end

    ND --> |SNMP| SNMP
    SNMP --> MIB
    MIB --> DUS
    DUS --> DIP
    
    DIP --> DT
    DIP --> MT
    DIP --> VT
    DIP --> EL
    
    GQL --> DB
    REST --> DB
    
    HTML --> GQL
    DP --> GQL
    SI --> GQL
    EM --> REST
    
    WB --> HTML
    WB --> DP
    WB --> SI
    WB --> EM

    %% Click Events
    click SNMP "https://github.com/PalisadoesFoundation/switchmap-ng/blob/main/switchmap/poller/snmp/snmp_manager.py"
    click MIB "https://github.com/PalisadoesFoundation/switchmap-ng/tree/main/switchmap/poller/snmp/mib/"
    click DUS "https://github.com/PalisadoesFoundation/switchmap-ng/blob/main/switchmap/poller/update/device.py"
    click GQL "https://github.com/PalisadoesFoundation/switchmap-ng/blob/main/switchmap/server/api/routes/graphql.py"
    click REST "https://github.com/PalisadoesFoundation/switchmap-ng/blob/main/switchmap/server/api/routes/post.py"
    click DIP "https://github.com/PalisadoesFoundation/switchmap-ng/blob/main/switchmap/server/db/ingest/ingest.py"
    click HTML "https://github.com/PalisadoesFoundation/switchmap-ng/tree/main/switchmap/dashboard/net/html/templates/"
    click DP "https://github.com/PalisadoesFoundation/switchmap-ng/blob/main/switchmap/dashboard/net/html/pages/device.py"
    click SI "https://github.com/PalisadoesFoundation/switchmap-ng/blob/main/switchmap/dashboard/net/html/pages/search.py"
    click EM "https://github.com/PalisadoesFoundation/switchmap-ng/blob/main/switchmap/dashboard/net/html/pages/events.py"
    click DT "https://github.com/PalisadoesFoundation/switchmap-ng/blob/main/switchmap/server/db/table/device.py"
    click MT "https://github.com/PalisadoesFoundation/switchmap-ng/blob/main/switchmap/server/db/table/macip.py"
    click VT "https://github.com/PalisadoesFoundation/switchmap-ng/blob/main/switchmap/server/db/table/vlan.py"
    click EL "https://github.com/PalisadoesFoundation/switchmap-ng/blob/main/switchmap/server/db/table/event.py"

    classDef external fill:#ADD8E6,stroke:#333,stroke-width:2px
    classDef poller fill:#90EE90,stroke:#333,stroke-width:2px
    classDef server fill:#90EE90,stroke:#333,stroke-width:2px
    classDef dashboard fill:#FFA500,stroke:#333,stroke-width:2px
    classDef database fill:#FFD700,stroke:#333,stroke-width:2px
```
