Skip to content

feat: BackendStatusBanner + backend API contract docs - #32

Merged
priscaenoch merged 1 commit into
octraban:mainfrom
pharuq411:fix/empty-error-states
Jul 23, 2026
Merged

feat: BackendStatusBanner + backend API contract docs#32
priscaenoch merged 1 commit into
octraban:mainfrom
pharuq411:fix/empty-error-states

Conversation

@pharuq411

@pharuq411 pharuq411 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Closes #12

Two deliverables:

BackendStatusBanner component — a dismissible red banner that appears on every page when the Octraban indexer API is unreachable.

docs/api.md — a complete, human-readable contract for every HTTP/SSE endpoint the frontend consumes.

Changes
src/components/BackendStatusBanner.tsx (new)
Polls GET /api/health on mount and every 30 s using AbortSignal.timeout(4000).

Renders a role="alert" banner only when the backend is down and the user hasn't dismissed it.

Shows the configured VITE_INDEXER_URL and links to the backend repo.

No external dependencies — plain fetch + React state.

src/App.tsx
Imports and mounts above the block so it appears on every route.

docs/api.md (new)
Documents all 30+ endpoints consumed by src/api.ts, grouped by resource.

Each entry covers: method + path, query params, request body (where applicable), and a typed response example.

Covers SSE streams (/sub-invocations/stream, /transactions/:txHash/status/stream).

Includes a standard error-response section and a quick-reference SSE table.

Testing
With the backend stopped: the banner appears within ~4 s of page load.

Clicking × dismisses it for the session.

With the backend running (npm run dev in octraban_backend): banner never appears.

npm run build passes — no new type errors.

feat: BackendStatusBanner + backend API contract docs
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

@pharuq411 is attempting to deploy a commit to the Prisca's projects Team on Vercel.

A member of the Team first needs to authorize it.

@priscaenoch
priscaenoch merged commit 18cb3e0 into octraban:main Jul 23, 2026
0 of 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.

Handle backend-unavailable and empty states gracefully across data pages

2 participants