# Festival 4D backend — systemd unit (uvicorn on 127.0.0.1:8000, localhost-only) # # Install: sudo cp deploy/festifun-api.service /etc/systemd/system/ # sudo systemctl daemon-reload && sudo systemctl enable --now festifun-api # Logs: journalctl -u festifun-api -f # # The service binds 127.0.0.1 only — nginx is the sole public entry point. Adjust User, # paths, and the venv location to match the server. [Unit] Description=Festival 4D API (uvicorn) After=network.target [Service] Type=simple User=dealgod WorkingDirectory=/var/www/festifun/backend # The app reads FESTIVAL4D_DATA_DIR for the project (db + media + point cloud). Environment=FESTIVAL4D_DATA_DIR=/var/www/festifun/data # NOTE: no GEMINI_API_KEY / OPENROUTER creds here on purpose — see DEPLOY.md "AI classification". # Moment labels are baked into the shipped DB by running `events` locally before deploy, so the # public box needs no keys and POST /api/events/detect degrades to candidates-only (no spend). ExecStart=/var/www/festifun/.venv/bin/python -m uvicorn festival4d.api:app --host 127.0.0.1 --port 8000 Restart=on-failure RestartSec=3 [Install] WantedBy=multi-user.target