https://github.com/o1298098/appletv-remote
Self-hosted web remote for Apple TV using pyatv and FastAPI
https://github.com/o1298098/appletv-remote
apple-tv fastapi pyatv remote-control
Last synced: 4 days ago
JSON representation
Self-hosted web remote for Apple TV using pyatv and FastAPI
- Host: GitHub
- URL: https://github.com/o1298098/appletv-remote
- Owner: o1298098
- Created: 2026-04-04T07:54:49.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2026-06-05T14:54:21.000Z (19 days ago)
- Last Synced: 2026-06-05T16:25:55.183Z (19 days ago)
- Topics: apple-tv, fastapi, pyatv, remote-control
- Language: TypeScript
- Homepage:
- Size: 409 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Apple TV Remote · Web UI
Web client for controlling Apple TV on your LAN. In production the FastAPI backend serves the built SPA in the same process;

## Local development
1. Install frontend dependencies:
- `cd frontend`
- `npm ci` (or `npm install`)
2. Install backend dependencies in a Python virtual environment:
- `cd ../backend`
- `python -m venv .venv`
- Activate venv:
- PowerShell: `.venv\Scripts\Activate.ps1`
- bash/zsh: `source .venv/bin/activate`
- `pip install -r requirements.txt`
3. Start the API from `backend` (default port **8765**):
- `uvicorn main:app --host 0.0.0.0 --port 8765`
4. In another terminal, start the frontend dev server from `frontend`:
- `cd frontend`
- `npm run dev`
- Vite proxies `/api` to `http://127.0.0.1:8765` (see `frontend/vite.config.ts`).
## Production build
```bash
npm run build
```
Output goes to `dist/`. The root Docker image copies that folder into the container so `uvicorn` can serve both the SPA and `/api`.
## Deployment
From the **repository root**:
```bash
docker build -t apple-tv-remote .
docker run --rm -p 8765:8765 -v atv-data:/data apple-tv-remote
```
Or with Compose:
```bash
docker compose up --build
```
Open **http://localhost:8765** in your browser. Pairing data is persisted under the container volume `/data` (see `PYATV_STORAGE`).
> **Note:** If the container cannot discover Apple TVs on your LAN (common on Linux with bridge networking), switch to `network_mode: host` in `docker-compose.yml` as described in the comments there (use either host networking or `ports`, not both).