image_Erste-Schritte

Erste Schritte

Von null auf eine laufende Plattform in fünf Minuten. Aipokit liefert als einzelne Binary mit Docker-Compose-Unterstützung.

Quick Start

# Clone the repository
git clone https://github.com/jueewo/aipokit.git
cd appkask

# Start everything
docker compose up -d

# Open in browser
open http://localhost:3000

The first run will:

  • Create the SQLite database (media.db)
  • Apply all migrations automatically
  • Create the storage directory structure
  • Start the web server on port 3000

Option 2: Build from Source

# Prerequisites: Rust toolchain, FFmpeg, Ghostscript, cwebp
cargo build --release

# Configure
cp .env.example .env
# Edit .env with your settings

# Run
./target/release/video-server

First Steps After Login

  1. Enable emergency login (development): Set ENABLE_EMERGENCY_LOGIN=true in .env
  2. Create a workspace: Click “New Workspace” and give it a name
  3. Create a folder: Navigate into your workspace, create a folder
  4. Assign a type: Click the folder settings icon, choose “media-server”
  5. Upload media: The folder now shows an upload interface — drag and drop your files
  6. Share: Click “Share” to generate an access code — send the link to anyone

Environment Variables

# Required
DATABASE_URL=sqlite:media.db
STORAGE_DIR=./storage

# Authentication (OIDC)
OIDC_ISSUER=https://auth.example.com
OIDC_CLIENT_ID=your_client_id
OIDC_CLIENT_SECRET=your_secret
OIDC_REDIRECT_URI=http://localhost:3000/auth/callback

# Development
ENABLE_EMERGENCY_LOGIN=true

# Production
RUN_MODE=production

Architecture

The Stack

LayerTechnology
LanguageRust (stable)
Web FrameworkAxum 0.8
TemplatesAskama 0.13 (SSR, type-safe)
DatabaseSQLite via sqlx (compile-time checked)
Sessionstower-sessions 0.14 + SQLite store
AuthOIDC (Casdoor recommended)
CSSTailwindCSS v4 + DaisyUI
VideoFFmpeg (HLS) + MediaMTX (RTMP)
ObservabilityOpenTelemetry 0.31 + OTLP/gRPC

Workspace Crate Architecture

Aipokit is a Cargo workspace with 34 crates organized by domain:

crates/
  common/              # Shared types, storage, database
  media-core/          # Media detection, EXIF extraction
  media-manager/       # Upload, serve, search, CRUD
  video-manager/       # HLS transcoding (8-stage pipeline)
  access-control/      # 4-layer permission model
  access-codes/        # Shareable access links
  access-groups/       # Team roles and invitations
  user-auth/           # OIDC + session management
  workspace-manager/   # Workspace browser and folder types
  vault-manager/       # Storage vault isolation
  site-generator/      # Astro site generation
  course/              # Course viewer + presentations
  ...and 22 more

The Dual-Use Pattern

Every app crate implements the FolderTypeRenderer trait for embedded mode (inside workspace browser) and exports a Router for standalone mode (own URL). Same logic, same templates, two deployment modes.

Storage Layout

storage/
  workspaces/{workspace_id}/     # File browser content
    folder-a/                    # Regular folder
    media-gallery/               # Typed folder (media-server)
  vaults/{vault_id}/             # Media pipeline storage
    media/
      images/{slug}.webp
      videos/{slug}/index.m3u8
      documents/{filename}
    thumbnails/
      images/{slug}_thumb.webp
      videos/{slug}_thumb.webp

Rate Limiting

Three tiers based on resource intensity:

TierLimitEndpoints
Default60 RPMMost API endpoints
Upload15 RPMFile upload, transcoding
Serving300 RPMMedia delivery, thumbnails
Das neueste Docker-Image pullen und neu starten. Datenbankmigrationen werden beim Start automatisch angewendet. Ihre Daten und der Storage bleiben über Docker-Volumes erhalten.
Zwei Dinge kopieren: die media.db SQLite-Datei und das storage/-Verzeichnis. Das ist Ihr gesamter Plattformzustand. Keine externen Dienste zu koordinieren.
Ja. Aipokit läuft hinter nginx, Caddy oder Traefik. RUN_MODE=production setzen, um HTTPS-Sicherheitsprüfungen zu erzwingen. WebSocket-Endpunkte benötigen aktivierten WebSocket-Support im Proxy.
Die Umgebungsvariablen OIDC_ISSUER, OIDC_CLIENT_ID, OIDC_CLIENT_SECRET und OIDC_REDIRECT_URI konfigurieren. Aipokit unterstützt jeden OIDC-Provider — Casdoor wird für selbst gehostete Setups empfohlen.
Im PATH benötigt: ffmpeg und ffprobe (Video), gs / Ghostscript (PDF-Vorschaubilder), cwebp (WebP-Konvertierung). Optional: mediamtx (RTMP-Livestreaming).
Ja. Domain auf Ihren Server zeigen lassen, TLS im Reverse-Proxy terminieren, RUN_MODE=production setzen — fertig.