SocketUI is a remote-control system that allows users to control TellUs applications from their smartphone over a local network.
- Backend - Python WebSocket server + HTTP server for frontend
- Frontend - Vite + React control panel. The UI configuration protocol is specified here
- build.bat - Build script that bundles the frontend and backend into an exe
Follow these steps to integrate SocketUI into your TellUs application:
-
Build SocketUI (see how to build)
-
Run SocketUI.exe and open http://localhost:7000/ in your browser
-
Connect your application by creating a WebSocket connection to ws://localhost:7000/ws
-
Listen for
{ "type": "request" }. This request message is sent by SocketUI whenever it loads or reconnects, requesting a config. -
Send
{ "type": "config", "title": "My config", "elements": [{ "type": "button", "id": "my_button", "text": "Click me" }] }. This config message specifies the UI elements you want to display. -
Listen for
{ "type": "button", "id": "my_button" }to handle user interactions. This button event message indicates that the button was pressed.
For a complete reference of all supported UI elements, see the UI configuration protocol.
Connecting
-
Start app: The TellUs application connects a WebSocket to ws://localhost:7000/ws, which connects it to the SocketUI backend.
-
Open website: A mobile device, connected to the TellUs wifi, opens http://localhost:7000 in a web browser. The frontend connects to the backend the same way, then sends a request message to the backend, which passes it along to the TellUs application.
-
Prepare config: The TellUs application sends a config message, describing the UI elements it needs (buttons, sliders, dropdowns, switches, etc.)
-
Render HTML: The frontend receives the config and updates the webpage to display the specified UI elements.
Interacting
-
Click button: When the user clicks a button that was specified in the config, the frontend sends a button event message that includes the button id.
-
Drag slider: When the user drags a slider, the frontend sends a slider event message that includes the slider id and the slider value.
-
Action: The TellUs application receives the event and can perform a specific action based on the button or slider id.
- Python with
fastapianduvicornpackages installed - Node.js and npm
Run the build.bat script in a terminal from the root directory.
This script:
- Builds the React frontend
- Moves the compiled frontend into the backend directory
- Packages everything with PyInstaller to create
backend/dist/SocketUI.exe - Creates
SocketUI/andSocketUI.zipfor distribution
- Build SocketUI using
build.bat - Move
SocketUI.exeto a permanent location - Add to Windows Startup to run SocketUI automatically:
- Press
Win + Rand typeshell:startup - Create a shortcut to
SocketUI.exein the startup folder - Run
SocketUI.exe
- Press
- SocketUI is now running is the system tray applications
- Right-click and select "Open" to visit localhost:7000
- Right-click and select "Quit" to close SocketUI


