How felpower/projekt2_flutter_crush works
Project Type & Purpose
• This is primarily a Flutter application that appears to be a mobile game incorporating several “dark patterns” as part of its user experience. It integrates various services such as Firebase (for messaging, hosting, and deployment) and even includes a Unity module (the “unity/Match3” folder) likely to handle a Match3-style game component. In addition, there are several generator scripts (located in the generators directory) that are used for data extraction, error tracking, notifications, and statistics.
• The README also mentions mobile/web deployment (with instructions for both Android internal testing and Firebase web hosting) and hints at notifications testing through Firebase Cloud Messaging.
Analyzing the File Structure – Key Architectural Areas
• Platform-specific Code: Directories such as android, ios, linux, macos, and web indicate platform-specific builds and configurations. Each contains build files and platform adaptations.
• Unity Integration: There is a dedicated unity folder (and a nested “unity/Match3”) which contains Unity project files including scripts, prefabs, scenes, and plugins – indicating an integration of a Unity-based mini-game or component inside the Flutter app.
• Backend/Service Components: The lib/persistence directory and the lib/services directory show how data is stored (e.g., coins, levels, high scores) and how external services are integrated (Firebase messaging).
• Data Generators and Tools: The generators folder contains several Python scripts and JSON/Excel files to extract, generate, or analyze data such as levels, dark patterns feedback, and logs. This is a suite of CLI and scripting tools that support data management and game analytics.
• Continuous Integration/Deployment: The existence of .github/workflows and Firebase deployment scripts (firebase.json, etc.) shows automated pipelines for testing and deployment for both mobile builds and web.
a. Main Components to Include:
• Flutter Frontend: Represent the Flutter UI and logic (include main.dart, BLoC layers, and pages).
• Platform-Specific Bridges: Blocks for Android, iOS, Web, Linux, macOS showing that the core app has different deployment targets.
• Unity Module: A separate block that represents the Unity “Match3” component, possibly linked to a Flutter Unity integration controller (located in lib/controllers/unity).
• Firebase Services: A block showing integration with Firebase (messaging, hosting, and configuration via firebase_options.dart) and how notifications are handled.
• Data Generation & Analytics: A component showing the generators (Python scripts and associated data files) used for analytics, error logging, and level generation.
• External Services: If applicable, show communication with external services (for Firebase notifications or OAuth flows as mentioned).
b. Relationships & Interactions:
• How the Unity module is invoked via a dedicated Flutter controller (see lib/controllers/unity/unity_screen.dart) and how data flows back to the Flutter app.
• Demonstrate integration with Firebase services (e.g., messaging, hosting) and link the deployment pipelines from CI/CD (GitHub workflows).
• How asset resources are accessed and utilized by both the Flutter and Unity components.
• Interactions from backend services (Firebase, database exports in generators directory) which might feed analytics or dark patterns information into the app.
c. Architectural Patterns & Design Principles:
• Use of the BLoC architectural pattern for state management in Flutter (with separate blocs for game state, user state, dark patterns, and notifications).
• Modular design by segregating platform-specific configurations and the integration of a Unity module as a separate component.
• Clear separation between UI (pages, widgets), business logic (BLoC), data/model, and persistence (services).
d. Technologies & Frameworks:
• Flutter (with version 2.8.0) for the primary mobile application.
• Firebase for messaging, hosting, and backend services.
• Unity for the integrated Match3 game module.
• Python scripts and various generators for data processing.
• GitHub Actions for CI/CD workflows.
Putting It All Together
• Clarity in data flows and interactions, as this will aid not only in understanding the project architecture but also in future enhancements or debugging.