From 791741fde0f2c9c8904554418e10b9b878f39801 Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Sat, 14 Mar 2026 02:43:10 +0100 Subject: [PATCH] feat(docs): add README with project overview, Docker instructions, and environment variables --- README.md | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..8b032c0 --- /dev/null +++ b/README.md @@ -0,0 +1,73 @@ +# 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. + +```bash +# 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 + +```bash +docker push registry.gabrielkaszewski.dev/k-tv-backend:latest +docker push registry.gabrielkaszewski.dev/k-tv-frontend:latest +``` + +### Build + push (one-liner) + +```bash +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) + +```bash +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 | +| `SESSION_SECRET` | backend | Change in production |