How bizz84/flutter_ship_app works
Project Type & Purpose
• This is a Flutter-based companion mobile and web application designed as part of a course on “Flutter in production.”
• The purpose is to demonstrate production-level practices such as handling multiple flavors (dev, stg, prod), integrating Firebase (for analytics and remote config), Sentry, Mixpanel, and proper error reporting along with components for in-app reviews and forced updates.
• The project showcases a full-stack client application that spans multiple deployment targets (Android, iOS, and Web) with clear environment configurations.
Analyzing the File Structure
• Top-level directories include:
• Android, iOS, and Web: Containing platform-specific configurations, assets, and build settings.
• lib: The core source code, subdivided into folders like src (containing subdirectories for presentation, data, domain, and monitoring), app_routes, and environment configurations.
• Assets and maestro: Additional assets and scripts (for screenshots, for instance).
• The flavor-specific files (e.g., main_dev.dart, main_stg.dart, main_prod.dart) and environment directories (lib/env) indicate support for separate configurations.
• Integration points for external services are evident through the usage of Firebase, Sentry, Mixpanel, and a local SQLite database via Drift.
A. Application Layers:
• Presentation Layer:
• Represented by the UI components/screens within lib/src/presentation (apps list screen, create/edit screens, settings, etc.).
• Domain Layer:
• Contains business logic and domain models (see lib/src/domain like app, epic, task).
• Data Layer:
• Includes local database management using Drift (lib/src/data), API clients, and remote configuration.
• Separate modules for database CRUD operations, connection handling (native, web, unsupported), and external APIs (like gist_client) should be noted here.
• Monitoring & Analytics:
• This module encompasses ab_testing, analytics clients (Firebase Analytics, Mixpanel, custom logger interceptors), and error logging (Sentry integration).
• It shows how errors and usage statistics are collected and transmitted.
• Utility & Configuration:
• Mechanism that loads .env files and uses flutterfire-config.
B. Platform-Specific Components:
• Mobile Platforms:
• Web Platform:
• Web folder which includes the Drift web worker, manifests, and index.html to indicate the web target.
C. External Services & Integrations:
• Firebase:
• Firebase analytics and remote config integration.
• Sentry & Mixpanel:
• As external monitoring and analytics services.
• That configuration for these is provided through environment variables (.env files).
• App Store / In-App Review:
• Identifiers for store configuration and integration of packages such as force_update_helper and in_app_review.
D. Flavors and Environment Configuration:
• That these configurations affect everything from Firebase and API endpoints to Sentry/Mixpanel keys.
E. Build and CI/CD Pipeline:
• Fastlane (for iOS/Android) and any automated tasks (like screenshot scripts in the maestro directory).
Relationships & Data Flow
• From user interaction in the Presentation layer to the Domain layer for business logic processing.
• From the Domain to the Data layer where local storage (Drift) and API calls reside.
• From the Data layer to external services (Firebase, Sentry, Mixpanel) via analytics and error reporting components.
• That environment configuration (.env and flavor files) affects all modules by providing configuration keys.
• Clearly label interactions such as “User Actions”, “Business Logic Processing”, “Data Persistence”, “Remote Config Fetch”, “Analytics Logging”, and “Error Reporting”.
Final Recommendations
• Be as detailed as possible in integrating every major aspect of the codebase: from UI components to data management, environment controls, and external integrations.