How paulononaka/flutter_firebase_auth_firestore works
Main components
• Mobile App (Flutter): This includes presentation, business logic, and state management. The Flutter app uses features such as Flutter Bloc for state management, GetIt for dependency injection, Freezed for immutable objects, and integrates with Firebase services (Firebase Authentication, Firestore, and Push Notifications). The source code is structured mainly in the “app/lib” directory (components, pages, design system, models, navigation, network) and supports platform-specific builds for Android and iOS.
• Server Backend: Implemented using NestJS, the server handles logic such as REST calls and push notifications (via Firebase integration) and deals with order management, STI_STD functionality, and cloud functions. This is visible from the “server” folder which contains controllers, services, DTOs, and models.
• Firebase Services: These are used both by the mobile app (e.g., authentication and push notifications) and by the server (to trigger cloud functions / scheduled functions on GCP).
• External Services: Like Google Cloud Functions, REST endpoints, and any external APIs called by the REST client in the Flutter app.
File structure and architectural choices
• In the Flutter app:
• The “app/lib” directory clearly separates design system components and tokens (a pattern indicating strong design guidelines).
• There are dedicated directories for different pages and features (like sign in, sign up, home, order, profile, test_details, tests, and welcome); this denotes a decomposed UI/feature-based structure.
• The “di” (dependency injection) directory and “network” (REST client) support modularity and separation of concerns.
• The Flutter project supports different flavors/environments by having “main_prod.dart” and “main_local.dart”.
• In the Server:
• Your server folder follows a modular pattern with feature directories (“orders”, “sti_std”, and “firebase”) and uses a typical NestJS directory layout (controllers, services, modules).
• Configuration files like “tsconfig.json” and “nest-cli.json” define build and run parameters for the backend.
Important architectural notes to capture
• Separation of concerns – the mobile app handles presentation and user interactions (front-end) while the backend manages business logic, data processing, and external integrations.
• Use of Flutter Bloc and dependency injection, showing how state flows and data flows from user interactions to backend calls.
• For the server, note that NestJS’s modular architecture (controllers and services) ensures clear boundaries and testability.
Final assembly
User Interaction → Flutter App (UI and Business Logic via Bloc) → REST Client → Server (NestJS Modules)
Additionally, show side connections between Flutter App and Firebase for direct integrations, while the Server may also interact with Firebase for tasks like push notifications.