How nguyenminhduc163/card-mind works
Main Components
a. Presentation (UI) Layer
• Flutter widgets & screens under lib/modules/**
• Common widgets under lib/common/**
• Entry points: lib/main.dart, lib/main_preview.dart
b. State Management Layer
• Notifiers under lib/providers/provider_setup.dart & lib/modules//_notifier.dart
• theme_cubit.dart (in lib/core/theme)
c. Domain/Core Layer
• Business-rules & app-wide services in lib/core/**
• NavigationService, EventService, Authentication, Debouncer, etc.
d. Data Layer
• API client, interceptors, secure storage in lib/data/**
• Services: auth_service.dart, connectivity_service.dart, course_service.dart, etc.
• Models (DTOs) under lib/data/models/**
e. Persistence & Cache
• Local: Hive DB, Flutter Secure Storage (lib/data/secure_storage.dart)
• In-memory cache: in_memory_cache_client.dart
f. External Services
• Firebase (Auth, Firestore)
• Google Sign-In
• Chatbot AI (external API)
• Connectivity check
g. Platform Runners
• Android (android/…)
• iOS (ios/…)
• Linux (linux/…)
• Web (web/…)
Relationships & Data Flow
• User interacts with Presentation → triggers State Management (Notifier/Cubit)
• Notifier invokes Domain/Core services (e.g., Authentication, EventService)
• Core services call Data Layer APIs or local storage helpers
• Data Layer → HTTP calls (Dio) to Firebase or Chatbot API, interceptors handle tokens, logging
• Responses → mapped to domain models → returned up to Notifier → UI widget renders
• Caching layer (Hive/In-memory) sits between Data Layer & External Services to optimize fetches
Architectural Patterns
• Clean Architecture (layers depend inward only)
• Provider/BLoC for state management
• Dependency-injection via provider_setup.dart
• Repositories (services implement interfaces)
• Separation of concerns: UI vs. domain vs. data vs. infra
Technologies & Frameworks to annotate
• Flutter & Dart
• Provider / Riverpod (or plain Provider)
• Hive / Secure Storage (local persistence)
• Firebase Auth / Firestore (cloud persistence)
• Dio + Interceptors (network client)
• Easy Localization (i18n)
• Material 3 / Shimmer / FlipCard animations
Essential Elements
• Clear labels: “UI: Course Screens”, “Notifier: CourseInfoNotifier”, “Service: CourseService”