Skip to content

feat: add data export/import feature#38

Merged
NexaFlowFrance merged 1 commit intoNexaFlowFrance:mainfrom
victorprouff:feature/data-export-import
Mar 8, 2026
Merged

feat: add data export/import feature#38
NexaFlowFrance merged 1 commit intoNexaFlowFrance:mainfrom
victorprouff:feature/data-export-import

Conversation

@victorprouff
Copy link
Copy Markdown
Contributor

Summary

  • Add GET /api/data/export: dumps all user data (family members, tasks, recipes, meal plans, budget entries & limits, shopping items, appointments, schedule entries) as a versioned JSON file
  • Add POST /api/data/import: restores data from an export file inside a transaction; inserts are idempotent (ON CONFLICT DO NOTHING) so existing data is never overwritten
  • Import order respects foreign key constraints (family_members and recipes first)
  • Add a Settings page (/settings) with Export and Import UI cards
  • Register /settings route and add entry in sidebar navigation

Use cases

  • Backup & restore: export before a major update, reimport if something goes wrong
  • Migration: export from one instance, import into another
  • Schema changes: when the data model evolves, the JSON export can be transformed manually before reimport

Export format

{
  "version": "1.0",
  "exportedAt": "2026-03-08T12:00:00.000Z",
  "family_members": [...],
  "tasks": [...],
  "recipes": [...],
  "meal_plans": [...],
  "budget_entries": [...],
  "budget_limits": [...],
  "shopping_items": [...],
  "appointments": [...],
  "schedule_entries": [...]
}

Test plan

  • Export triggers a JSON file download with all entities populated
  • Import from a previously exported file restores all data correctly
  • Re-importing the same file produces no duplicates (idempotent)
  • Import failure rolls back entirely (no partial data)
  • Settings page accessible from sidebar on desktop and mobile

🤖 Generated with Claude Code

- Add GET /api/data/export: dumps all user data (budget, tasks, recipes,
  meal plans, shopping, appointments, schedule) as a versioned JSON file
- Add POST /api/data/import: restores data from an export file inside a
  transaction; inserts are idempotent (ON CONFLICT DO NOTHING)
- Import order respects FK constraints (family_members and recipes first)
- Add Settings page with Export and Import UI cards
- Register /settings route and add entry in sidebar navigation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@NexaFlowFrance NexaFlowFrance merged commit 06fb424 into NexaFlowFrance:main Mar 8, 2026
1 check passed
@victorprouff victorprouff deleted the feature/data-export-import branch March 8, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants