Skip to content

Import and Export

The Import and Export module allows administrators to perform batch operations on student, class, and nucleus records. Access is restricted to users with the ADMIN role — other profiles (CHAMADOR, RELATORIOS, CADASTRO) do not see the page in the sidebar menu.

Export supports three formats: CSV (flat columns, compatible with Excel and Google Sheets), JSON (nested structure, identical to the Student type in the schema), and Markdown (formatted tables for documentation). Import templates are generated dynamically from fieldManifest.ts, ensuring they are always aligned with the current schema version — when new fields are added to student registration, templates automatically reflect the change. The template filename includes the schema version (e.g., neemias-template-estudantes-v1.1.0.csv).

The import flow is designed to be safe and transparent. The user drags a .csv or .json file onto the upload zone (or clicks to select), and the format is auto-detected by content — UTF-8 encoding with BOM is handled, dates in Excel serial format are converted, and delimiters (, ; tab) are recognized. Before confirming, the administrator can enable dry-run mode (preview), which analyzes all rows without persisting anything, displaying three sections: rows ready to import (✅), possible duplicates with checkboxes for manual decision (⚠️), and rows with validation errors that will be ignored (❌). Each error includes the child's name and a descriptive message in Portuguese.

On the client side, import follows the file → Dexie (IndexedDB) → syncQueue flow. Records are created locally and queued for synchronization with the Worker as soon as connectivity is available. Export takes the reverse path: queries IndexedDB via Dexie, serializes records in the chosen format, and triggers a browser download. Students with DELETED status are automatically excluded from export. The system imposes limits of 10 MB per file and 1000 rows per import to ensure performance even on slower devices.

For the complete guide with step-by-step instructions, file examples, full field reference, troubleshooting, and FAQs, see the Import and Export Guide.

⚠️ Section under expansion.


Source: docs/IMPORT-EXPORT.md and app/src/modules/importExport/fieldManifest.ts

Distributed under MIT License.