A client-side web application for Storacha customers to view their storage usage, egress statistics, and monthly billing.
- Framework: Next.js 15+ with App Router and static export
- Authentication: Email-based UCAN via @storacha/ui-react
- Styling: Tailwind CSS with Storacha design tokens
- Data Fetching: SWR with stale-while-revalidate caching
- Deployment: TBD
- Capacity Bar: Visual representation of reserved vs. used storage
- Daily Storage Chart: Line chart for accumulated storage, bars for daily deltas
- Daily Egress Chart: Bars for daily egress, line for accumulated total
- Default period: First day of last complete month to today
- Monthly storage usage in TiB with pricing calculations
- Monthly egress usage in TiB with pricing calculations
- Configurable pricing (set at build time)
- Current calendar month billing period
| Data | Capability | Service | Notes |
|---|---|---|---|
| Reserved Capacity | plan/get |
upload-service | Plan limit in bytes |
| Storage Usage | account/usage/get |
upload-service | Events rolled up into daily snapshots |
| Egress Data | account/egress/get |
etracker-service | Daily stats already aggregated |
- Node.js 20+
- pnpm
# Install dependencies
pnpm install
# Run development server (env vars can also be set in .env.local)
NEXT_PUBLIC_UPLOAD_SERVICE_URL=https://staging.up.warm.storacha.network \
NEXT_PUBLIC_UPLOAD_SERVICE_DID=did:web:staging.up.warm.storacha.network \
NEXT_PUBLIC_ETRACKER_SERVICE_URL=https://staging.etracker.warm.storacha.network \
NEXT_PUBLIC_ETRACKER_SERVICE_DID=did:web:staging.etracker.warm.storacha.network \
NEXT_PUBLIC_STORAGE_USD_PER_TIB=5.99 \
NEXT_PUBLIC_EGRESS_USD_PER_TIB=10.0 \
pnpm devThe dashboard will be available at http://localhost:3001
pnpm buildThe static output will be in out/ directory.
All configuration is set at build time:
NEXT_PUBLIC_ETRACKER_SERVICE_DID- Etracker service DIDNEXT_PUBLIC_ETRACKER_SERVICE_URL- Etracker service endpointNEXT_PUBLIC_UPLOAD_SERVICE_DID- Upload service DIDNEXT_PUBLIC_UPLOAD_SERVICE_URL- Upload service endpointNEXT_PUBLIC_STORAGE_USD_PER_TIB- Storage price in USD per TiB/monthNEXT_PUBLIC_EGRESS_USD_PER_TIB- Egress price in USD per TiB
- User enters email address
- Verification email sent via @storacha/client
- User clicks link to authorize
- Delegations stored in browser IndexedDB
- Dashboard invokes capabilities using stored delegations
The dashboard detects expired UCAN delegations and automatically:
- Shows error toast notification
- Clears stored delegations from IndexedDB
- Reloads page to show login form
web/customer/
βββ src/
β βββ app/ # Next.js App Router pages
β β βββ layout.tsx # Root layout with providers
β β βββ page.tsx # Redirects to dashboard view
β β βββ dashboard/ # Dashboard view
β β βββ billing/ # Billing view
β βββ components/ # React components
β β βββ Authenticator.tsx
β β βββ W3UIProvider.tsx
β β βββ DashboardLayout.tsx
β β βββ CapacityBar.tsx
β β βββ ...
β βββ hooks/ # Data fetching hooks
β β βββ usePlan.ts
β β βββ useAccountUsage.ts
β β βββ useAccountEgress.ts
β βββ lib/ # Utilities
β β βββ services.ts # UCAN connections
β β βββ formatting.ts # Byte/date formatting
β β βββ pricing.ts # Price calculations
β β βββ rollup.ts # Event aggregation
β βββ types/ # TypeScript types
βββ public/ # Static assets
βββ package.json
βββ next.config.js # Static export config
βββ tailwind.config.ts # Storacha design tokens
βββ tsconfig.json
- Chart Placeholders: Full recharts implementation needs to be completed
- Error Handling: More robust error recovery needed for network failures
- Loading States: Could be enhanced with skeleton screens
- Implement full recharts visualizations
- Add date range picker for custom periods
- Export invoice data as PDF
- Add space-level filtering
- Real-time updates via WebSocket
- Mobile-responsive improvements