Web client for controlling Apple TV on your LAN. In production the FastAPI backend serves the built SPA in the same process;
- Install frontend dependencies:
cd frontendnpm ci(ornpm install)
- Install backend dependencies in a Python virtual environment:
cd ../backendpython -m venv .venv- Activate venv:
- PowerShell:
.venv\Scripts\Activate.ps1 - bash/zsh:
source .venv/bin/activate
- PowerShell:
pip install -r requirements.txt
- Start the API from
backend(default port 8765):uvicorn main:app --host 0.0.0.0 --port 8765
- In another terminal, start the frontend dev server from
frontend:cd frontendnpm run dev- Vite proxies
/apitohttp://127.0.0.1:8765(seefrontend/vite.config.ts).
npm run buildOutput goes to dist/. The root Docker image copies that folder into the container so uvicorn can serve both the SPA and /api.
From the repository root:
docker build -t apple-tv-remote .
docker run --rm -p 8765:8765 -v atv-data:/data apple-tv-remoteOr with Compose:
docker compose up --buildOpen 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: hostindocker-compose.ymlas described in the comments there (use either host networking orports, not both).
