All inspection data — including checklist responses, photos, and customer signatures — is stored locally in the browser using IndexedDB, allowing the Euroautos Inspection Form to function fully without an internet connection. When a backend is configured, data is synchronised automatically once connectivity is restored, ensuring no work is lost regardless of network conditions.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/juanmatz/inspection-form-euroautos/llms.txt
Use this file to discover all available pages before exploring further.
Storage Architecture
The app uses a two-layer storage model:- IndexedDB (primary) — All inspection data is written to IndexedDB immediately as the inspector works. This is the source of truth for the local session and is what the app reads from when rendering inspection lists, section views, and reports.
-
Backend REST API (optional) — When the environment variable
VITE_API_URLis set at build time, the app registers mutations in a localsync_queuestore and flushes them to the backend whenever the browser reports an online connection. This enables cross-device access and centralised record-keeping without blocking the inspector’s workflow.
IndexedDB Stores
The app opens a single IndexedDB database namedeuroautos at version 1. It contains three object stores:
| Store | Key | Description |
|---|---|---|
inspections | id (UUID) | Full inspection JSON objects, including all sections, checklist items, status, and metadata. |
photos | id (UUID) | Base64-encoded JPEG photo data linked to individual inspection checklist items via itemId and inspectionId foreign keys. |
sync_queue | id (UUID) | Pending mutations (creates and updates) awaiting backend synchronisation. Each entry records the target inspectionId, the mutation type, and the serialised payload. |
Each photo entry in the
photos store contains the fields id, inspectionId, itemId, mimeType, data (Base64 string), and createdAt. This normalised structure keeps the inspections store lean — item photo arrays store only photo id references, not the raw data.Reading Stored Inspections
You can read stored inspections directly from IndexedDB using theidb library (already bundled with the app) or the raw IndexedDB API. The following snippet uses the idb helper:
inspectionId index:
Storage Limits
Browser IndexedDB storage is drawn from the same quota as other origin storage (Cache API, localStorage, etc.). Browsers typically allocate between 50% and 80% of available free disk space to a single origin, but the exact limit varies by browser and platform:| Browser | Quota model |
|---|---|
| Chrome / Edge | Up to ~80% of available disk space per origin |
| Firefox | Up to 50% of available disk space, capped at 2 GB without persistent storage permission |
| Safari | Dynamic quota; may be as low as 1 GB without persistent storage grant |
| Mobile browsers | Generally lower limits; Safari on iOS enforces stricter caps |
Photos are by far the largest consumers of local storage. A single high-resolution JPEG can exceed 3–5 MB after Base64 encoding. A typical full inspection with 20 photos can consume 60–100 MB. On devices with limited free disk space, inspectors should export and clear completed inspections regularly.
- Enable backend sync (
VITE_API_URL) so that synced inspections can be cleared from local storage without data loss. - Lower the maximum photo size using the
VITE_MAX_PHOTO_SIZE_MBenvironment variable (default:5). - Encourage inspectors to export and clear completed inspections at the end of each shift.
Exporting Local Data
The app provides an “Exportar datos” option in the Settings screen (⚙ icon → Almacenamiento → Exportar datos). Tapping this button:- Reads all records from the
inspectionsstore. - Reads all associated photos from the
photosstore and embeds them inline. - Serialises the result as a single JSON file.
- Triggers a browser file download named
euroautos-export-<ISO-date>.json.
Backend Sync
WhenVITE_API_URL is set at build time (e.g. VITE_API_URL=https://api.euroautos.example.com), the app activates its sync pipeline:
- Every time an inspection is created or updated, a corresponding entry is written to the
sync_queuestore alongside the IndexedDB write. - The app listens for the browser’s
onlineevent. When fired, it dequeues all pending entries fromsync_queueand POSTs them to{VITE_API_URL}/api/v1/inspections. - On a successful
2xxresponse, the sync queue entry is deleted. On failure, it is retried with exponential back-off on the nextonlineevent.
id (a UUID generated client-side) as the idempotency key. The backend is expected to treat a POST with a known id as an upsert, making it safe to replay queue entries after a partial failure:
The sync pipeline only processes outbound mutations (device → backend). There is currently no inbound sync (backend → device). Inspections created on other devices are not pulled down automatically; this feature is on the roadmap.
Clearing Data
The app provides a “Limpiar datos” option in the Settings screen (Almacenamiento → Eliminar todo). This permanently deletes all records from theinspections, photos, and sync_queue stores.
You can also clear storage manually via browser developer tools:
Navigate to Application storage
Click the Application tab, then expand IndexedDB in the left sidebar.