Files
chart/bible-local/architecture/api-surface.md
2026-03-15 21:41:38 +03:00

1.4 KiB

API Surface

Primary Integration Style

The package is intended to be embedded by other Go applications.

Current package shape:

  • viewer.RenderHTML(snapshot []byte) ([]byte, error)
  • viewer.NewHandler(viewer.HandlerOptions{...}) http.Handler
  • viewer.NewStandaloneHandler(viewer.HandlerOptions{...}) http.Handler

Integration model:

  • embedding app provides the JSON
  • chart renders HTML
  • embedded mode does not own snapshot selection UI
  • standalone mode may provide a local upload screen on GET /

Expected Runtime Endpoints

These endpoints are expected for the standalone binary only:

  • GET / - upload page
  • POST /render - accept one Reanimator JSON payload and return rendered HTML
  • GET /healthz - basic process health

Embedded handler endpoints:

  • GET / - empty viewer shell with no upload controls
  • POST /render - accept one Reanimator JSON payload and return rendered HTML
  • GET /healthz - basic process health
  • GET /static/... - embedded static assets

UI Route Rules

  • No multi-product navigation
  • No upload wizard with preview/confirm/execute stages
  • No collector/API-connect workflow
  • No background job polling API
  • Embedded mode must not force a file picker into host applications

Response Rules

  • HTML pages are read-only views of one snapshot
  • API responses must not modify or augment the input payload semantics