# lukasknuth/homeserver architecture

> Architecture diagram of the GitHub repository lukasknuth/homeserver, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lukasknuth/homeserver
- Repository: https://github.com/lukasknuth/homeserver

## Overview

Key Components to Include:

##### Hardware Layer
- SD Card storage indication

##### Operating System Layer
- Talos Linux as the base OS
- Minimal, Kubernetes-focused nature
- Connection to Talos configuration patches (from talos/patches/)

##### Container Orchestration Layer
- Kubernetes cluster (single node)
- Deliberate exclusion of CRDs for simplicity

##### Core Infrastructure Services
- Traefik Ingress Controller (from deploy/ingress/)
- DNS Services (from deploy/dns/)
- MinIO Object Storage (from deploy/minio.tf)
- Logging Infrastructure (from deploy/logs/)

##### Storage Architecture
- Ephemeral storage on the node
- Litestream replication flow to NAS
- SQLite databases within applications

##### Application Layer
- Web applications (using deploy/modules/web_app)
- Dashboard component (from deploy/dashboard/)

- [External Access Layer]
- ↓
- [Ingress Layer (Traefik)]
- ↓
- [Application Layer]
- ↓
- [Infrastructure Services]
- ↓
- [Kubernetes Layer]
- ↓
- [Talos OS Layer]
- ↓
- [Hardware Layer]

##### Notes Section
Callouts highlighting:
- Deliberate simplicity choices
- No CRDs policy
- SQLite-only database strategy
- Continuous backup approach

- Single-node simplicity
- Terraform-based deployment
- Ephemeral storage with continuous replication
- Minimal dependencies and complexity

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef hardware fill:#d3d3d3,stroke:#333
    classDef os fill:#f5f5f5,stroke:#333
    classDef k8s fill:#326CE5,stroke:#333,color:white
    classDef infra fill:#3498DB,stroke:#333,color:white
    classDef app fill:#2ECC71,stroke:#333,color:white
    classDef storage fill:#F1C40F,stroke:#333
    classDef config fill:#E74C3C,stroke:#333,color:white

    %% Hardware Layer
    RPI["Raspberry Pi 4B (4GB)"]:::hardware
    SDCARD["SD Card Storage"]:::hardware

    %% OS Layer
    TALOS["Talos Linux OS"]:::os
    PATCHES["OS Patches & Config"]:::os

    %% Kubernetes Layer
    K8S["Kubernetes Single Node"]:::k8s

    %% Infrastructure Services
    subgraph Infrastructure
        TRAEFIK["Traefik Ingress"]:::infra
        DNS["DNS Services"]:::infra
        MINIO["MinIO Storage"]:::infra
        LOGGING["Logging System"]:::infra
    end

    %% Storage Architecture
    subgraph Storage
        EPHEMERAL["Ephemeral Storage"]:::storage
        LITESTREAM["Litestream"]:::storage
        NAS["NAS Backup"]:::storage
        SQLITE["SQLite DBs"]:::storage
    end

    %% Application Layer
    subgraph Applications
        WEBAPPS["Web Applications"]:::app
        DASHBOARD["Dashboard"]:::app
    end

    %% Configuration Management
    TERRAFORM["Terraform Control"]:::config

    %% Relationships
    RPI --> SDCARD
    SDCARD --> TALOS
    TALOS --> PATCHES
    TALOS --> K8S
    K8S --> Infrastructure
    K8S --> Storage
    K8S --> Applications
    TERRAFORM -.-> K8S
    TERRAFORM -.-> Infrastructure
    TERRAFORM -.-> Applications
    SQLITE --> LITESTREAM
    LITESTREAM --> NAS
    TRAEFIK --> WEBAPPS
    TRAEFIK --> DASHBOARD

    %% Click Events
    click PATCHES "https://github.com/lukasknuth/homeserver/tree/main//talos/patches"
    click TRAEFIK "https://github.com/lukasknuth/homeserver/tree/main//deploy/ingress"
    click DNS "https://github.com/lukasknuth/homeserver/tree/main//deploy/dns"
    click MINIO "https://github.com/lukasknuth/homeserver/blob/main//deploy/minio.tf"
    click LOGGING "https://github.com/lukasknuth/homeserver/tree/main//deploy/logs"
    click WEBAPPS "https://github.com/lukasknuth/homeserver/tree/main//deploy/modules/web_app"
    click DASHBOARD "https://github.com/lukasknuth/homeserver/tree/main//deploy/dashboard"
    click TERRAFORM "https://github.com/lukasknuth/homeserver/blob/main//deploy/infra.tf"
    click RPI "https://github.com/lukasknuth/homeserver/blob/main//talos/patches/rpi4-controlplane.yaml"
    click DNS "https://github.com/lukasknuth/homeserver/blob/main//talos/patches/dns.yaml"

    %% Legend
    subgraph Legend
        L1["Hardware Component"]:::hardware
        L2["OS Component"]:::os
        L3["Kubernetes"]:::k8s
        L4["Infrastructure Service"]:::infra
        L5["Application"]:::app
        L6["Storage"]:::storage
        L7["Configuration"]:::config
    end
```
