Flutter App, RBAC, Declarations & Jarvis AI
The main user application (planovi-flutter-app) runs as Flutter Web (panel.planovi.app) and mobile (iOS/Android), backed by Supabase Auth, PostgreSQL RLS, and Deno Edge Functions in planovi-backend.
Where Is It in Code?
| Feature / Symptom | Repository | Exact File / Path |
|---|---|---|
| Login, JWT session, RBAC permissions & organization switcher | planovi-flutter-app | lib/core/auth/, lib/features/auth/, lib/features/companies/, lib/features/admin/ |
| Jarvis AI Voice Assistant UI | planovi-flutter-app | lib/features/jarvis/ |
| Jarvis AI backend, energy balancing & news feed | planovi-backend | supabase/functions/{jarvis,ai-energy-balancer,fetch-energy-news}/ |
| Cooperative member onboarding & portal access provisioning | planovi-backend | supabase/functions/{grant-portal-access,member-onboarding-status,invite-team-member,send-onboarding-invitation}/ |
| Statutory energy cooperative declarations (schemas, DOCX/HTML, OCR) | planovi-backend | supabase/functions/{get-company-declaration-schema,approve-declaration-schema,get-member-declaration,submit-member-declaration,review-member-declaration,process-declaration-ocr,generate-prefilled-docx,docx-to-html,generate-resolution-document}/ |
| Document center UI in app | planovi-flutter-app | lib/features/documents/, lib/features/templates/ |
| Account deletion grace period & transactional notices | planovi-backend | supabase/functions/{cancel-account-deletion,send-account-deletion-notice,send-account-updated-notice,unsubscribe}/ |
| Translations (PL/EN) & Theme tokens | planovi-flutter-app | lib/core/constants/, lib/core/theme/ |
Common Issues & How to Debug
- User Sees Wrong Permissions or Missing Organization:
- Check the userβs membership and active organization license state in Supabase Studio (
https://dev-supabase-studio.planovi.app/supabase-studio.planovi.app). - Check
lib/core/auth/and recent RBAC/licensing logic inplanovi-flutter-app.
- Check the userβs membership and active organization license state in Supabase Studio (
- Flutter Build Failed on
vps-deployer:- Verify
.fvmrcat repo root specifies an exact semver ("3.44.8"β never"stable"). - Run
fvm flutter analyzelocally before pushing todevelop.
- Verify
- Jarvis AI or Declaration OCR Returning Errors:
- Both rely on
GEMINI_API_KEYinsidesupabase-edge-runtime-{dev,prod}:Terminal window docker logs --tail 100 supabase-edge-runtime-prod | grep -iE "jarvis|ocr|gemini"
- Both rely on