Skip to content

feat(supabase): implement BYOS offline-first sync layer (US-42) - #119

Merged
konami12 merged 5 commits into
developmentfrom
init
Jun 12, 2026
Merged

feat(supabase): implement BYOS offline-first sync layer (US-42) #119
konami12 merged 5 commits into
developmentfrom
init

Conversation

@konami12

Copy link
Copy Markdown
Contributor

This pull request introduces several important fixes and improvements to the handling, export/import, and cloud synchronization of task templates, as well as providing a comprehensive Supabase SQL initialization script for BYOS deployments. The main changes address missing synchronization logic, correct naming mismatches between IndexedDB and Supabase, and update documentation to reflect these enhancements.

Export/Import and Synchronization Fixes:

  • Task templates (taskTemplates) are now included in export/import operations, with backward compatibility for older exports and minimal validation requirements.
  • All relevant repositories (label.repository.ts, project.repository.ts, template.repository.ts) now call the appropriate Supabase sync functions (syncUpsert, syncDelete, etc.) after create, update, or delete operations, ensuring full two-way sync.
  • The Supabase sync logic now includes a mapping (TABLE_NAMES) to translate camelCase IndexedDB store names (like taskTemplates) to snake_case Supabase table names (like task_templates). This prevents sync errors due to naming mismatches.

Supabase Schema and Initialization:

  • Added a detailed SQL script (docs/dojo-kanban-supabase-init.sql) to initialize all required tables, policies, triggers, and indices in a personal Supabase project, supporting user-level isolation and real-time updates.

Documentation Updates:

  • Updated user documentation to clarify that deleting a label or template in cloud mode also removes it from the cloud, and that task templates are now synchronized and included in export/import. [1] [2] [3] [4]

Most important changes:

Export/Import & Synchronization

  • Included taskTemplates in export/import logic, with minimal validation and backward compatibility.
  • Ensured all CRUD operations for projects, labels, and templates are properly synchronized with Supabase, and added missing mappers for taskTemplates.
  • Introduced a mapping layer in supabase-sync.ts to translate IndexedDB store names to Supabase table names, fixing sync issues due to naming mismatches.

Supabase Schema

  • Added a full Supabase initialization SQL script to create all tables, RLS policies, triggers, and indices for BYOS deployments.

Documentation

  • Updated documentation to reflect that templates and labels are now synchronized with the cloud and included in export/import, and clarified sync behavior in FAQ and usage guides. [1] [2] [3] [4]

konami12 and others added 5 commits May 27, 2026 19:02
…arch and history (US-46, closes #113)

- Refactor dojo-command-palette: full command registry (14 cmds, 4 categories)
- Add fuzzy search algorithm (char-in-order with consecutive bonus)
- Add localStorage command history (max 10, shown on empty query)
- Add keyboard shortcut badges per command
- Emit dojo:palette-command event; preserve legacy task events
- Update dojo-app to listen and execute all 14 palette commands
- Add user-stories/US-46-command-palette.md
- Add requirements/improvements-16-keyboard-shortcuts.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add native Supabase client (zero-dep) with Auth, REST and Realtime
- Add IRepository interface, SupabaseRepository, SyncRepository, RepositoryFactory
- Add dojo-setup-screen and dojo-auth-screen Web Components
- Patch all repositories (board, column, task, label, person, project, template)
  with syncUpsert/syncDelete fire-and-forget after every IndexedDB write
- Add camelCase→snake_case MAPPERS and TABLE_NAMES (taskTemplates→task_templates)
- Add offline queue in localStorage with auto-flush on 'online' event
- Add syncAllLocalToSupabase() for bulk initial sync on login
- Wire Supabase init flow in main.ts before IndexedDB bootstrap

Closes #103
- Read taskTemplates store in exportBoardData() transaction
- Restore taskTemplates in importBoardData() when present in file
- Validate templates with _isValidTaskTemplate() (id, name, createdAt)
- Backward-compatible: old exports without taskTemplates import cleanly

fix(task): increase title maxLength from 120 to 250 characters
- Add docs/dojo-kanban-supabase-init.sql with all tables, RLS policies and triggers
- Add docs/wiki/17-sincronizacion-nube.md (BYOS setup guide, offline-first arch, FAQ)
- Update docs/wiki/15-templates-tareas.md: subtasks field, export/import and sync notes
- Update docs/wiki/04-etiquetas.md: note about cloud delete sync
- Update docs/wiki/index.md: entry #17
- Update COOKBOOK.md: Pasos 35, 36 and 37 with decisions and patterns
…tion

feat(supabase): US-42 — Integración BYOS offline-first con Supabase
@konami12
konami12 merged commit 014829b into development Jun 12, 2026
1 check passed
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.

1 participant