Repository navigation
Deployment
darsrc edited this page Jun 16, 2026
·
7 revisions
LCARS-WebUI apps are FastAPI apps served by lcars.run(...). Local development is
simple; internet-facing deployment needs HTTPS, auth, CORS, payload limits, and WebSocket
proxying.
if __name__ == "__main__":
lcars.run(ui, host="127.0.0.1", port=8000, open_browser=True)python my_dashboard.py- Serve over HTTPS.
- Enable authentication.
- Restrict CORS origins.
- Preserve WebSocket upgrades through the reverse proxy.
- Set payload and rate limits.
- Run tests, lint, contracts, and security audit before release.
export LCARS_AUTH_REQUIRED=true
export LCARS_CORS_ORIGINS=https://your-dashboard.example.com
export LCARS_AUTH_TOKENS='{"your-token":["lcars.read","lcars.stream","lcars.write"]}'Use real secret management for production tokens. Do not commit tokens.
export LCARS_MAX_JSON_BODY_BYTES=1048576
export LCARS_MAX_WS_MESSAGE_BYTES=1048576
export LCARS_MAX_AUDIO_UPLOAD_BYTES=10485760
export LCARS_RATE_LIMIT_WINDOW_SECONDS=60
export LCARS_RATE_LIMIT_MAX_REQUESTS=120
export LCARS_SECURE_HEADERS_ENABLED=trueTune values to your deployment.
The proxy must support:
- WebSocket upgrades for
/lcars/ws. - Long-lived streaming responses for
/lcars/events. - Forwarding
Authorizationheaders. - Larger request bodies if using
mic_button.
Important routes:
| Route | Purpose |
|---|---|
/ |
Browser app shell. |
/assets/... |
Bundled frontend assets. |
/lcars/manifest |
Manifest JSON. |
/lcars/schema |
Manifest schema. |
/lcars/ws |
Primary WebSocket transport. |
/lcars/events |
SSE fallback stream. |
/lcars/action/{widget_id} |
HTTP action fallback. |
/lcars/input/{widget_id} |
HTTP input fallback. |
/lcars/form/{widget_id} |
HTTP form fallback. |
/lcars/upload/audio |
Microphone upload endpoint. |
lcars.mic_button(...) uses browser microphone APIs. Browsers require HTTPS for
microphone access except on localhost.
Users running dashboards do not need Node.js. The package includes frontend assets.
If you change the frontend renderer, rebuild assets from lcars-ui/:
make frontend-ci
make frontend-bundleFrom lcars-ui/:
pytest tests/
make lint
make contracts-check
make security-auditIf you changed frontend code, also run the project frontend and visual checks.
See Also: Getting Started · Reference · Troubleshooting