# autonetops/autonetops_bgp_fundamentals architecture

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

- Interactive diagram: https://gitdiagram.com/autonetops/autonetops_bgp_fundamentals
- Repository: https://github.com/autonetops/autonetops_bgp_fundamentals

## Overview

##### Main Components
a. DevContainer Environment: Represented by the “.devcontainer” directory. Include separate entries for the different labs (lab1, lab2_med) and even a nested “cisco” specific setup inside lab1.
b. Lab Environments:
- Lab1: Contains the “click” module (CLI interface using Python’s Click framework), configuration files for Cisco and Arista, tasks instructions and their solutions, and topology definitions (clab YAML files) that likely define the simulated network.
- Lab2_med: Similar structure, with its own configurations, topology, and tasks.
c. Core Functional Modules:
- The autoNetOps package (within lab1/click/autonetops) serves as the core logic for automating network device configuration.
- Utility modules (in lab1/click/autonetops/utils) help manage CLI configurations and additional functions.
d. Configuration and Topology Files:
- “configs” directories in each lab hold the vendor-specific configuration templates.
- “tasks” directories include both the tasks description and corresponding solutions, indicating guided exercises.
e. External Dependencies & Tools:
- Docker (per Dockerfiles found in the .devcontainer directories).
- GitHub CLI (gh commands in the README) for repository management.

##### Relationships and Interactions
b. Within Lab1, show the CLI module (Click based) as the user-facing component that triggers network automation processes. Then link it to:
- The autoNetOps core module (business logic of network automation).
- The configuration files and topology definitions that provide necessary inputs.
- The tasks directory, which represents how users interact with the lab exercises (receiving instructions and submitting their work).
c. For Lab2_med, similarly link its topology definitions, configurations, and tasks to its main management interface.
d. That both labs share a common purpose but are adapted for possibly different exercise complexities or topics.

##### Architectural Patterns
a. Separation of concerns is present – the CLI interface (user interaction) is kept separate from the core automation logic (autoNetOps modules) and the configuration/template data.
b. Containerization: The use of .devcontainer and Docker-related files suggests a micro-environment strategy aimed at reproducibility and isolation.
c. Modularity: Each lab is self-contained, having its own configurations and tasks, but they follow a common structural pattern.

##### Relevant Technologies and Frameworks
- Docker (container orchestration and environment provisioning)
- Python (especially the Click framework for CLI development)
- YAML (for topology definitions and task configurations)
- GitHub CLI (as indicated in the README for repository creation and management)
- Possibly network simulation tools like containerlab (inferred from the “.clab.yaml” files)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% DevContainer Environment Nodes
    DC1["DevContainer Lab1"]:::dev
    DC1C["DevContainer Lab1 Cisco"]:::dev
    DC2["DevContainer Lab2_med"]:::dev

    %% Lab1 Environment Subgraph
    subgraph "Lab1 Environment"
        L1CLI["Lab1 CLI Interface"]:::lab
        L1Core["Lab1 Core Module (autoNetOps)"]:::core
        L1Util["Lab1 Utility Modules"]:::util
        L1Config["Lab1 Configurations (Cisco & Arista)"]:::config
        L1Tasks["Lab1 Tasks & Topologies"]:::task
    end

    %% Lab2_med Environment Subgraph
    subgraph "Lab2_med Environment"
        L2Interface["Lab2_med Management Interface"]:::lab
        L2Config["Lab2_med Configurations (Cisco & Arista)"]:::config
        L2Tasks["Lab2_med Tasks & Topologies"]:::task
    end

    %% Connections from DevContainer to Lab Environments
    DC1 -->|"provisions"| L1CLI
    DC1C -->|"supports"| L1Config
    DC2 -->|"provisions"| L2Interface

    %% Lab1 Component Interactions
    L1CLI -->|"triggers"| L1Core
    L1Core -->|"utilizes"| L1Util
    L1CLI -->|"reads"| L1Config
    L1CLI -->|"executes"| L1Tasks

    %% Lab2_med Component Interactions
    L2Interface -->|"reads"| L2Config
    L2Interface -->|"executes"| L2Tasks

    %% Click Events for Component Mapping
    click DC1 "https://github.com/autonetops/autonetops_bgp_fundamentals/tree/main/.devcontainer/lab1"
    click DC1C "https://github.com/autonetops/autonetops_bgp_fundamentals/tree/main/.devcontainer/lab1/cisco"
    click DC2 "https://github.com/autonetops/autonetops_bgp_fundamentals/tree/main/.devcontainer/lab2_med"
    click L1CLI "https://github.com/autonetops/autonetops_bgp_fundamentals/tree/main/lab1/click"
    click L1Core "https://github.com/autonetops/autonetops_bgp_fundamentals/tree/main/lab1/click/autonetops"
    click L1Util "https://github.com/autonetops/autonetops_bgp_fundamentals/tree/main/lab1/click/autonetops/utils"
    click L1Config "https://github.com/autonetops/autonetops_bgp_fundamentals/tree/main/lab1/configs"
    click L1Tasks "https://github.com/autonetops/autonetops_bgp_fundamentals/tree/main/lab1/tasks"
    click L2Config "https://github.com/autonetops/autonetops_bgp_fundamentals/tree/main/lab2_med/configs"
    click L2Tasks "https://github.com/autonetops/autonetops_bgp_fundamentals/tree/main/lab2_med/tasks"

    %% Styles
    classDef dev fill:#b3cde0,stroke:#000,stroke-width:2px;
    classDef lab fill:#ccebc5,stroke:#000,stroke-width:2px;
    classDef core fill:#fddaec,stroke:#000,stroke-width:2px;
    classDef util fill:#fbb4ae,stroke:#000,stroke-width:2px;
    classDef config fill:#decbe4,stroke:#000,stroke-width:2px;
    classDef task fill:#fed9a6,stroke:#000,stroke-width:2px;
```
