Example
Client Portal Backend Example
A public example of the backend contract Spala can help create for a client portal: users, cases, messages, documents, invoices, auth, API docs, and frontend handoff.
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: agencies, law firms, consultants, service businesses.
Suggested backend contract
| Tables | users, clients, cases, case_messages, document_metadata, invoices, audit_events |
|---|---|
| Endpoints | POST /api/signupPOST /api/loginGET /api/meGET /api/casesPOST /api/casesGET /api/cases/{id}/messagesPOST /api/cases/{id}/messagesPOST /api/documentsGET /api/invoices |
| Auth | User auth with roles for owner, staff, and client. Case and message access should be scoped by handoff and role. |
| Frontend handoff | Frontend receives base API URL, OpenAPI/Markdown docs, auth routes, token handling, CORS origin, upload route, and publish state. |
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.