How rushyendra28/kidlink works
Project type and purpose
• Cross-platform Flutter application (“kidlink”) for parental monitoring of children’s device usage.
• Runs on Android, iOS, Web, Linux, macOS, Windows.
• Uses local JSON storage for usage data, Firebase Cloud Messaging (FCM) for push notifications, and likely Firebase Auth for user sign-in.
File-structure analysis
a. Top levels:
– android, ios, linux, macos, windows, web: platform runners and build configs
– lib: core Dart code
– test: widget tests
b. Under lib:
– models/: data objects (e.g., UserModel)
– screens/: Flutter UI pages (child/parent login, dashboards, profile)
– services/: abstraction layer for Authentication, Monitoring (screen-time tracking & JSON storage), Notification (FCM integration)
– theme/: shared theme provider
c. No server code: client-only, integrates with external services (FCM, Firebase Auth, local file system).
README insights
• Monitors screen time & app usage, stores data as JSON, sends real-time alerts via FCM.
• No proprietary backend–cloud components beyond FCM/Auth.
a. Presentation Layer (Flutter UI)
– Screens (child_login, child_dashboard, parent_dashboard, parent_profile)
b. Domain/Model Layer
– UserModel, other data objects
c. Services/Infrastructure Layer
– AuthService ↔ Firebase Auth
– MonitoringService ↔ Local JSON file storage & device usage APIs
– NotificationService ↔ FCM
d. Platform Runners
– AndroidEmbedder, iOS runner, Web runner, Linux/macOS/Windows runner
e. External Services
– Firebase Authentication (sign-in)
– Firebase Cloud Messaging (push notifications)
Interactions and data flows
1. User opens App → Presentation Layer
2. Login screen calls AuthService → Firebase Auth → returns token/user profile
3. After auth, MonitoringService polls device APIs for screen-time/app usage → writes JSON locally
4. ParentDashboard requests usage data → MonitoringService reads JSON → UI renders charts/stats
5. NotificationService registers with FCM → receives push alerts (e.g., excessive use) → UI notifier/pop-up
6. Services layer exposed to UI via Provider (theme_provider.dart implies use of Provider state management).
Architectural patterns and design principles
• Layered/Clean Architecture: UI → Domain models → Services → External
• Separation of concerns: services encapsulate all logic for auth, monitoring, notifications.
• Platform abstraction: same Dart code, platform runners handle native integration.
• State management: Provider pattern via theme_provider (could extend to auth & data providers).