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
| Tables | users, workspaces, api_keys, metric_events, dashboards, alerts, incidents |
|---|---|
| Endpoints | POST /api/ingestGET /api/metricsGET /api/dashboardsPOST /api/alertsGET /api/incidentsPATCH /api/incidents/{id} |
| Auth | Dashboard routes use user auth. Ingestion uses scoped API keys and should validate workspace handoff and payload shape. |
| Frontend handoff | Frontend receives ingestion format, dashboard query parameters, auth/API-key rules, error format, and generated docs. |
How to test this in Spala
- Create a low-risk project in the hosted dashboard.
- Ask AI Copilot to generate this backend with auth, validation, API docs, and frontend handoff details.
- Review generated tables, endpoints, functions, and docs.
- Test protected and public routes in API Playground.
- Publish only after validation and review.
Machine-readable example files: handoff.json and openapi.json.