Skip to content

Architecture

System Architecture Diagram

┌──────────────────────────────────────────────────────────────────────────────┐
│                           KAVI INFRASTRUCTURE                                 │
│                                                                               │
│  ┌─────────────────────────────────────┐  ┌─────────────────────────────────┐│
│  │           KIMSUFI (CANADA)          │  │        HETZNER (GERMANY)        ││
│  │                                     │  │                                 ││
│  │  ┌─────────┐  ┌─────────────────┐   │  │   ┌─────────┐  ┌────────────┐  ││
│  │  │  Caddy  │  │   Docker Host   │   │  │   │  Caddy  │  │Docker Host │  ││
│  │  │ :80/443 │  │                 │   │  │   │ :80/443 │  │            │  ││
│  │  └────┬────┘  │  ┌───────────┐  │   │  │   └────┬────┘  │┌──────────┐│  ││
│  │       │       │  │   Plex    │  │   │  │        │       ││PostgreSQL││  ││
│  │       │       │  │  :32400   │  │   │  │        │       │└──────────┘│  ││
│  │       │       │  └───────────┘  │   │  │        │       │┌──────────┐│  ││
│  │       ├───────►  ┌───────────┐  │   │  │        ├───────►│  Redis   ││  ││
│  │       │       │  │  Radarr   │  │   │  │        │       │└──────────┘│  ││
│  │       │       │  │  :7878    │  │   │  │        │       │┌──────────┐│  ││
│  │       │       │  └───────────┘  │   │  │        │       ││   n8n    ││  ││
│  │       │       │  ┌───────────┐  │   │  │        │       │└──────────┘│  ││
│  │       │       │  │  Sonarr   │  │   │  │        │       │┌──────────┐│  ││
│  │       │       │  │  :8989    │  │   │  │        │       ││ imgproxy ││  ││
│  │       │       │  └───────────┘  │   │  │        │       │└──────────┘│  ││
│  │       │       │  ┌───────────┐  │   │  │        │       │┌──────────┐│  ││
│  │       │       │  │ Overseerr │  │   │  │        │       ││KaviCloud ││  ││
│  │       │       │  │  :5055    │  │   │  │        │       │└──────────┘│  ││
│  │       │       │  └───────────┘  │   │  │        │       │            │  ││
│  │       │       │  ┌───────────┐  │   │  │        │       └────────────┘  ││
│  │       │       │  │qBittorrent│  │   │  │                                 ││
│  │       │       │  │  (VPN)    │  │   │  └─────────────────────────────────┘│
│  │       │       │  └───────────┘  │   │                                     │
│  │       │       │                 │   │  ┌─────────────────────────────────┐│
│  │       │       └─────────────────┘   │  │        HETZNER STORAGE          ││
│  │       │                             │  │                                 ││
│  └───────┼─────────────────────────────┘  │  ┌─────────────┐ ┌───────────┐  ││
│          │                                │  │Object Store │ │Storage Box│  ││
│          │         TAILSCALE MESH         │  │    (S3)     │ │  (Backup) │  ││
│          │◄──────────────────────────────►│  │    "kua"    │ │   1TB     │  ││
│          │                                │  └─────────────┘ └───────────┘  ││
│                                           │                                  ││
│                                           └──────────────────────────────────┘│
└──────────────────────────────────────────────────────────────────────────────┘

Data Flow

Media Request Flow (Plex)

User Request → Plex.kua.cl → Cloudflare → Kimsufi:32400 → Plex → Media File

Media Download Flow

Overseerr Request → Radarr/Sonarr → Prowlarr → Indexer
                              qBittorrent (via Gluetun VPN)
                                    Media Downloaded
                                   Plex Library Scan

Image Upload Flow (KaviCloud)

Upload Request → media.kua.cl → Caddy → KaviCloud → S3 Bucket
                                              Image Stored in S3
Image Request → cdn.kua.cl → Caddy → imgproxy → S3 → Transformed Image

Backup Flow

Cron (3 AM) → backup-vps script → Dump databases
                                → Archive configs
                                → SFTP to Storage Box

Technology Stack

Kimsufi Server

Component Technology
OS Ubuntu 22.04 LTS
Container Docker + Docker Compose
Reverse Proxy Caddy
VPN Gluetun (NordVPN)
Media Server Plex
Movies Radarr
TV Shows Sonarr
Music Lidarr
Indexer Prowlarr
Requests Overseerr
Downloads qBittorrent, SABnzbd

Hetzner VPS

Component Technology
OS Ubuntu 24.04 LTS
Container Docker + Docker Compose
Reverse Proxy Caddy
Database PostgreSQL 16
Cache Redis 7
Automation n8n
Image Processing imgproxy
Image API KaviCloud (custom)
Management Portainer