# regolith-labs/ore-starter-app architecture

> Architecture diagram of the GitHub repository regolith-labs/ore-starter-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/regolith-labs/ore-starter-app
- Repository: https://github.com/regolith-labs/ore-starter-app

## Overview

#### Purpose and Delivery Model
ORE Starter App is a browser-based mining-client template for the ORE ecosystem. It compiles Rust/Dioxus to WebAssembly, serves a single-page application, and interacts directly with Solana and ORE services from the client. The production artifact is static assets plus WASM, optionally served by a small Rust server.
Paths: `src/main.rs`, `build.sh`, `serve/src/main.rs`.

#### Application Entry, Routing, and Pages
`src/main.rs` initializes the Dioxus application, shared providers, and routing. Route definitions select the mining and rewards workflows, with a not-found fallback. Pages compose feature UI, hooks, gateway data, and transaction actions rather than owning RPC logic.
Paths: `src/main.rs`, `src/route.rs`, `src/pages/mine.rs`, `src/pages/rewards.rs`.

#### UI Composition Layer
Reusable presentation is split into layout/navigation/feedback, generic controls, token-value renderers, and wallet-specific views. This separates visual composition from application state and chain calls; pages consume these components and hooks.
Paths: `src/components/layout/layouts.rs`, `src/components/token_value/token_value.rs`, `src/components/wallet/wallet_drawer_web.rs`.

#### Gateway Boundary: Solana, ORE, and Streaming State
The gateway layer is the external-service boundary. It provides the WASM-compatible Solana RPC access, ORE and Entropy API calls, error handling, and browser WebSocket support. The compile-time `ORE_RPC_URL` selects the Solana RPC endpoint; its client-visible nature means it must not contain secrets.
Paths: `src/gateway/mod.rs`, `src/gateway/solana.rs`, `src/gateway/ore.rs`, `src/gateway/entropy.rs`, `src/gateway/wss/web.rs`.

#### Reactive Hooks and Data Flow
Hooks translate gateway reads and subscriptions into Dioxus state for balances, mining rounds, treasury/configuration, miner/board state, prices, and automation. WebSocket hooks form the live-update substrate; page/UI components react to their state, while RPC/API calls cover request-response operations.
Paths: `src/hooks/use_gateway.rs`, `src/hooks/wss/use_wss.rs`, `src/hooks/use_miner_wss.rs`, `src/hooks/use_ore_balance_wss.rs`, `src/hooks/use_round_wss.rs`.

#### Wallet and Transaction Pipeline
Wallet connectivity crosses a JS/WASM bridge: Rust wallet hooks and views call the generated browser adapter bundle, which integrates wallet-adapter tooling. User actions select a transaction builder (deploy, claim, reset, top-up, automate, cancel), then submit through the web submitter and observe status completion. Signing occurs through the connected browser wallet; the app submits against Solana RPC.
Paths: `src/hooks/wallet/use_wallet_web.rs`, `src/components/wallet/wallet_adapter_web.rs`, `src/hooks/transaction_builders/use_claim_ore_transaction.rs`, `src/hooks/submit/submit_transaction_web.rs`, `src/hooks/transaction_status/use_transaction_status.rs`.

#### Runtime Assets and Deployment
The web runtime uses Dioxus/Rust WASM and Tailwind CSS, with wallet JavaScript built separately by Node/Webpack and emitted to static assets. `build.sh` produces the release web bundle; the Warp-based server serves it on port 8080 with SPA route fallback. Render is the documented hosting target.
Paths: `scripts/wallet/src/main.js`, `assets/wallet.js`, `assets/tailwind.css`, `build.sh`, `serve/src/main.rs`.

Main entry points: [`src/pages/mine.rs`](https://github.com/regolith-labs/ore-starter-app/blob/master/src/pages/mine.rs) (Mining page), [`src/pages/rewards.rs`](https://github.com/regolith-labs/ore-starter-app/blob/master/src/pages/rewards.rs) (Rewards page), [`src/hooks/submit/submit_transaction_web.rs`](https://github.com/regolith-labs/ore-starter-app/blob/master/src/hooks/submit/submit_transaction_web.rs) (Web transaction submitter), [`src/hooks/use_gateway.rs`](https://github.com/regolith-labs/ore-starter-app/blob/master/src/hooks/use_gateway.rs) (Reactive data hooks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Dioxus SPA"]
  node_entry["App entry &amp; providers<br/>Dioxus bootstrap<br/>[main.rs]"]
  node_routes["Routes<br/>router<br/>[route.rs]"]
  node_mine_page["Mining page<br/>[mine.rs]"]
  node_rewards_page["Rewards page<br/>[rewards.rs]"]
  node_ui_components["Reusable UI<br/>components<br/>[layouts.rs]"]
end

subgraph group_data["Client Data Layer"]
  node_gateway{{"Gateway boundary<br/>service client<br/>[mod.rs]"}}
  node_solana_rpc["Solana RPC client<br/>gateway<br/>[solana.rs]"]
  node_ore_entropy["ORE &amp; Entropy APIs<br/>gateway<br/>[ore.rs]"]
  node_websocket["Browser WebSocket<br/>stream client<br/>[web.rs]"]
  node_reactive_hooks["Reactive data hooks<br/>Dioxus hooks<br/>[use_gateway.rs]"]
  node_live_hooks["Live mining hooks<br/>WebSocket hooks<br/>[use_miner_wss.rs]"]
end

subgraph group_wallet["Wallet &amp; Transactions"]
  node_wallet_hook["Wallet connection<br/>Rust/WASM hook<br/>[use_wallet_web.rs]"]
  node_wallet_adapter{{"Browser wallet adapter<br/>JS/WASM bridge"}}
  node_tx_builder["Transaction builders"]
  node_tx_submit["Web transaction submitter<br/>transaction sender"]
  node_tx_status["Transaction status<br/>status hook"]
end

subgraph group_external["External Services"]
  node_solana[("Solana network<br/>external RPC")]
  node_ore_services[("ORE services<br/>external APIs")]
end

subgraph group_delivery["Build &amp; Hosting"]
  node_wallet_bundle["Wallet JS bundle<br/>static asset<br/>[wallet.js]"]
  node_web_bundle["WASM SPA bundle<br/>release artifact<br/>[build.sh]"]
  node_static_server["Warp SPA server<br/>Rust server<br/>[main.rs]"]
end

node_entry -->|"configures"| node_routes
node_routes -->|"renders"| node_mine_page
node_routes -->|"renders"| node_rewards_page
node_mine_page -->|"composes"| node_ui_components
node_rewards_page -->|"composes"| node_ui_components
node_mine_page -->|"consumes"| node_reactive_hooks
node_rewards_page -->|"consumes"| node_reactive_hooks
node_reactive_hooks -->|"reads through"| node_gateway
node_live_hooks -->|"subscribes through"| node_websocket
node_live_hooks -->|"updates state for"| node_reactive_hooks
node_gateway -->|"provides"| node_solana_rpc
node_gateway -->|"provides"| node_ore_entropy
node_solana_rpc -->|"RPC calls"| node_solana
node_ore_entropy -->|"API calls"| node_ore_services
node_websocket -->|"live updates"| node_ore_services
node_ui_components -->|"uses"| node_wallet_hook
node_wallet_hook -->|"bridges to"| node_wallet_adapter
node_mine_page -->|"initiates actions"| node_tx_builder
node_rewards_page -->|"initiates claims"| node_tx_builder
node_tx_builder -->|"builds for"| node_tx_submit
node_tx_submit -->|"requests signature"| node_wallet_adapter
node_tx_submit -->|"submits to"| node_solana
node_tx_submit -->|"reports completion"| node_tx_status
node_wallet_bundle -->|"included in"| node_web_bundle
node_web_bundle -->|"served by"| node_static_server

click node_entry "https://github.com/regolith-labs/ore-starter-app/blob/master/src/main.rs"
click node_routes "https://github.com/regolith-labs/ore-starter-app/blob/master/src/route.rs"
click node_mine_page "https://github.com/regolith-labs/ore-starter-app/blob/master/src/pages/mine.rs"
click node_rewards_page "https://github.com/regolith-labs/ore-starter-app/blob/master/src/pages/rewards.rs"
click node_ui_components "https://github.com/regolith-labs/ore-starter-app/blob/master/src/components/layout/layouts.rs"
click node_gateway "https://github.com/regolith-labs/ore-starter-app/blob/master/src/gateway/mod.rs"
click node_solana_rpc "https://github.com/regolith-labs/ore-starter-app/blob/master/src/gateway/solana.rs"
click node_ore_entropy "https://github.com/regolith-labs/ore-starter-app/blob/master/src/gateway/ore.rs"
click node_websocket "https://github.com/regolith-labs/ore-starter-app/blob/master/src/gateway/wss/web.rs"
click node_reactive_hooks "https://github.com/regolith-labs/ore-starter-app/blob/master/src/hooks/use_gateway.rs"
click node_live_hooks "https://github.com/regolith-labs/ore-starter-app/blob/master/src/hooks/use_miner_wss.rs"
click node_wallet_hook "https://github.com/regolith-labs/ore-starter-app/blob/master/src/hooks/wallet/use_wallet_web.rs"
click node_wallet_adapter "https://github.com/regolith-labs/ore-starter-app/blob/master/src/components/wallet/wallet_adapter_web.rs"
click node_tx_builder "https://github.com/regolith-labs/ore-starter-app/blob/master/src/hooks/transaction_builders/use_claim_ore_transaction.rs"
click node_tx_submit "https://github.com/regolith-labs/ore-starter-app/blob/master/src/hooks/submit/submit_transaction_web.rs"
click node_tx_status "https://github.com/regolith-labs/ore-starter-app/blob/master/src/hooks/transaction_status/use_transaction_status.rs"
click node_wallet_bundle "https://github.com/regolith-labs/ore-starter-app/blob/master/assets/wallet.js"
click node_web_bundle "https://github.com/regolith-labs/ore-starter-app/blob/master/build.sh"
click node_static_server "https://github.com/regolith-labs/ore-starter-app/blob/master/serve/src/main.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_routes,node_mine_page,node_rewards_page,node_ui_components toneBlue
class node_gateway,node_solana_rpc,node_ore_entropy,node_websocket,node_reactive_hooks,node_live_hooks toneAmber
class node_wallet_hook,node_wallet_adapter,node_tx_builder,node_tx_submit,node_tx_status toneMint
class node_solana,node_ore_services toneRose
class node_wallet_bundle,node_web_bundle,node_static_server toneIndigo
```

## Components

### Dioxus SPA

- [App entry & providers](https://github.com/regolith-labs/ore-starter-app/blob/master/src/main.rs): Dioxus bootstrap · Initializes shared state and routing. · `src/main.rs`
- [Routes](https://github.com/regolith-labs/ore-starter-app/blob/master/src/route.rs): router · Selects mining, rewards, and fallback views. · `src/route.rs`
- [Mining page](https://github.com/regolith-labs/ore-starter-app/blob/master/src/pages/mine.rs): page · `src/pages/mine.rs`
- [Rewards page](https://github.com/regolith-labs/ore-starter-app/blob/master/src/pages/rewards.rs): page · `src/pages/rewards.rs`
- [Reusable UI](https://github.com/regolith-labs/ore-starter-app/blob/master/src/components/layout/layouts.rs): components · Layouts, token displays, and wallet views. · `src/components/layout/layouts.rs`

### Client Data Layer

- [Gateway boundary](https://github.com/regolith-labs/ore-starter-app/blob/master/src/gateway/mod.rs): service client · WASM-safe boundary for RPC, ORE APIs, and streaming. · `src/gateway/mod.rs`
- [Solana RPC client](https://github.com/regolith-labs/ore-starter-app/blob/master/src/gateway/solana.rs): gateway · Endpoint is selected by compile-time ORE_RPC_URL. · `src/gateway/solana.rs`
- [ORE & Entropy APIs](https://github.com/regolith-labs/ore-starter-app/blob/master/src/gateway/ore.rs): gateway · `src/gateway/ore.rs`
- [Browser WebSocket](https://github.com/regolith-labs/ore-starter-app/blob/master/src/gateway/wss/web.rs): stream client · `src/gateway/wss/web.rs`
- [Reactive data hooks](https://github.com/regolith-labs/ore-starter-app/blob/master/src/hooks/use_gateway.rs): Dioxus hooks · Maps gateway reads into application state. · `src/hooks/use_gateway.rs`
- [Live mining hooks](https://github.com/regolith-labs/ore-starter-app/blob/master/src/hooks/use_miner_wss.rs): WebSocket hooks · Keeps miner, balance, and round state current. · `src/hooks/use_miner_wss.rs`

### Wallet & Transactions

- [Wallet connection](https://github.com/regolith-labs/ore-starter-app/blob/master/src/hooks/wallet/use_wallet_web.rs): Rust/WASM hook · `src/hooks/wallet/use_wallet_web.rs`
- [Browser wallet adapter](https://github.com/regolith-labs/ore-starter-app/blob/master/src/components/wallet/wallet_adapter_web.rs): JS/WASM bridge · Integrates browser wallet-adapter tooling. · `src/components/wallet/wallet_adapter_web.rs`
- [Transaction builders](https://github.com/regolith-labs/ore-starter-app/blob/master/src/hooks/transaction_builders/use_claim_ore_transaction.rs): action builder · Builds claim and other mining transactions. · `src/hooks/transaction_builders/use_claim_ore_transaction.rs`
- [Web transaction submitter](https://github.com/regolith-labs/ore-starter-app/blob/master/src/hooks/submit/submit_transaction_web.rs): transaction sender · Requests wallet signing and submits transactions. · `src/hooks/submit/submit_transaction_web.rs`
- [Transaction status](https://github.com/regolith-labs/ore-starter-app/blob/master/src/hooks/transaction_status/use_transaction_status.rs): status hook · `src/hooks/transaction_status/use_transaction_status.rs`

### External Services

- **Solana network**: external RPC
- **ORE services**: external APIs

### Build & Hosting

- [Wallet JS bundle](https://github.com/regolith-labs/ore-starter-app/blob/master/assets/wallet.js): static asset · Generated browser adapter asset. · `assets/wallet.js`
- [WASM SPA bundle](https://github.com/regolith-labs/ore-starter-app/blob/master/build.sh): release artifact · Static Dioxus/Rust WASM application with Tailwind assets. · `build.sh`
- [Warp SPA server](https://github.com/regolith-labs/ore-starter-app/blob/master/serve/src/main.rs): Rust server · Serves the bundle on port 8080 with route fallback. · `serve/src/main.rs`

## Connections

- App entry & providers → Routes: configures
- Routes → Mining page: renders
- Routes → Rewards page: renders
- Mining page → Reusable UI: composes
- Rewards page → Reusable UI: composes
- Mining page → Reactive data hooks: consumes
- Rewards page → Reactive data hooks: consumes
- Reactive data hooks → Gateway boundary: reads through
- Live mining hooks → Browser WebSocket: subscribes through
- Live mining hooks → Reactive data hooks: updates state for
- Gateway boundary → Solana RPC client: provides
- Gateway boundary → ORE & Entropy APIs: provides
- Solana RPC client → Solana network: RPC calls
- ORE & Entropy APIs → ORE services: API calls
- Browser WebSocket → ORE services: live updates
- Reusable UI → Wallet connection: uses
- Wallet connection → Browser wallet adapter: bridges to
- Mining page → Transaction builders: initiates actions
- Rewards page → Transaction builders: initiates claims
- Transaction builders → Web transaction submitter: builds for
- Web transaction submitter → Browser wallet adapter: requests signature
- Web transaction submitter → Solana network: submits to
- Web transaction submitter → Transaction status: reports completion
- Wallet JS bundle → WASM SPA bundle: included in
- WASM SPA bundle → Warp SPA server: served by
