How mahm0udbakir/pet-paw works
Project Type & Purpose
• This is a full-stack, multi-platform Flutter application (“pet-paw”) targeting Android, iOS, Web, Windows, macOS, and Linux.
• It provides pet-related user flows: onboarding, authentication (signup/login), pet profile creation, password reset, and theming/localization.
• Although there’s a placeholder “backend” folder, the actual backend appears to be provided by external services (Firebase Auth/Firestore/Storage or a custom REST API).
High-Level File Structure Analysis
• Top-level:
– Flutter/pet_paw: root of the Flutter project
– backend: empty placeholder, likely used to store server code if migrated in-repo
• Flutter/pet_paw/lib:
– app.dart & main.dart: application entry points, initial route to splash and onboarding
– app/core: configuration (api_config, token_storage), utils (theme, constants, exceptions, helpers)
– app/domain: state management using Cubit (Bloc) for language & theme
– app/features: feature modules following MVC or MVVM-style separation
· auth (login, signup, create pet profile)
· onboarding_and_getstarted
· reset_new_password
– localization: internationalization via ARB files and generated code
• Platform folders: android, ios, macos, windows, linux, web – containing platform-specific build files, plugin registrants, assets, and manifests
• Configuration: firebase.json, google-services.json indicating Firebase integration, CI workflow (deploy.yml)
Key Architecture & Technology Insights
• Presentation Layer: Flutter UI widgets organized by feature under lib/app/features/*/view and shared common widgets in app/common
• State Management (Domain): Cubit (Bloc) per feature to manage state and side effects
• Core Layer: Configuration (API base URL, token storage), shared utilities (exception mapping, theming, validation)
• Data Layer: Implicit – network calls (REST or Firebase SDK) invoked inside Cubit controllers; persistent token via token_storage
• External Services:
– Firebase Auth for signup/login/password reset
– Cloud Firestore / Realtime Database for user/pet data persistence
– Cloud Storage for pet images
– Potential custom REST API if using api_config
a. Main Components
• Flutter App (multi-platform)
– Presentation (Screens & Widgets)
– State Management (Cubit controllers)
– Core Utilities & Config
• External Services
– Auth Service (Firebase Auth or custom API)
– Data Service (Firestore / REST API)
– Storage Service (Cloud Storage)
• Backend (optional custom microservice in “backend” folder)
• Third-party / Platform plugins (Google sign-in, Camera, Local storage)
b. Relationships & Data Flow
1. User interacts with Presentation Layer → triggers Cubit event
2. Cubit invokes Data/Service layer via configured API client or Firebase SDK
3. Service layer communicates over HTTPS/SDK to Auth/Data/Storage services
4. Results/emitted states propagate back to Cubit → UI updates
c. Architectural Patterns & Principles
• Feature-based modularization: each feature has its own view, controller (Cubit), model
• Layered architecture: Presentation → Domain (Cubit) → Data/Service → External
• Dependency injection/configuration via api_config & token_storage
• Separation of concerns: theming, localization, utilities kept in core
d. Relevant Technologies & Libraries
• Flutter (Dart) multi-platform framework
• Bloc (Cubit) for state management
• Firebase SDK (Auth, Firestore, Storage) or Dio/Chopper for REST
• intl for localization
• FVM for Flutter version management
• Platform-specific build systems (Gradle, Xcode, CMake)