How chedy256/todo_team works
Project Type & Purpose
• This is a Flutter-based, cross-platform (Android & iOS) mobile client for a collaborative “Offline-First” task management system.
• It consumes a remote REST API (JWT-authenticated) and integrates Firebase Cloud Messaging (FCM) for push notifications.
File Structure
• Top‐level:
• android/ & ios/ — native platform projects
• lib/ — Dart sources split into controllers (state), models, services, utils, views (UI)
• Key config: .env (backend URL), firebase.json, devtools_options.yaml
• Build files: pubspec.yaml, Gradle scripts, Xcode project files
Core Architecture (from README & tree)
• UI Layer: Flutter widgets (lib/views)
• State Management: Provider controllers (lib/controllers)
• Data Layer:
• Sqflite local DB (tasks, users, pending_changes)
• flutter_secure_storage for JWT & credentials
• Networking Layer: HTTP/REST with JWT (lib/services/online_service.dart)
• Notification Layer:
• Local (flutter_local_notifications)
• Push (firebase_messaging + FCM)
• Connectivity & Sync: ConnectivityService + ReconnexionService
Main Components
• Presentation/UI Layer
– Widgets & Screens (login, signup, task screens)
• State Layer
– AuthController, TaskProvider, UserProvider
• Services Layer
– ConnectivityService, OnlineService, LocalDatabaseService, SecureStorage, NotifService, ReconnexionService, DialogsService
• Persistence
– Sqflite Database (tasks, users, pending_changes)
– Secure Storage (JWT, expiry)
• Notification Broker
– Local notifications plugin
– FCM client
• External Systems
– Remote REST API server
– Firebase Cloud Messaging
Relationships & Data Flow
UI → State Providers (dispatch user actions)
State Providers → Services
• OnlineService ↔ REST API (HTTP + JWT)
• LocalDatabaseService ↔ Sqflite (CRUD + pending_changes)
• SecureStorage ↔ flutter_secure_storage (JWT tokens)
ConnectivityService monitors network → ReconnexionService triggers sync (pending_changes → REST API)
FCM → NotifService → State/UI updates
NotifService schedules local notifications
Architectural Patterns & Principles
• Layered Separation of Concerns (UI / State / Data / Network)
• Offline-First Sync Pattern (local queue & reconciliation)
• Provider Pattern for MVVM-like state management
• Dependency Injection of services into controllers
• Secure handling of credentials & token refresh
Elements
• UI Widgets & Screens
• Provider Controllers
• Service Modules
• Local DB + Secure Storage
• Connectivity & Sync Services
• Local & Push Notification Flow
• External REST API & FCM endpoints