Sandstone ships an example frontend in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ading2210/sandstone/llms.txt
Use this file to discover all available pages before exploring further.
example/ subdirectory. It is a complete browser-like UI built on top of the Sandstone library — complete with a URL bar, favicon fetching, a configurable Wisp endpoint, and an in-page JavaScript eval tool. Running the example is the fastest way to verify that your build works end-to-end and to experiment with Sandstone before integrating it into your own project.
Prerequisites
Complete the Build Sandstone from source guide before following these steps. The example frontend imports directly from../dist/sandstone.mjs, so the main library must be compiled first.
Steps
Build the main library
If you have not already done so, build the main Sandstone bundles from the repository root:See Build Sandstone from source for the full instructions.
Install example dependencies
The example has its own
package.json with dependencies for the Express server and Wisp:Build the example frontend
Compile the example’s webpack bundle. The production build also runs
inline.mjs to produce a self-contained HTML file:Start the server
Launch the Express web server:By default the server listens on port
5001. You can override this with the PORT environment variable:What the example provides
The example app exposes the following UI elements, each backed by real logic inexample/main.mjs:
- URL bar — accepts full URLs; prepends
https://automatically when no scheme is provided - Favicon display — fetches the proxied page’s favicon through
sandstone.libcurl.fetchand displays it next to the URL bar - Options panel — lets you change the Wisp WebSocket endpoint at runtime without reloading the page
- JS eval tool — lets you run arbitrary JavaScript inside the proxied frame via
main_frame.eval_js() - Version indicator — shows the compiled Sandstone version and short git hash
Running both watchers at once
From the repository root, you can start watch mode for both the main library and the example frontend simultaneously using thedev:all script:
concurrently to run npm run dev in the root and npm run dev inside example/ at the same time. Any source change in either location triggers an automatic rebuild.
Wisp proxying
The Express server inexample/server.mjs handles WebSocket upgrade events and routes them to the bundled Wisp server: