# csabikaa97/hausz architecture

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

- Interactive diagram: https://gitdiagram.com/csabikaa97/hausz
- Repository: https://github.com/csabikaa97/hausz

## Overview

##### Main System Components

a) Frontend Services:
- Web Interface (HTML/CSS/JS)
- Admin Panel
- File Sharing Interface
- TeamSpeak Interface
- Registration System

b) Backend Services:
- Rust Web Server
- Database System (MySQL with master-slave configuration)
- TeamSpeak Server
- Various Docker Containers (Minecraft, Navidrome, PiHole, VPN, etc.)

c) Infrastructure:
- Kubernetes Cluster (K3s)
- Docker Containerization
- Load Balancer (MetalLB)
- SSL/TLS Layer

##### Component Relationships

a) Client Layer:
**[Web Browsers] → [SSL/TLS] → [Load Balancer]**

b) Service Layer:
**[Load Balancer] → [Rust Web Server]**
- → [Various Containerized Services]

c) Data Layer:
**[Services] → [MySQL Master DB]**
- ↓
- [MySQL Slave DB]

##### Specific Implementation Details

Key architectural elements:

**[Frontend Layer]**
- ↓
**[Rust Web Server]**
- Session Management
- File Handling
- User Authentication
- Admin Controls
- ↓
**[Service Layer]**
- TeamSpeak Service
- File Sharing Service
- Minecraft Server
- VPN Service
- Other Containerized Services
- ↓
**[Database Layer]**
- Master DB (User data, Permissions)
- Slave DB (Replication)

##### Deployment Architecture

Kubernetes deployment structure:
**[K3s Cluster]**
- MetalLB Configuration
- Service Deployments
- StatefulSets
- Persistent Volumes

##### Additional Elements

Annotations for:
- Docker container relationships
- Database replication flow
- Authentication flows
- File storage paths
- Backup systems

## Diagram (Mermaid)

```mermaid
graph TB
    %% Client Layer
    Client["Web Browsers"]:::client

    %% Security Layer
    subgraph Security
        SSL["SSL/TLS Layer"]:::security
        click SSL "https://github.com/csabikaa97/Hausz/blob/master/k8s/egyszeri_konfiguraciok/ssl-tanusitvany-secret.yaml"
        LB["Load Balancer (MetalLB)"]:::infrastructure
        click LB "https://github.com/csabikaa97/Hausz/blob/master/k8s/egyszeri_konfiguraciok/metallb-layer2-ad.yaml"
    end

    %% Frontend Layer
    subgraph Frontend
        WebUI["Web Interface"]:::frontend
        click WebUI "https://github.com/csabikaa97/Hausz/tree/master/public/"
        AdminUI["Admin Panel"]:::frontend
        click AdminUI "https://github.com/csabikaa97/Hausz/tree/master/public/admin/"
        FileUI["File Sharing Interface"]:::frontend
        click FileUI "https://github.com/csabikaa97/Hausz/tree/master/public/megoszto/"
        TSUI["TeamSpeak Interface"]:::frontend
        click TSUI "https://github.com/csabikaa97/Hausz/tree/master/public/teamspeak/"
        RegUI["Registration System"]:::frontend
        click RegUI "https://github.com/csabikaa97/Hausz/tree/master/public/kezelo/"
    end

    %% Backend Layer
    subgraph Backend
        RustServer["Rust Web Server"]:::backend
        click RustServer "https://github.com/csabikaa97/Hausz/tree/master/webszerver/"
        Auth["Authentication System"]:::backend
        click Auth "https://github.com/csabikaa97/Hausz/blob/master/webszerver/src/oldalak/belepteto_rendszer.rs"
        Session["Session Management"]:::backend
        click Session "https://github.com/csabikaa97/Hausz/blob/master/webszerver/src/session.rs"
    end

    %% Services Layer
    subgraph Services
        TS["TeamSpeak Server"]:::service
        click TS "https://github.com/csabikaa97/Hausz/tree/master/docker/teamspeak/"
        MC["Minecraft Server"]:::service
        click MC "https://github.com/csabikaa97/Hausz/tree/master/docker/minecraft-server/"
        ND["Navidrome"]:::service
        click ND "https://github.com/csabikaa97/Hausz/tree/master/docker/navidrome/"
        PH["PiHole"]:::service
        click PH "https://github.com/csabikaa97/Hausz/tree/master/docker/pihole/"
        VPN["VPN Service"]:::service
        click VPN "https://github.com/csabikaa97/Hausz/tree/master/docker/vpn/"
    end

    %% Database Layer
    subgraph Database
        MasterDB["Master Database"]:::database
        click MasterDB "https://github.com/csabikaa97/Hausz/tree/master/docker/adatbazis/"
        SlaveDB["Slave Database"]:::database
        click SlaveDB "https://github.com/csabikaa97/Hausz/tree/master/docker/adatbazis-slave/"
    end

    %% Infrastructure Layer
    subgraph Infrastructure
        K3s["Kubernetes Cluster (K3s)"]:::infrastructure
        click K3s "https://github.com/csabikaa97/Hausz/tree/master/k8s/"
    end

    %% Connections
    Client --> SSL
    SSL --> LB
    LB --> Frontend
    Frontend --> RustServer
    RustServer --> Auth
    RustServer --> Session
    RustServer --> Services
    Auth --> MasterDB
    Session --> MasterDB
    Services --> MasterDB
    MasterDB --> SlaveDB
    K3s --> Services

    %% Styles
    classDef client fill:#f9f,stroke:#333,stroke-width:2px
    classDef security fill:#f55,stroke:#333,stroke-width:2px
    classDef frontend fill:#9cf,stroke:#333,stroke-width:2px
    classDef backend fill:#9f9,stroke:#333,stroke-width:2px
    classDef service fill:#fc9,stroke:#333,stroke-width:2px
    classDef database fill:#ff9,stroke:#333,stroke-width:2px
    classDef infrastructure fill:#ccc,stroke:#333,stroke-width:2px
```
