# phmarcel0x/amicae architecture

> Architecture diagram of the GitHub repository phmarcel0x/amicae, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/phmarcel0x/amicae
- Repository: https://github.com/phmarcel0x/amicae

## Overview

##### Main Components
- Mobile Client (Flutter App):
- Cross-platform mobile application with separate deployments for Android and iOS (visible in the “android” and “ios” directories).
- Modules from the “lib” directory: authentication, login, home (with swipe feature), profile, events, and user account setup.
- External Services & Backend:
- Firebase integration which is indicated by files such as firebase.json, firebase_rules.json, and lib/firebase_options.dart.
- Although the project appears to be mostly client-side, Firebase acts as your backend service, handling authentication, database storage, and potentially real-time event data.
- Assets & Configuration:
- Assets (logo, temporary avatars) and configuration files (like google-services.json in Android) that help customize the user experience and integrate with external services.
- Testing and Development Tools:
- A section or note for testing (found in the “test” folder) and development configurations (e.g., analysis_options.yaml, devtools_options.yaml).

##### Out the Relationships and Interactions
- Within the Mobile Client:
- Communication Flow:
- Integration with Native Code:

##### Architectural Patterns and Design Principles
- Modular Design:
- Separation of Concerns:
- That UI components (pages/widgets) are separated from business logic and service layers.
- Firebase as a Backend-Service:
- Firebase’s role in providing authentication, real-time database, and hosting (if applicable) services, making it a crucial external component in the architecture.

##### Relevant Technologies and Frameworks
- Flutter for Cross-Platform Mobile Development (the “lib” folder holds Dart code for the business logic and UI).
- Firebase for backend services, managed via the Firebase configuration and rules files.
- Native Platform Code:
- Android: Kotlin files, Gradle build scripts.
- iOS: Swift files, Xcode project files.
- Testing: Leverage the “test” directory for unit testing various modules.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Mobile Client Layer
    subgraph "Mobile Client - Flutter App"
        direction TB
        FlutterApp["Flutter App (UI & Business Logic)"]:::mobile
        subgraph "Feature Modules"
            direction TB
            AuthModule["Authentication Module"]:::module
            LoginModule["Login Module"]:::module
            HomeModule["Home Module with Swipe Feature"]:::module
            SwipeFeature["Swipe Feature (Home)"]:::module
            ProfileModule["Profile Module"]:::module
            UserAccountSetup["User Account Setup Module"]:::module
            PeopleModule["People Module"]:::module
        end
    end

    %% External Services Layer
    subgraph "External Services"
        direction TB
        FirebaseBackend["Firebase Backend (Auth, DB, Real-time)"]:::external
    end

    %% Native Platform Integration
    subgraph "Native Platform Integration"
        direction TB
        AndroidNative["Android Native Code"]:::native
        iOSNative["iOS Native Code"]:::native
    end

    %% Assets & Configuration
    subgraph "Assets & Configuration"
        direction TB
        AssetsConfig["Assets & Config Files"]:::assets
    end

    %% Testing & Development Tools
    subgraph "Testing & Dev Tools"
        direction TB
        TestingTools["Testing (Unit, Integration)"]:::testing
    end

    %% Connections within Mobile Client
    FlutterApp -->|"UIflow"| LoginModule
    FlutterApp -->|"UIflow"| HomeModule
    FlutterApp -->|"UIflow"| ProfileModule
    FlutterApp -->|"UIflow"| AuthModule
    FlutterApp -->|"UIflow"| UserAccountSetup
    FlutterApp -->|"UIflow"| PeopleModule

    %% Internal module connection for Home swipe feature
    HomeModule -->|"includes"| SwipeFeature

    %% Service to External Services communication
    AuthModule -->|"callsFirebase"| FirebaseBackend
    LoginModule -->|"callsFirebase"| FirebaseBackend
    HomeModule -->|"callsFirebase"| FirebaseBackend
    SwipeFeature -->|"callsFirebase"| FirebaseBackend
    ProfileModule -->|"callsFirebase"| FirebaseBackend
    UserAccountSetup -->|"callsFirebase"| FirebaseBackend

    %% Native integration with Flutter App
    FlutterApp -->|"bridgesTo"| AndroidNative
    FlutterApp -->|"bridgesTo"| iOSNative

    %% Assets usage
    FlutterApp -->|"usesAssets"| AssetsConfig

    %% Testing connection
    FlutterApp -->|"testedBy"| TestingTools

    %% Click Events for Component Mappings
    click FlutterApp "https://github.com/phmarcel0x/amicae/blob/main/lib/main.dart"
    click AuthModule "https://github.com/phmarcel0x/amicae/blob/main/lib/features/authentication/services/auth_service.dart"
    click LoginModule "https://github.com/phmarcel0x/amicae/blob/main/lib/features/login/pages/landing_page.dart"
    click HomeModule "https://github.com/phmarcel0x/amicae/blob/main/lib/features/home/home.dart"
    click SwipeFeature "https://github.com/phmarcel0x/amicae/blob/main/lib/features/home/swipeFeature/home_page.dart"
    click ProfileModule "https://github.com/phmarcel0x/amicae/blob/main/lib/features/profile/profile_page.dart"
    click UserAccountSetup "https://github.com/phmarcel0x/amicae/tree/main/lib/features/user_account_set_up"
    click FirebaseBackend "https://github.com/phmarcel0x/amicae/blob/main/firebase.json"
    click AssetsConfig "https://github.com/phmarcel0x/amicae/tree/main/assets/logo"
    click AndroidNative "https://github.com/phmarcel0x/amicae/blob/main/android/app/src/main/kotlin/com/example/amicae/MainActivity.kt"
    click iOSNative "https://github.com/phmarcel0x/amicae/blob/main/ios/Runner/AppDelegate.swift"
    click TestingTools "https://github.com/phmarcel0x/amicae/tree/main/test"

    %% Styles
    classDef mobile fill:#F7D6E0,stroke:#C2185B,stroke-width:2px;
    classDef module fill:#FFF3E0,stroke:#FB8C00,stroke-width:2px;
    classDef external fill:#E1F5FE,stroke:#0288D1,stroke-width:2px;
    classDef native fill:#E8F5E9,stroke:#43A047,stroke-width:2px;
    classDef assets fill:#F1F8E9,stroke:#7CB342,stroke-width:2px;
    classDef testing fill:#F3E5F5,stroke:#8E24AA,stroke-width:2px;
```
