Skip to main content

homelab diagram

%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#263238', 'primaryTextColor': '#fff', 'primaryBorderColor': '#fff', 'lineColor': '#b0bec5', 'tertiaryColor': '#fff', 'mainBkg': '#1e1e1e'}}}%%
flowchart TD
    %% ==========================================
    %% 1. GLOBAL STYLES
    %% ==========================================
    linkStyle default stroke:#b0bec5,stroke-width:2px;
    
    %% ==========================================
    %% 2. TOP LEVEL: INTERNET
    %% ==========================================
    Internet((Internet))
    style Internet fill:#fff,stroke:#333,color:#000

    %% ==========================================
    %% 3. LEVEL 2: ORACLE CLOUD
    %% ==========================================
    subgraph OracleCloud [Oracle Cloud - Free Tier]
        direction TB
        style OracleCloud fill:#0d47a1,stroke:#fff,stroke-width:3px,color:#fff
        
        %% Dobby (Left)
        subgraph DobbyBox [Dobby - Game Node 2]
            direction TB
            style DobbyBox fill:#37474f,stroke:#fff,stroke-width:2px,color:#fff
            D_Wing[Pterodactyl Wing]:::service
            D_MC[Minecraft Cluster]:::service
        end

        %% Phoenix (Right)
        subgraph PhoenixBox [Phoenix - Gateway]
            direction TB
            style PhoenixBox fill:#37474f,stroke:#fff,stroke-width:2px,color:#fff
            P_Traefik[Traefik Proxy]:::service
            P_Stack[WG Interface<br/>Fail2Ban<br/>Watchtower]:::service
        end
    end

    %% ==========================================
    %% 4. LEVEL 3: HOME NETWORK
    %% ==========================================
    subgraph HomeNet [Home Network - Deltona]
        direction TB
        style HomeNet fill:#1b5e20,stroke:#fff,stroke-width:3px,color:#fff

        Unifi[Unifi Router]:::device

        %% FIREBOLT (Center)
        subgraph FireboltBox [Firebolt - Main Server]
            direction TB
            style FireboltBox fill:#37474f,stroke:#fff,stroke-width:2px,color:#fff
            
            F_Traefik[Traefik Internal]:::service

            %% Internal Stacks
            subgraph F_Infra [Infrastructure]
                direction TB
                style F_Infra fill:#263238,stroke:#90a4ae,stroke-dasharray: 5 5,color:#fff
                F_Auth[Authentik IDP]:::service
                F_Portainer[Portainer Server]:::service
                F_Homepage[Homepage]:::service
            end
            
            subgraph F_Admin [Admin Tools]
                direction TB
                style F_Admin fill:#263238,stroke:#90a4ae,stroke-dasharray: 5 5,color:#fff
                F_Bitwarden[Vaultwarden]:::service
                F_Bookstack[BookStack]:::service
                F_Duplicati[Duplicati]:::service
            end

            subgraph F_Media [Media Stack]
                direction TB
                style F_Media fill:#263238,stroke:#90a4ae,stroke-dasharray: 5 5,color:#fff
                F_Plex[Plex Media Server]:::service
                F_Arr[Sonarr/Radarr/Prowlarr]:::service
                F_Download[qBit/Unpackerr]:::service
            end

            subgraph F_Games [Game Stack]
                direction TB
                style F_Games fill:#263238,stroke:#90a4ae,stroke-dasharray: 5 5,color:#fff
                F_Panel[Ptero Panel]:::service
                F_Wing[Ptero Wing]:::service
            end
        end

        %% NORBERT (Below Firebolt)
        subgraph NorbertBox [Norbert - Storage]
            direction TB
            style NorbertBox fill:#37474f,stroke:#fff,stroke-width:2px,color:#fff
            N_Stack[Home Assistant<br/>LLMCord AI]:::service
            N_Games[Game Node 1<br/>Wing / Ark / MC Test]:::service
            N_Storage[Media Storage]:::service
        end
        
        %% PIHOLE (Bottom)
        subgraph PiHoleBox [Raspberry Pi]
            direction TB
            style PiHoleBox fill:#37474f,stroke:#fff,stroke-width:2px,color:#fff
            PI_SVC[DNS Sinkhole]:::service
            PI_VPN[PiVPN Ingress]:::service
        end
    end

    %% ==========================================
    %% 5. THE VERTICAL ANCHORS (THE FIX)
    %% ==========================================
    %% These invisible links force the layers to separate vertically
    
    %% Force Internet above Oracle
    Internet ~~~ P_Traefik
    
    %% FORCE ORACLE ABOVE HOME (The critical fix)
    %% We link the BOTTOM node of Oracle to the TOP node of Home
    P_Stack ~~~ F_Traefik
    D_MC ~~~ Unifi

    %% Force Firebolt internal order
    F_Traefik ~~~ F_Infra ~~~ F_Admin ~~~ F_Media ~~~ F_Games
    
    %% Force Firebolt above Norbert above PiHole
    F_Games ~~~ N_Stack
    N_Storage ~~~ PI_SVC

    %% ==========================================
    %% 6. CONNECTIONS
    %% ==========================================
    
    %% --- MAIN INGRESS ---
    Internet == HTTPS ==> P_Traefik
    Internet -- Ports --> Unifi
    Internet -- Ports --> D_MC

    %% --- TUNNEL ---
    P_Traefik ==>|Tunnel| F_Traefik
    
    %% --- UNIFI PORT FORWARDING ---
    Unifi -.->|32400| F_Plex
    Unifi -.->|Game Ports| F_Games
    Unifi -.->|Game Ports| N_Games
    Unifi -.->|UDP 51820| PI_VPN

    %% --- INTERNAL ROUTING ---
    F_Traefik --> F_Infra & F_Admin & F_Media & F_Games
    F_Traefik -.-> N_Stack & PI_SVC
    
    %% --- SPLIT ROUTE ---
    P_Stack -.-> N_Games

    %% --- MANAGEMENT ---
    F_Portainer -.-> P_Stack & N_Stack
    F_Download -.->|NFS| N_Storage

    %% CLASS DEFINITIONS
    classDef device fill:#37474f,stroke:#fff,stroke-width:2px,color:#fff
    classDef service fill:#212121,stroke:#90a4ae,stroke-width:1px,color:#fff