# jillianyeow18/dormify_mobile-main-6 architecture

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

- Interactive diagram: https://gitdiagram.com/jillianyeow18/dormify_mobile-main-6
- Repository: https://github.com/jillianyeow18/dormify_mobile-main-6

## Overview

##### Main Components
- Mobile Frontend (Flutter UI): This corresponds to the majority of your code within the lib folder. It contains subdirectories for pages (auth_page, chat, home_page, tenant and landlord pages, etc.) and components (like custom widgets and UI elements).
- Domain & Business Logic: Under lib you have a clear separation with directories for domains and repositories (chat_repository, landlord_repository, tenant_repository, etc.). This layer encapsulates data models and business logic (domain objects like chat_message.domain, tenant.domain, etc.), which interact with the UI and services.
- Services: In the lib/services folder you see services such as auth_service, notificationService, and utilities for distance calculation and geocoordinates. These services abstract interactions with external systems (such as authentication and push notifications) and provide essential functionality.
- External Integrations: The project integrates Firebase (firebase.json, firebase_options.dart, and possibly cloudinary_service), implying external backend services for data storage, authentication, and possibly cloud media handling.
- Platform-Specific Mobile Code: The android and ios directories contain native configuration and platform-specific code (AndroidManifest.xml, build.gradle, AppDelegate.swift, storyboards). They serve as the bridge between Flutter and the underlying mobile OS.

##### Component Relationships and Interactions
- Platform code (android and ios directories) represents the hosting environment that executes the Flutter app. Show a boundary separating Flutter’s abstracted code (in lib) from native configuration and build systems.

##### Architectural Patterns & Technologies
- Use of the Repository Pattern: The separation between the repositories, domains, and UI indicates an effort to keep data access and business logic modular.
- Technologies: Mention Flutter as the framework for building the cross-platform mobile UI. Include Firebase as your backend/authentication service and note that platform-specific setup is handled separately in the android and ios directories.

– To the side or at the bottom, show external systems (Firebase, and potentially Cloudinary) that interact with the services.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer (Flutter UI)
    subgraph "Presentation Layer (Flutter UI)"
        U1("Pages"):::ui
        U2("Components"):::ui
        UI7("Main Entry"):::ui
        UI1("Auth Page"):::ui
        UI2("Chat Page"):::ui
        UI3("Home Page"):::ui
        UI4("Tenant Page"):::ui
        UI5("Landlord Page"):::ui
    end

    %% Service Layer
    subgraph "Service Layer"
        S1("Auth Service"):::services
        S2("Notification Service"):::services
        S3("Distance Calculator"):::services
        S4("Coordinates Service"):::services
        S5("Firebase Options"):::services
    end

    %% Domain & Business Logic
    subgraph "Domain & Business Logic"
        DM("Domain Models"):::domain
        subgraph "Repositories"
            R1("Chat Repository"):::domain
            R2("Landlord Repository"):::domain
            R3("Tenant Repository"):::domain
            R4("Property Repository"):::domain
            R5("Wishlist Repository"):::domain
        end
    end

    %% External Integrations
    subgraph "External Integrations"
        E1("Firebase"):::external
        E2("Cloudinary Service"):::external
    end

    %% Platform-Specific Mobile Code
    subgraph "Platform-Specific Mobile Code"
        P1("Android Configuration"):::platform
        P2("iOS Configuration"):::platform
    end

    %% Data Flow: UI to Services
    UI1 -->|"calls"| S1
    UI2 -->|"triggers"| S2
    UI3 -->|"calls"| S1
    UI4 -->|"calls"| S1
    UI5 -->|"calls"| S1
    U1 -->|"navigates"| S1
    U2 -->|"renders"| S1
    UI7 -->|"initializes"| S1

    %% Data Flow: Services to Domain & Business Logic
    S1 -->|"communicates"| DM
    S2 -->|"communicates"| DM
    S3 -->|"communicates"| DM
    S4 -->|"communicates"| DM
    S5 -->|"communicates"| DM

    %% Data Flow: Services Directly to External Integrations
    S1 -->|"authSync"| E1
    S2 -->|"pushNotify"| E1
    S5 -->|"firebaseConfig"| E1

    %% Data Flow: Domain & Business Logic to External Integrations
    DM -->|"dataStorage"| E1
    DM -->|"mediaOps"| E2

    %% Platform Integration: UI running on Native Platforms
    UI7 -->|"runsOn"| P1
    UI7 -->|"runsOn"| P2

    %% Click Events
    click U1 "https://github.com/jillianyeow18/dormify_mobile-main-6/tree/main/lib/pages"
    click U2 "https://github.com/jillianyeow18/dormify_mobile-main-6/tree/main/lib/components"
    click UI7 "https://github.com/jillianyeow18/dormify_mobile-main-6/blob/main/lib/main.dart"
    click R1 "https://github.com/jillianyeow18/dormify_mobile-main-6/blob/main/lib/data/chat_repository.dart"
    click R2 "https://github.com/jillianyeow18/dormify_mobile-main-6/blob/main/lib/data/landlord_repository.dart"
    click R3 "https://github.com/jillianyeow18/dormify_mobile-main-6/blob/main/lib/data/tenant_repository.dart"
    click R4 "https://github.com/jillianyeow18/dormify_mobile-main-6/blob/main/lib/data/property_repository.dart"
    click R5 "https://github.com/jillianyeow18/dormify_mobile-main-6/blob/main/lib/data/wishlist_repository.dart"
    click DM "https://github.com/jillianyeow18/dormify_mobile-main-6/tree/main/lib/domains"
    click S1 "https://github.com/jillianyeow18/dormify_mobile-main-6/blob/main/lib/services/auth_service.dart"
    click S2 "https://github.com/jillianyeow18/dormify_mobile-main-6/blob/main/lib/services/notificationService.dart"
    click S3 "https://github.com/jillianyeow18/dormify_mobile-main-6/blob/main/lib/services/calculate_distance.dart"
    click S4 "https://github.com/jillianyeow18/dormify_mobile-main-6/blob/main/lib/services/get_coordinates.dart"
    click S5 "https://github.com/jillianyeow18/dormify_mobile-main-6/blob/main/lib/services/firebase_options.dart"
    click E1 "https://github.com/jillianyeow18/dormify_mobile-main-6/blob/main/firebase.json"
    click E2 "https://github.com/jillianyeow18/dormify_mobile-main-6/blob/main/lib/data/cloudinary_service.dart"
    click P1 "https://github.com/jillianyeow18/dormify_mobile-main-6/tree/main/android"
    click P2 "https://github.com/jillianyeow18/dormify_mobile-main-6/tree/main/ios"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef services fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef domain fill:#FFD700,stroke:#000,stroke-width:2px;
    classDef external fill:#F08080,stroke:#000,stroke-width:2px;
    classDef platform fill:#D3D3D3,stroke:#000,stroke-width:2px;
```
