Files
k-tv/k-tv-frontend
Gabriel Kaszewski 311fdd4006 feat: multi-instance provider support
- provider_configs: add id TEXT PK; migrate existing rows (provider_type becomes id)
- local_files_index: add provider_id column + index; scope all queries per instance
- ProviderConfigRow: add id field; add get_by_id to trait
- LocalIndex:🆕 add provider_id param; all SQL scoped by provider_id
- factory: thread provider_id through build_local_files_bundle
- AppState.local_index: Option<Arc<LocalIndex>> → HashMap<String, Arc<LocalIndex>>
- admin_providers: restructured routes (POST /admin/providers create, PUT/DELETE /{id}, POST /test)
- admin_providers: use row.id as registry key for jellyfin and local_files
- files.rescan: optional ?provider=<id> query param
- frontend: add id to ProviderConfig, update api/hooks, new multi-instance panel UX
2026-03-19 22:54:41 +01:00
..
2026-03-19 22:54:41 +01:00
2026-03-19 22:54:41 +01:00
2026-03-15 23:51:41 +00:00
2026-03-15 23:51:41 +00:00

K-TV Frontend

Next.js 16 / React 19 EPG viewer and channel manager for k-tv — the self-hosted linear TV orchestration backend.

Quick Start

cp .env.local.example .env.local
# Edit .env.local — set NEXT_PUBLIC_API_URL to your backend URL
pnpm dev

Open http://localhost:3001 in your browser.

Environment Variables

Variable Where Description
NEXT_PUBLIC_API_URL build arg + runtime Browser-side API base URL. Baked in at build time — must point to the public backend URL. Default: http://localhost:4000/api/v1
API_URL runtime only Server-side API URL for Next.js API routes (e.g. stream redirect resolver). Falls back to NEXT_PUBLIC_API_URL if not set. Use this to set a private backend address in Docker.

Routes

Path Auth Description
/tv public TV player — EPG grid, channel switching, HLS/direct video stream
/dashboard required Channel management — create, edit, configure schedule blocks
/admin required Live server log stream + recent activity log
/login Email/password login
/register New account registration

Architecture

  • lib/api.ts — typed fetch client wrapping all backend endpoints (api.auth.*, api.channels.*, api.schedule.*, api.library.*)
  • hooks/ — TanStack Query v5 hooks for all data fetching and mutations; components never fetch directly
  • context/auth-context.tsx — JWT stored in localStorage, isLoaded flag prevents flash redirects
  • Components are props-only; all business logic lives in hooks

Docker

See the root README for build and deploy instructions.