Skip to content

feat: restore /usage page (network uptime & reliability) - #49

Merged
nimrod-teich merged 4 commits into
mainfrom
feat/usage-page
Apr 28, 2026
Merged

nimrod-teich merged 4 commits into
mainfrom
feat/usage-page

Conversation

@nimrod-teich

Copy link
Copy Markdown
Contributor

Summary

  • New /usage page in the web app: stat cards, recharts uptime comparison (slim strokes, dashed Blockchain RPCs, Lava on top), and per-service incident cards. Driven by useApi — no static JSON files, no scheduled scrapers.
  • Two new API routes back it, cached 24h:
    • GET /usage/cloud-incidents — Cloudflare/GCP/Vercel pulled live from official status APIs; AWS/Azure/DigitalOcean/Oracle merged from curated baselines committed in incident-baselines.ts.
    • GET /usage/blockchain-incidents — scrapes 12 RPC-provider status pages (StatusPage, Instatus, BetterStack) in parallel using native fetch + a tiny htmlToText helper. No axios/cheerio dep.
  • Nav: Usage link added to header (after Chains) and mobile nav. New burn.lavanet.xyz external link. Mobile nav marks Usage and Burn as external alongside Rewards.
  • Swagger: new Usage tag with response schemas + descriptions for both routes.

Test plan

  • pnpm typecheck green across all 3 packages.
  • pnpm --filter @info/api test routes-usage → 3/3 (happy path, cloud partial-upstream failure, blockchain all-upstream failure).
  • Verified end-to-end with docker compose -f docker-compose.dev.yml up:
    • curl http://localhost:8080/usage/cloud-incidents → 388 incidents, 250 from Cloudflare live + baselines.
    • curl http://localhost:8080/usage/blockchain-incidents → 2562 incidents from 8 active providers (cold ~30s, then 3ms cached).
    • GET http://localhost:3001/usage → 200, all section headings render SSR, FE confirmed hitting both API routes.
  • Eyeball the chart in a browser to confirm the slimmer styling reads cleanly across 3M / 6M / 1Y.
  • Click each nav item on mobile to confirm Usage and Burn open in a new tab as external.

- API: /usage/cloud-incidents and /usage/blockchain-incidents routes
  back the FE. Cloudflare/GCP/Vercel pulled live from official status
  APIs; AWS/Azure/DO/Oracle merged from curated baselines committed
  alongside the service. Blockchain RPC providers (Alchemy, Infura,
  QuickNode, Blockdaemon, Tenderly, Chainstack, GetBlock, Ankr,
  Helius, Nodies, Dwellir, DRPC) scraped via native fetch + a small
  htmlToText helper — no axios/cheerio deps. Both routes cached 24h.
  Vitest suite with mocked fetch covers happy path + partial-upstream
  failure. Swagger documents response schemas.

- Web: /usage page with stat cards, recharts uptime comparison
  (slim strokes, dot-less cloud lines, dashed blockchain RPCs, Lava
  on top), and per-service incident stats. Driven by useApi against
  the new endpoints — no static JSON, no scheduled scraping.

- Nav: Usage link added to desktop header (after Chains) and mobile
  nav. Burn external link added (burn.lavanet.xyz). Mobile nav marks
  Usage and Burn as external alongside Rewards.
@nimrod-teich
nimrod-teich merged commit 3dde250 into main Apr 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant