ADR 08: Hosting and Frontend Stack
Status: Accepted Date: 2026-04-09
Context
We need to define the infrastructure and frontend framework for Substratum v1.0.
The architecture requires:
- P2P Backbone: Cloud nodes (the Global Triangle) that can maintain persistent, long-lived TCP/QUIC connections for
libp2pand handle significant bandwidth without unpredictable egress costs. - SaaS UI: A web dashboard that is lightweight, performant, and avoids heavy JavaScript bloat.
- Blockstore: A highly redundant storage backend for IPFS blocks uploaded to the Gateway.
- Database: (See ADR 09: Database and ORM Selection).
Decision
We have selected the following stack for hosting and the frontend:
- Host (Global Triangle): DigitalOcean
- We will use DigitalOcean Droplets to host the Rust
libp2pdaemons. They provide a predictable pricing model, generous bandwidth allowances, and excellent global data center coverage for our US, EU, and Asia-Pacific nodes.
- We will use DigitalOcean Droplets to host the Rust
- Frontend Framework: Mithril.js + Mithril Materialize
- The SaaS dashboard will be built using Mithril.js with JSX enabled, styled with Mithril Materialize. It strikes the perfect balance between light and strong. While it has fewer out-of-the-box components compared to React or Vue, it is battle-tested, highly performant, and prevents the UI from becoming overwhelmed with JS bloat.
- Storage (Blockstore): S3-Compatible Object Storage
- It is imperative that we have redundancy for the data stored on the cloud nodes. We will use an S3-compatible storage backend (such as DigitalOcean Spaces) rather than relying solely on local attached NVMe volumes.
- Database (Metadata & Billing): DigitalOcean Managed PostgreSQL
- See ADR 09: Database and ORM Selection (SeaORM) for details on using SeaORM and Native PostgreSQL RLS.
Consequences
- Positive:
- Predictable Scaling: DigitalOcean provides a stable, known environment for scaling the P2P nodes.
- Performance: Mithril.js ensures the SaaS dashboard remains incredibly fast and lightweight, aligning with the project's ethos of efficiency.
- Reliability: S3-compatible storage guarantees high availability and redundancy for user data before it syncs to their local Sidecars.
- Negative:
- UI Ecosystem: Mithril.js has a smaller ecosystem than React, meaning we will need to build more custom UI components from scratch.
- Storage Latency: S3-compatible storage introduces slightly higher latency for block retrieval compared to local disk storage, requiring the Gateway to implement an efficient caching strategy.