Scala.js Loop
Follow the Scala.js Playbook for hot reload, bundling tips, and backend wiring while you iterate on this demo.
Interactive Demo
Experience Graviton's capabilities through this interactive Scala.js application!
Build Checklist
- Run
./sbt buildFrontendfrom the repo root to refreshdocs/public/js/main.js. - Rebuild the docs (
npm run docs:devornpm run docs:build). - Reload this page—navigation should stay in-app (no full page flashes) and browser devtools should show the
main.jschunk loading from/js/or your configured base path.
Implementation Note
The chunking algorithms demonstrated here use the same FastCDC implementation as the server-side code in graviton-streams. Upload multiple files to see real content-defined chunking and block-level deduplication in action!
Note
By default the demo looks for a Graviton instance at http://localhost:8081. Update the <meta name="graviton-api-url" /> tag if your server runs elsewhere (or if you changed GRAVITON_HTTP_PORT).
Demo Mode
When this page cannot reach a live server (such as on GitHub Pages), the UI automatically switches to a simulated dataset. You can still explore chunking, manifests, and stats without any backend.
Features
The embedded UI is intended to demonstrate the pieces that exist in this repo today:
- Blob upload + download over HTTP (
POST /api/blobs,GET /api/blobs/:id) - Chunking + manifests (visualization + manifest inspection)
- Datalake dashboard snapshot + stream models
- Schema explorer for the shared API models
Try it yourself
Start a Graviton server:
bash./sbt "server/run"Upload a blob:
bashcurl -X POST --data-binary @/path/to/file http://localhost:8081/api/blobsExplore the blob using the interactive UI above (or fetch it back from
GET /api/blobs/:id).
Architecture
This frontend is built with:
- Scala.js: Type-safe JavaScript from Scala
- Laminar: Reactive UI with FRP (Functional Reactive Programming)
- ZIO: Effect system for async operations
- Shared Models: Cross-compiled protocol models between JVM and JS