Restructure into backend/ and frontend/ subprojects
- backend/ uses proper Python src layout (src/media_library_viewer_api/) with pyproject.toml, hatchling build, and PYTHONPATH=src convention - frontend/ is a Vite + React + TypeScript SPA - archive/ preserves the original Streamlit prototype for reference - Cleaned up root to only contain docs, license, and subproject dirs - Updated README for the new dual-subproject architecture
This commit is contained in:
+41
-8
@@ -2,6 +2,38 @@
|
||||
|
||||
FastAPI backend serving the REST API for Jellyfin media browsing, SSH file inspection, and server monitoring.
|
||||
|
||||
## Project structure
|
||||
|
||||
```
|
||||
backend/
|
||||
├── pyproject.toml
|
||||
├── README.md
|
||||
├── src/
|
||||
│ └── media_library_viewer_api/
|
||||
│ ├── __init__.py
|
||||
│ ├── main.py # FastAPI app entrypoint
|
||||
│ ├── config.py # pydantic-settings config
|
||||
│ ├── dependencies.py # Dependency injection
|
||||
│ ├── path_utils.py # Jellyfin→SSH path resolution
|
||||
│ ├── jobs.py # Job templates
|
||||
│ ├── utils.py # Formatting helpers
|
||||
│ ├── routers/
|
||||
│ │ ├── dashboard.py
|
||||
│ │ ├── monitoring.py
|
||||
│ │ ├── media.py
|
||||
│ │ ├── files.py
|
||||
│ │ └── jobs.py
|
||||
│ ├── clients/
|
||||
│ │ ├── jellyfin.py
|
||||
│ │ ├── resources.py
|
||||
│ │ └── ssh.py
|
||||
│ ├── domain/
|
||||
│ │ └── media.py
|
||||
│ └── services/
|
||||
│ └── media_index.py
|
||||
└── tests/
|
||||
```
|
||||
|
||||
## Setup
|
||||
|
||||
```bash
|
||||
@@ -11,12 +43,6 @@ source .venv/bin/activate
|
||||
pip install -e '.[dev]'
|
||||
```
|
||||
|
||||
Or install dependencies directly:
|
||||
|
||||
```bash
|
||||
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):
|
||||
@@ -40,7 +66,13 @@ REMOTE_PATH_PREFIX=
|
||||
|
||||
```bash
|
||||
cd backend
|
||||
uvicorn main:app --reload --port 8000
|
||||
uvicorn media_library_viewer_api.main:app --reload --port 8000
|
||||
```
|
||||
|
||||
Or with PYTHONPATH if not installed:
|
||||
|
||||
```bash
|
||||
PYTHONPATH=src uvicorn media_library_viewer_api.main:app --reload --port 8000
|
||||
```
|
||||
|
||||
API docs available at: http://localhost:8000/docs
|
||||
@@ -51,9 +83,10 @@ API docs available at: http://localhost:8000/docs
|
||||
- `GET /api/dashboard/libraries` — Per-library breakdown
|
||||
- `GET /api/dashboard/now-playing` — Active playback sessions
|
||||
- `GET /api/monitoring/status` — Collector status
|
||||
- `GET /api/monitoring/metrics` — Resource samples
|
||||
- `GET /api/monitoring/metrics` — Resource samples (last hour)
|
||||
- `GET /api/monitoring/disk` — Disk space
|
||||
- `POST /api/monitoring/start|stop|restart` — Collector controls
|
||||
- `GET /api/monitoring/diagnostics` — Collector debug info
|
||||
- `GET /api/media/status` — Index status
|
||||
- `POST /api/media/build` — Rebuild index
|
||||
- `GET /api/media/query` — Query with filters/sort/pagination
|
||||
|
||||
Reference in New Issue
Block a user