Spala
Example

Metrics Collector Backend Example

A public example of the backend contract Spala can help create for metrics ingestion: events, dashboards, alerts, incidents, auth, API keys, and docs.

What this example proves

This page is not source code and does not expose private Spala implementation details. It shows the kind of backend contract an agent or frontend builder should expect after a Spala project is generated, reviewed, documented, and published.

Best for: SaaS teams, internal analytics tools, product teams.

Suggested backend contract

Tablesusers, workspaces, api_keys, metric_events, dashboards, alerts, incidents
EndpointsPOST /api/ingest
GET /api/metrics
GET /api/dashboards
POST /api/alerts
GET /api/incidents
PATCH /api/incidents/{id}
AuthDashboard routes use user auth. Ingestion uses scoped API keys and should validate workspace handoff and payload shape.
Frontend handoffFrontend receives ingestion format, dashboard query parameters, auth/API-key rules, error format, and generated docs.

How to test this in Spala

  1. Create a low-risk project in the hosted dashboard.
  2. Ask AI Copilot to generate this backend with auth, validation, API docs, and frontend handoff details.
  3. Review generated tables, endpoints, functions, and docs.
  4. Test protected and public routes in API Playground.
  5. Publish only after validation and review.

Machine-readable example files: handoff.json and openapi.json.