# foxriver-2005/airbnb-app architecture

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

- Interactive diagram: https://gitdiagram.com/foxriver-2005/airbnb-app
- Repository: https://github.com/foxriver-2005/airbnb-app

## Overview

##### Main Components Identification
- User Interface Components:
– Customer UI: Activities for login/registration, dashboard, profile, order details, room details, and map search.
– Owner UI: Activities for owner dashboard, property overview, order approval screens, and management screens (update info, add photos, etc.).
- Business Logic:
– Controllers (Activities/Fragments) that orchestrate user interactions.
– Adapters (e.g., ALLR.java, ApprovalAdapter.java, OrderAdapter.java, etc.) which support list views/recycler views.
– Helpers/Managers: Including SessionManager classes (for both customers and Airbnb-related sessions), FcmNotificationsSender for push notifications, etc.
- Data Models:
– Models folder containing representations for AirBnBs, Users, Orders, Ratings, Rooms, etc.
- Third-Party/External Services Integration:
– MPesa Subsystem: Classes under the “Mpesa” package (e.g., STKPush, STKPushService, DarajaApiClient, etc.) responsible for processing payments.
– Firebase Messaging: For push notifications to customers.
– Email Notification Services (as described in the README): For both customers and owners.
- Resource & Layout Management:
– Layouts, drawables, animations, and menus that define the visual structure and are used by Activities.
- Build & Configuration:
– Gradle build files and configuration files (e.g., google-services.json, proguard-rules.pro).

##### Directions for Diagramming
a. Component Breakdown:
– Use clear blocks/containers for each major module: UI Layer (split into Customer and Owner subsystems), Business Logic Layer, Data Models, and External Services.
– Represent each Activity as a node within the UI layer if needed. Group related Activities (e.g., registration flows, booking pages, payment screens) together.
– Create separate nodes for Adapters and Helpers showing their relationships with the Activities or fragments that use them.

b. Relationships & Interactions:
- From UI components (Activities) to helper classes (e.g., SessionManager) that manage session state.
- Connections from user actions (like a booking confirmation) to notification services (Firebase Messaging / Email notifications).
– Show interactions between customer and owner flows – for instance, booking requests created in the customer pathway that trigger the “Need Approval” view in the owner’s dashboard.

c. Architectural Patterns:
– Emphasize the separation of concerns. For example, the UI layer is solely responsible for presentation while business logic is encapsulated in controllers and adapters.
– Note any MVC/MVVM patterns if applicable (although the project structure mostly suggests an activity-controller approach with helper classes).
– Display integration points for third-party libraries (Firebase, MPesa) distinctly.

d. Technologies and Frameworks:

##### Detailing Essential Architectural Elements
– Specify the entry and exit points of the system (launching Activity, payment gateway integration points, notification dispatch).
– Include deployment-related details such as build scripts only as annotations if needed, though the primary focus remains on the in-app architecture.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Presentation Layer"
        CU["Customer UI Activities"]:::frontend
        OU["Owner UI Activities"]:::frontend
    end

    subgraph "Business Logic Layer"
        CA["Controllers & Adapters"]:::logic
        HM["Helpers & Managers"]:::logic
    end

    subgraph "Data & External Integrations"
        DM["Data Models"]:::data
        MP["MPesa Payment Integration"]:::external
        FB["Firebase Messaging Integration"]:::external
        GS["Google Services Config"]:::external
    end

    subgraph "Resources & Configuration"
        RL["Resource & Layout Management"]:::resource
        BC["Build & Config Files"]:::resource
    end

    CU -->|"triggers"| CA
    OU -->|"triggers"| CA
    CA -->|"uses"| HM
    CA -->|"manages"| DM
    HM -->|"syncs"| DM
    CA -->|"initiatesPayment"| MP
    CA -->|"sendsNotification"| FB
    GS -->|"feeds"| FB
    CU -->|"loadsLayouts"| RL
    OU -->|"loadsLayouts"| RL
    BC -->|"configures"| RL

    click CU "https://github.com/foxriver-2005/airbnb-app/tree/main/app/src/main/java/com/lelei/airbnb"
    click OU "https://github.com/foxriver-2005/airbnb-app/tree/main/app/src/main/java/com/lelei/airbnb"
    click CA "https://github.com/foxriver-2005/airbnb-app/tree/main/app/src/main/java/com/lelei/airbnb/Adapters"
    click HM "https://github.com/foxriver-2005/airbnb-app/tree/main/app/src/main/java/com/lelei/airbnb/Helpers"
    click DM "https://github.com/foxriver-2005/airbnb-app/tree/main/app/src/main/java/com/lelei/airbnb/Models"
    click MP "https://github.com/foxriver-2005/airbnb-app/tree/main/app/src/main/java/com/lelei/airbnb/Mpesa"
    click FB "https://github.com/foxriver-2005/airbnb-app/blob/main/app/src/main/java/com/lelei/airbnb/FirebaseMessagingService.java"
    click GS "https://github.com/foxriver-2005/airbnb-app/blob/main/app/google-services.json"
    click RL "https://github.com/foxriver-2005/airbnb-app/tree/main/app/src/main/res"
    click BC "https://github.com/foxriver-2005/airbnb-app/blob/main/app/build.gradle"

    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef logic fill:#98FB98,stroke:#333,stroke-width:2px;
    classDef data fill:#FFFACD,stroke:#333,stroke-width:2px;
    classDef external fill:#9370DB,stroke:#333,stroke-width:2px;
    classDef resource fill:#FFB6C1,stroke:#333,stroke-width:2px;
```
