How infosys/sightconnect works
Project type and purpose
– This is a cross-platform Flutter “full-stack” mobile/web client app (“SightConnect”) that connects to a set of hosted eye-care REST services. It implements a clean-architecture layering (presentation, domain, data) and uses MVVM-style state management via Riverpod/Provider.
High-level architectural layers
• Presentation (UI)
– lib/main.dart, shared/router/app_router.dart, shared/widgets/, feature-specific presentation/pages & providers
– Uses Flutter widgets and Provider to react to user input and orchestrate flows
• Domain
– common use-cases (lib/apps/sightconnect/common/…/usecases, helpers/usecases)
– Feature-specific use-cases (e.g. saveTriages, getAppointments, fetchReports)
– Business-rule models and repository interfaces
• Data
– Repositories (impl) that implement domain interfaces
– Data sources:
· Remote via DioService (lib/services/dio_service.dart) with interceptors, token refresh, network_info
· Local via SQLite/TriageDbHelper and SharedPreferences (persistent_auth_data)
• Core Services
– Authentication & token management, environment config (.env), file service, geocoding, Matomo logging
• Localization
– lib/l10n/*.arb + generated app_localizations_*.dart
Backend & external dependencies
• Hosted REST API (BASE_URL in .env) exposing endpoints for patients, optometrists, vision-guardian, vision-technician, referrals, chatbot, FHIR, etc.
• External “Chatbot” AI service (lib/apps/sightconnect/common/chatbot/data/source/remote/chat_service.dart)
• Eye-detection & distance-detector native services (face_distance_detector_service_android/iOS)
• Third-party integration placeholders (ABDM, NHAI, Eye & Cornea Bank)
Database & local storage
• SQLite tables via TriageDbHelper for questionnaires & triage data
• SharedPreferences (persistent_auth_data) for auth tokens, user preferences
Architectural patterns & design principles
• Clean Architecture layering to decouple UI, business logic, and data sources
• Repository pattern + “data source” abstractions (remote vs local)
• MVVM-style state management via Provider classes in each feature’s presentation/providers folder
• Code generation: Freezed for immutable models, json_serializable for DTOs
• Modular feature structure: “libs/apps/sightconnect/features/{role}/{feature}”