From 356aa13063850e985f935c98b3ae46930020bbfa Mon Sep 17 00:00:00 2001 From: emergent-agent-e1 Date: Wed, 29 Apr 2026 14:49:07 +0000 Subject: [PATCH] auto-commit for df4b0748-985b-4592-8c48-1e56102f3613 --- README.md | 113 +++- backend/auth.py | 72 +++ backend/models.py | 129 +++++ backend/seed.py | 148 ++++++ backend/server.py | 528 ++++++++++++++++--- backend/tests/backend_test.py | 295 +++++++++++ frontend/src/App.css | 36 +- frontend/src/App.js | 91 ++-- frontend/src/components/GrainOverlay.jsx | 2 + frontend/src/components/Hero.jsx | 78 +++ frontend/src/components/MovieCard.jsx | 42 ++ frontend/src/components/MovieDetailModal.jsx | 136 +++++ frontend/src/components/Navbar.jsx | 102 ++++ frontend/src/components/ProtectedRoute.jsx | 18 + frontend/src/components/Row.jsx | 54 ++ frontend/src/index.css | 196 ++++--- frontend/src/lib/api.js | 33 ++ frontend/src/lib/auth.jsx | 56 ++ frontend/src/pages/Admin.jsx | 83 +++ frontend/src/pages/AdminUpload.jsx | 127 +++++ frontend/src/pages/Browse.jsx | 83 +++ frontend/src/pages/Login.jsx | 102 ++++ frontend/src/pages/MyList.jsx | 42 ++ frontend/src/pages/Player.jsx | 80 +++ frontend/src/pages/Register.jsx | 103 ++++ frontend/src/pages/Requests.jsx | 151 ++++++ frontend/src/pages/Search.jsx | 67 +++ memory/PRD.md | 50 ++ test_reports/iteration_1.json | 35 ++ test_reports/pytest/pytest_results.xml | 1 + 30 files changed, 2809 insertions(+), 244 deletions(-) create mode 100644 backend/auth.py create mode 100644 backend/models.py create mode 100644 backend/seed.py create mode 100644 backend/tests/backend_test.py create mode 100644 frontend/src/components/GrainOverlay.jsx create mode 100644 frontend/src/components/Hero.jsx create mode 100644 frontend/src/components/MovieCard.jsx create mode 100644 frontend/src/components/MovieDetailModal.jsx create mode 100644 frontend/src/components/Navbar.jsx create mode 100644 frontend/src/components/ProtectedRoute.jsx create mode 100644 frontend/src/components/Row.jsx create mode 100644 frontend/src/lib/api.js create mode 100644 frontend/src/lib/auth.jsx create mode 100644 frontend/src/pages/Admin.jsx create mode 100644 frontend/src/pages/AdminUpload.jsx create mode 100644 frontend/src/pages/Browse.jsx create mode 100644 frontend/src/pages/Login.jsx create mode 100644 frontend/src/pages/MyList.jsx create mode 100644 frontend/src/pages/Player.jsx create mode 100644 frontend/src/pages/Register.jsx create mode 100644 frontend/src/pages/Requests.jsx create mode 100644 frontend/src/pages/Search.jsx create mode 100644 memory/PRD.md create mode 100644 test_reports/iteration_1.json create mode 100644 test_reports/pytest/pytest_results.xml diff --git a/README.md b/README.md index 3786c8a..a1573e5 100644 --- a/README.md +++ b/README.md @@ -1 +1,112 @@ -# Here are your Instructions +# Kino — Personal Media Server (Netflix Clone) + +A self-hosted Netflix-style streaming app for movies you legally own. +Built with FastAPI + React + MongoDB. + +## Features + +- Cinematic browse UI with hero banner, horizontal carousels, hover details +- HTML5 video player with **HTTP Range request** support (proper seeking) +- **JWT auth** (admin + member roles) +- **Admin upload** for adding movies (multipart, large files OK) +- **My List** (watchlist) and **Continue Watching** (resume playback) +- **Search** by title/director/cast +- **Request queue** — users request movies, admin approves & uploads them + *(Legal alternative to auto-downloading — auto-download of copyrighted material is not implemented.)* + +## Default admin +- Email: `admin@kino.local` +- Password: `kino-admin-2026` + +Change `ADMIN_EMAIL` / `ADMIN_PASSWORD` in `backend/.env` before first start +to set your own admin credentials. + +## Self-hosting on Proxmox + +You can run this stack on any Proxmox LXC or VM. Recommended layout: + +1. **Create an Ubuntu 22.04 LXC** with at least: + - 2 CPU cores, 4 GB RAM + - 20 GB system disk + - Mount your bulk storage (zfs/nfs) at `/mnt/media` +2. **Install dependencies**: + ```bash + apt update && apt install -y python3-pip nodejs npm yarn mongodb git + ``` +3. **Clone & configure**: + ```bash + git clone /opt/kino + cd /opt/kino + ``` +4. **Backend**: + ```bash + cd backend + pip install -r requirements.txt + # edit .env: + # MONGO_URL=mongodb://localhost:27017 + # DB_NAME=kino + # MEDIA_ROOT=/mnt/media + # ADMIN_EMAIL=you@yourdomain + # ADMIN_PASSWORD= + # JWT_SECRET= + uvicorn server:app --host 0.0.0.0 --port 8001 + ``` +5. **Frontend**: + ```bash + cd frontend + yarn install + # edit .env: + # REACT_APP_BACKEND_URL=https://kino.yourdomain.tld + yarn build + # serve build/ via nginx or caddy + ``` +6. **Recommended**: front with **Caddy** for HTTPS: + ``` + kino.yourdomain.tld { + handle /api/* { + reverse_proxy localhost:8001 + } + handle { + root * /opt/kino/frontend/build + try_files {path} /index.html + file_server + } + } + ``` + +## GitHub backup + +This repo is the source of truth for code and configuration. +**Do not commit your `.env` files** — they contain secrets. +Movie media files should live on your Proxmox storage, not Git. + +## Adding movies + +- **Via web UI**: Sign in as admin → "Upload" in nav → drag MP4 + fill metadata +- **Manually**: drop MP4 into `$MEDIA_ROOT/videos/`, then create the movie via + `POST /api/movies` with `storage_type=local` and `storage_path=` + +## API quickstart + +```bash +# Login +curl -X POST $URL/api/auth/login \ + -H 'Content-Type: application/json' \ + -d '{"email":"admin@kino.local","password":"kino-admin-2026"}' + +# List movies +curl $URL/api/movies + +# Stream a local movie (note: needs ?auth= for