13 / NAVRENZA GUIDE
Connect a real backend
Replace the demo service while retaining the template’s UI and error handling.
Replace the local data source
- Create authenticated API endpoints for the records your page needs.
- Load data with fetch and display loading/error states.
- Pass validated records into Navrenza.table or your page renderer.
- Replace local commits with awaited POST/PATCH/DELETE requests.
- Update the screen after successful responses and preserve fields on errors.
- Remove demo role/reset/failure controls in production.
js
async function request(path, options = {}) {
const response = await fetch('/api' + path, {
credentials: 'include', ...options,
headers: { 'Content-Type': 'application/json', ...options.headers }
});
if (response.status === 204) return null;
const body = await response.json();
if (!response.ok) throw new Error(body.error || 'Request failed');
return body;
}Authentication and authorization
Replace sample login behavior with your server session or identity provider. Verify identity, role and record ownership on every endpoint. Configure CSRF protection for cookie-authenticated mutations. Keep credentials off public scripts and derive prices, permissions and audit actors server-side.
Handle request failures
| Status | UI response |
|---|---|
| 401 | Sign-in/session recovery |
| 403 | Restricted state |
| 409 | Conflict handling or reload |
| 422 | Field validation messages |
| Network or 5xx | Preserve input and offer retry |
Rendering ownership
A server-rendered page and a native demo workflow must not both overwrite main. Disable or adapt the demo renderer for a server-owned page. See the runnable mock service for customer CRUD and the PHP/ASP.NET guide for layout extraction.