Gabriel Kaszewski 33b440d297 fix(presentation): extract 12 handler violations to use cases
- TokenService port + JwtTokenService adapter; login/refresh return LoginResult
- delete get_token (dup of login); create_tokens helper removed
- type UpdateChannelRequest schedule_config/recycle_policy (no serde_json::Value)
- update_settings returns updated Vec; handler calls one use case
- config use case in application::config; handler maps DTO only
- SyncStatusEntry moved to api-types w/ From<LibrarySyncLogEntry>
- trigger_sync: Conflict error, drop sync_trigger.send from handler
- UpsertProviderCommand.config accepts Value; serialization in use case
- get_current_broadcast returns BroadcastWithChannel; one call
- get_stream_url resolves broadcast internally; handler single call
2026-07-12 05:28:49 +02:00
2026-07-12 03:41:51 +02:00

k-tv

Self-hosted linear TV channel orchestration. Turns a personal media library into broadcast-style channels.

Stack

  • Backend — Rust (Axum), SQLite/PostgreSQL, Jellyfin
  • Frontend — Next.js 16, React 19, TanStack Query, Tailwind v4, shadcn/ui

Docker

Registry: registry.gabrielkaszewski.dev

Build

NEXT_PUBLIC_API_URL is baked into the frontend bundle at build time — always pass it explicitly.

# Backend
docker build -t registry.gabrielkaszewski.dev/k-tv-backend:latest ./k-tv-backend

# Frontend — NEXT_PUBLIC_API_URL required
docker build \
  --build-arg NEXT_PUBLIC_API_URL=https://tv-api.gabrielkaszewski.dev/api/v1 \
  -t registry.gabrielkaszewski.dev/k-tv-frontend:latest \
  ./k-tv-frontend

Push

docker push registry.gabrielkaszewski.dev/k-tv-backend:latest
docker push registry.gabrielkaszewski.dev/k-tv-frontend:latest

Build + push (one-liner)

docker build -t registry.gabrielkaszewski.dev/k-tv-backend:latest ./k-tv-backend && \
docker push registry.gabrielkaszewski.dev/k-tv-backend:latest && \
docker build \
  --build-arg NEXT_PUBLIC_API_URL=https://tv-api.gabrielkaszewski.dev/api/v1 \
  -t registry.gabrielkaszewski.dev/k-tv-frontend:latest \
  ./k-tv-frontend && \
docker push registry.gabrielkaszewski.dev/k-tv-frontend:latest

Deploy (on server)

docker compose -f compose.yml -f compose.traefik.yml pull
docker compose -f compose.yml -f compose.traefik.yml up -d

Ports

Service Port
Backend 3000
Frontend 3001

Env vars

Var Where Note
NEXT_PUBLIC_API_URL frontend build arg Baked in at build time — must point to the public backend URL
API_URL frontend runtime env Server-side only (Next.js API routes). Set in compose.
DATABASE_URL backend sqlite:///app/data/k-tv.db or postgres DSN
JWT_SECRET backend JWT signing key — change in production (min 32 chars)
COOKIE_SECRET backend OIDC state cookie encryption key — change in production (min 64 chars)
Description
Self hosted TV broadcast that uses existing media libary
Readme 3 MiB
Languages
Rust 65%
TypeScript 34.5%
CSS 0.3%
Dockerfile 0.1%