How milesprovus/monocle-teleprompter works
Project type and purpose
• This is a hybrid full-stack teleprompter application targeting the “Monocle” AR device by Brilliant Labs.
• It comprises three logical layers:
• A Node.js/Express backend that handles OAuth2 and Google Slides API calls
• A browser-based frontend (HTML/JS/CSS) that authenticates the user, displays controls, and pipes notes to the Monocle
• A Python script (main.py) that can run standalone on the Monocle device to fetch and render speaker notes
File structure
Top-level files:
• server.js: Express server entrypoint
• credentials.json: OAuth client secrets for server-side Google API calls
• package.json / package-lock.json: Node dependencies
• main.py: Python runtime for on-device operation
• .brilliant/*: configuration manifest for device deployment
public/ (browser UI assets):
• index.html + public/src/*.js: handles authentication, UI, “Brilliant.connect()” device linkage
• style.css: styling
img/: screenshots (for README)
README.md: setup instructions, app description
README for additional insights
• Uses Google Slides API to pull speaker notes
• OAuth2 flow: browser obtains client ID + API key, then authorizes Slides scope
• Web client runs on localhost:3000; Monocle touchpads send navigation events back to the UI
• An alternate deployment path is to upload main.py to the Monocle directly
Main components & interactions
a. External service:
– Google Slides API (via HTTPS REST, OAuth2)
b. Backend:
– Node.js/Express server (server.js + credentials.json)
– Exposes endpoints for the frontend to fetch slide notes JSON
c. Frontend (browser):
– UI layer (public/index.html, script.js) for login, slide preview, nav controls
– auth.js + connect.js handle OAuth2 token injection and device connection (WebUSB / Brilliant JS SDK)
d. Monocle device:
– Runs either:
1) The browser UI pushes notes over WebUSB / socket to the device
2) main.py runs directly on‐device (Python) and polls the Google Slides API itself
– Touchpad events on the Monocle trigger next/prev slide requests back into the system
Architectural patterns & design principles
• Client-Server (REST API + OAuth2)
• Single-Page Application for control plane (HTML/JS)
• IoT integration via WebUSB / Python runtime on device
• Separation of concerns:
• Authentication & data retrieval (backend)
• Presentation & device communication (frontend)
• On-device rendering (Python or JS SDK)