3c432473e5
Backend: - FastAPI app with 17 REST endpoints covering dashboard, monitoring, media index, file browser, and jobs - Reuses existing clients/domain/services unchanged - pydantic-settings config, dependency injection, CORS setup - Auto-generated OpenAPI docs at /docs Frontend: - Vite + React + TypeScript SPA - @tanstack/react-query for data fetching with polling - ag-grid-react for media table and file browser - recharts for monitoring charts - Tailwind CSS styling - 4 pages: Dashboard, Monitoring, Media, File Browser - Typed API client matching all backend endpoints Also: - docs/MIGRATION_PLAN.md with full architecture plan - Updated .gitignore for both subprojects - Streamlit app preserved for now (can coexist)
Backend - Media Library Viewer API
FastAPI backend serving the REST API for Jellyfin media browsing, SSH file inspection, and server monitoring.
Setup
cd backend
python -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'
Or install dependencies directly:
pip install fastapi uvicorn[standard] pydantic-settings paramiko requests python-dotenv pandas
Configuration
Create a .env file in the project root (or set environment variables):
JELLYFIN_URL=https://jellyfin.example.com
JELLYFIN_API_KEY=your-api-key
JELLYFIN_USER_ID=
SSH_HOST=media-server.example.com
SSH_USERNAME=username
SSH_PORT=22
SSH_KEY_FILENAME=/home/username/.ssh/id_rsa
SSH_PASSWORD=
REMOTE_MEDIA_ROOT=/srv/media
REMOTE_PATH_PREFIX=
Running
cd backend
uvicorn main:app --reload --port 8000
API docs available at: http://localhost:8000/docs
API Endpoints
GET /api/dashboard/counts— Movie/series/episode totalsGET /api/dashboard/libraries— Per-library breakdownGET /api/dashboard/now-playing— Active playback sessionsGET /api/monitoring/status— Collector statusGET /api/monitoring/metrics— Resource samplesGET /api/monitoring/disk— Disk spacePOST /api/monitoring/start|stop|restart— Collector controlsGET /api/media/status— Index statusPOST /api/media/build— Rebuild indexGET /api/media/query— Query with filters/sort/paginationGET /api/files/list?path=— Directory listingGET /api/files/ffprobe?path=— ffprobe JSONGET /api/files/stat?path=— stat outputGET /api/files/resolve-path?path=— Path resolutionGET /api/jobs/templates— Available jobsPOST /api/jobs/run— Execute a job