How mohamad-amen/peeko works
Project Type and Purpose
• Peeko is a full-stack social-media style mobile application (TikTok-inspired short video sharing) where the mobile client is built in Flutter and communicates with an external MERN-stack backend API.
• The file tree reveals a single Flutter codebase (lib/…) with an Android folder for platform integration, plus dependencies such as Provider, GoRouter, GetIt, and Shared Preferences.
File Structure
• Top-level directories:
• android/… – Native Android project and Gradle configs
• lib/… – Flutter application code
• assets/ – Images and screenshots
• test/ – Widget test
• Under lib/:
• core/ – Core app services, router, DI, themes
• features/ – Feature modules (auth, comments, profile, videos) each containing UI pages, state providers, services, models, widgets
• Configuration files: pubspec.yaml, analysis_options.yaml, GitHub workflow for releases.
Key Architectural Insights from README
• Flutter front end with HTTP-based API calls, DI via GetIt, state management via Provider, routing via GoRouter, persistent storage via Shared Preferences.
• External dependency: MERN API (hosted separately).
Main Components
a. Mobile Device / OS Layer
• Android (and potentially iOS) hosting the Flutter engine
b. Flutter Application
• Presentation Layer: Feature UI pages & widgets
• Navigation Layer: GoRouter routes & deep linking
• State Management: Provider-based ViewModels/Providers per feature
• Service Layer:
• ApiService (HTTP client for MERN API)
• LocalStorageService (Shared Preferences)
• Feature-specific services (AuthService, MediaService, DeviceInfoService)
• Dependency Injection: GetIt service locator
• Data Layer: Dart Models (VideoModel, CommentModel, UserModel)
c. External Services
• MERN-stack backend API (authentication, video storage, comments, user profiles)
• CDN or file storage for video assets (via backend)
Relationships and Interactions
• User taps UI → Presentation Layer notifies Provider → Provider invokes Service → ApiService makes HTTP calls to MERN API → JSON response mapped to Dart Models → Provider updates state → UI re-renders
• Some flows involve LocalStorageService for caching tokens or preferences (e.g., auth tokens, theme settings)
• GoRouter intercepts deep links or navigation events, resolves to specific feature pages
• GetIt resolves service dependencies at runtime
Architectural Patterns and Design Principles
• Modular feature-based architecture (each major feature isolated under lib/features)
• MVVM-style separation: UI (Views) <→ Providers (ViewModels) <→ Services (Models/Data)
• Single Responsibility: each service handles one concern (API, storage, device info)
• Dependency injection for loose coupling and testability
Technologies and Frameworks to Annotate
• Flutter SDK and Engine
• Dart: language, models
• GoRouter: routing & deep links
• Provider: state management
• GetIt: DI container
• Shared Preferences (LocalStorage)
• HTTP (dart:io or http package)
• MERN API endpoint URLs
Detailed Elements to Capture
• Core service locator initialization (service_locator.dart)
• App router setup (app_router.dart) with feature route definitions
• Example feature flow: VideoFeedPage → VideosProvider → MediaService → ApiService → MERN/videos
• LocalStorage interactions in AuthService for token management
• DeviceInfoService usage for analytics or device-specific logic