This project provides a web-based user interface for the Bruce firmware (tested with version 1.10.1). It is designed to serve static web content and simulate backend API responses as provided by the Bruce firmware.
For a detailed overview of the project file structure and backend API endpoints, see STRUCTURE_AND_ENDPOINTS.md.
server.js: Node.js server to serve static files and backend API endpoints.interface/: Main web UI files (HTML, CSS, JS).sample/: Example web UI files and assets.backend/: Simulated API endpoints and sample responses, matching Bruce firmware v1.10.1.
- Serves static files from the
interfacefolder by default (or another folder if specified as a command-line argument). - Prevents serving directly from the
backendfolder for security. - Handles requests for files and API endpoints, searching in the following order:
- Main UI folder (default:
interface/) backend/(for API endpoint simulation)- Project root
- Main UI folder (default:
- Returns appropriate MIME types for common file extensions.
- Logs each request to the console.
- Listens on port 8080 by default.
- If you make a request to a path starting with
/bruce/, the server will forward (proxy) the request to a real Bruce device on your network (see below).
The backend/ folder contains files that simulate the responses of Bruce firmware endpoints, such as:
systeminfo: Returns firmware version and storage infolistfiles: Lists files and folders as reported by the firmwarefile,edit,cm, etc.: Simulate file operations and command execution endpoints
These samples are based on Bruce firmware v1.10.1 and are useful for UI development and testing without requiring the actual hardware.
If you send a request to a path starting with /bruce/, the server will emulate a real Bruce device by forwarding your request to the actual device on your network (by default, to http://bruce.local).
IMPORTANT!
- You MUST edit the file
server.jsand set the correct username and password for your Bruce device. Look for these lines near the top of the file:const bruceUsername = "admin"; // CHANGE THIS to your Bruce device username const brucePassword = "bruce"; // CHANGE THIS to your Bruce device password
- If you do not set the correct username and password, you will NOT be able to connect to your real Bruce device. The web UI will NOT work with the real device until you do this!
- Make sure your computer and the Bruce device are connected to the same WiFi network, or connect to the Bruce device's AP (Access Point) mode.
- This allows you to interact with a real Bruce device from the web UI, using the same API as the firmware.
- Install Node.js (if not already installed).
- Edit
server.jsand set your Bruce device username and password as described above. - Run the server:
Optionally, specify a different folder to serve:
node server.js
node server.js sample
- Open your browser and go to http://127.0.0.1:8080/
- This project is for development and testing purposes.
- The backend responses are static samples and do not perform real hardware actions unless you use the
/bruce/path to proxy to a real device. - For more information about Bruce firmware, see the official documentation.
- This README generated by AI