How tbstechudt-dotcom/power-ca_mobileapp_staff works
PowerCA Mobile combines a Node.js replication service with a Flutter field-staff app. The principal workflow copies desktop PostgreSQL data to Supabase through a staging-based forward sync; staff use the cloud-backed mobile app, and mobile-created records return to desktop through incremental reverse sync. Scheduling and sync metadata support recurring, incremental runs. The README documents mobile features, but the tree and excerpts do not expose the Flutter application’s Dart source, so its internal feature components are represented at the app-directory level; relationships below rely on documented flows where implementation links were not sampled.
Main entry points: engine-staging.js Staging sync engine · powerca_mobile Flutter mobile app · reverse-sync-engine.js Reverse sync engine · runner-staging.js Forward sync runner
Components 14
Data replication
- Staging sync engine
sync/production/engine-staging.js - Sync mappings
sync/production/config.js - Forward sync runner
sync/production/runner-staging.js - Reverse sync runner
sync/production/reverse-sync-runner.js - Reverse sync engine
sync/production/reverse-sync-engine.js - Sync metadata
sync/production/engine-staging.js
Sync operations
- Sync scheduler
sync/scheduler/sync-scheduler.js
Mobile experience
- Flutter mobile app
powerca_mobile - Local SQLite cache
powerca_mobile
Cloud services
- Desktop PostgreSQL
- Supabase database
- Authentication functions
supabase/functions/auth-login/index.ts - Supabase Realtime
Other components
- Field staff
Connections 15
- Forward sync runner → Staging sync engine: runs
README.md - Staging sync engine → Desktop PostgreSQL: reads desktop
README.md - Staging sync engine → Supabase database: stages and writes
README.md - Staging sync engine → Sync mappings: uses mappings
sync/production/engine-staging.js - Staging sync engine → Sync metadata: tracks sync
sync/production/engine-staging.js - Sync scheduler → Forward sync runner: schedules sync
README.md - Reverse sync runner → Reverse sync engine: runs
README.md - Reverse sync engine → Supabase database: reads mobile data
README.md - Reverse sync engine → Desktop PostgreSQL: writes records
README.md - Reverse sync engine → Sync mappings: uses mappings
sync/production/reverse-sync-engine.js - Field staff → Flutter mobile app: uses
README.md - Flutter mobile app → Supabase database: queries and updates
README.md - Flutter mobile app → Authentication functions: authenticates
- Flutter mobile app → Supabase Realtime: receives updates
README.md - Flutter mobile app → Local SQLite cache: caches offline
README.md