# deepanshudixit/100-days-nbot architecture

> Architecture diagram of the GitHub repository deepanshudixit/100-days-nbot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/deepanshudixit/100-days-nbot
- Repository: https://github.com/deepanshudixit/100-days-nbot

## Overview

##### Project type and purpose
- This is a self-guided, full-stack network-automation training repository built around Nautobot (a Django-based Source-of-Truth and automation platform).
- It bundles:
- A Docker-based development container environment (.devcontainer)
- A containerlab (clab) network-emulation topology
- A sample Nautobot database (Lab_Setup/database_files)
- 100 daily modules, each with README + images for progressive tutorials

##### File structure
- Top-level “.devcontainer”: VS Code remote-container definitions.
- “Lab_Setup”: SQL seed DB + setup instructions.
- “clab”: containerlab YAML + device configs (bos-acc, bos-rtr, nyc-acc, nyc-rtr).
- “DayXXX_…” folders: static training content (not part of runtime).
- “postCreate.sh”: bootstrap script after container creation.

##### Extract architecture hints from the README
- Focus is on Nautobot Jobs & Apps (Python code injected into a running Nautobot instance).
- Learners write Django models, views, templates, Jobs that exercise the ORM, REST API, UI.
- External integrations: Ansible, NIST NVD (CVE data), Git for sharing.

##### Main runtime components
a. Developer Machine (VS Code Client)
b. Devcontainer Environment
- Docker/Compose or single Dockerfile container running:
– Nautobot (Django app + plugins)
– PostgreSQL (Seeded by nauto-bot-demo.sql)
– Redis (caching, optional)
- postCreate.sh configures the container on first launch
c. containerlab Network Lab (“clab”)
- Four virtual devices (bos-acc-01, bos-rtr-01, nyc-acc-01, nyc-rtr-01)
- Emulated under the same host or in sibling containers
d. External Services
- NIST NVD API (for CVE Challenge parts)
- GitHub / Slack / Email (for social-learning feedback loop)

##### Relationships & data flows
- Developer Machine → (SSH/HTTP) → Devcontainer
- Devcontainer ↔ PostgreSQL (ORM read/write)
- Devcontainer ↔ Redis (cache)
- Devcontainer/Jobs → CLI/NETCONF/RESTCONF → clab Devices
- Nautobot REST API → UI (Browser)
- Jobs → HTTP calls → NIST NVD API
- Git operations → GitHub

##### Architectural patterns
- Monolithic Django application with plugin architecture (Nautobot Apps & Jobs).
- MVC (Models = ORM, Views = REST + UI, Templates = HTML panels).
- Infrastructure-as-Code: containerlab defines the network topology.
- Dev-container pattern for reproducible dev environment.
- External-integration pattern (Ansible + external REST).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Development Layer
    subgraph "Development" 
        direction TB
        DevMachine["Developer Machine\n(VS Code + Local Workspace)"]:::developer
        Browser["Browser UI"]:::developer
    end

    %% Devcontainer Environment
    subgraph "Devcontainer Environment"
        direction TB
        DevDef1["Lab_Scenario_1 devcontainer.json"]:::developer
        DevDef2["Lab_Scenario_2 devcontainer.json"]:::developer
        Bootstrap["postCreate.sh"]:::developer
        subgraph "Containers"
            direction TB
            Nautobot["Nautobot App"]:::core
            PostgreSQL["PostgreSQL DB"]:::core
            Redis["Redis Cache"]:::core
            Jobs["Jobs Engine"]:::core
        end
    end

    %% Lab Network
    subgraph "Lab Network (containerlab)"
        direction TB
        Topo["ceos-lab.clab.yml"]:::network
        BosAcc["bos-acc-01"]:::network
        BosRtr["bos-rtr-01"]:::network
        NycAcc["nyc-acc-01"]:::network
        NycRtr["nyc-rtr-01"]:::network
    end

    %% External Services
    NVD["NIST NVD API"]:::external
    GitHub["GitHub Repo"]:::external

    %% Connections
    DevMachine -->|"SSH/HTTP"| DevDef1
    DevMachine -->|"SSH/HTTP"| DevDef2
    DevDef1 --> Containers
    DevDef2 --> Containers
    Bootstrap --> Containers

    Nautobot -->|"ORM Read/Write"| PostgreSQL
    Nautobot -->|"Cache"| Redis
    Jobs -->|"NETCONF/RESTCONF"| BosAcc
    Jobs -->|"NETCONF/RESTCONF"| BosRtr
    Jobs -->|"NETCONF/RESTCONF"| NycAcc
    Jobs -->|"NETCONF/RESTCONF"| NycRtr
    Jobs -->|"HTTP"| NVD
    Nautobot -->|"REST API"| Browser
    GitHub -->|"git pull/push"| DevMachine
    GitHub -->|"bootstrap code"| DevDef1
    GitHub -->|"bootstrap code"| DevDef2

    Topo --> BosAcc
    Topo --> BosRtr
    Topo --> NycAcc
    Topo --> NycRtr

    %% Click Events
    click DevMachine "https://github.com/deepanshudixit/100-days-nbot/blob/main/README.md"
    click DevDef1 "https://github.com/deepanshudixit/100-days-nbot/blob/main/.devcontainer/Lab_Scenario_1/devcontainer.json"
    click DevDef2 "https://github.com/deepanshudixit/100-days-nbot/blob/main/.devcontainer/Lab_Scenario_2/devcontainer.json"
    click Bootstrap "https://github.com/deepanshudixit/100-days-nbot/blob/main/postCreate.sh"
    click PostgreSQL "https://github.com/deepanshudixit/100-days-nbot/blob/main/Lab_Setup/database_files/nautobot-demo.sql"
    click Topo "https://github.com/deepanshudixit/100-days-nbot/blob/main/clab/ceos-lab.clab.yml"
    click BosAcc "https://github.com/deepanshudixit/100-days-nbot/blob/main/clab/startup-configs/bos-acc-01.conf"
    click BosRtr "https://github.com/deepanshudixit/100-days-nbot/blob/main/clab/startup-configs/bos-rtr-01.conf"
    click NycAcc "https://github.com/deepanshudixit/100-days-nbot/blob/main/clab/startup-configs/nyc-acc-01.conf"
    click NycRtr "https://github.com/deepanshudixit/100-days-nbot/blob/main/clab/startup-configs/nyc-rtr-01.conf"
    click GitHub "https://github.com/deepanshudixit/100-days-nbot/blob/main/README.md"
    click PostgreSQL "https://github.com/deepanshudixit/100-days-nbot/blob/main/Lab_Setup/database_files/nautobot-demo.sql"
    click LabSetup1 "https://github.com/deepanshudixit/100-days-nbot/blob/main/Lab_Setup/scenario_1_setup/README.md"
    click LabSetup2 "https://github.com/deepanshudixit/100-days-nbot/blob/main/Lab_Setup/scenario_2_setup/README.md"
    click LabSetup3 "https://github.com/deepanshudixit/100-days-nbot/blob/main/Lab_Setup/lab_related_notes/README.md"

    %% Styles
    classDef developer fill:#8FBC8F,stroke:#333,stroke-width:1px
    classDef core fill:#87CEEB,stroke:#333,stroke-width:1px
    classDef network fill:#FFA500,stroke:#333,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#333,stroke-width:1px
```
