# team-wable/wable-android architecture

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

- Interactive diagram: https://gitdiagram.com/team-wable/wable-android
- Repository: https://github.com/team-wable/wable-android

## Overview

##### Project Type and Purpose
- Wable is an Android full-stack mobile application, built in Kotlin with Jetpack Compose.
- It provides a community platform for supporting teams and players without harassment, featuring login, feed, news, notifications, profile, posting, and “view-it” functionalities.
- It follows official Android architecture guidance and a modularization strategy: a single “app” runner module, multiple feature modules, and shared “core” libraries.

##### File-Structure Analysis
- Top-Level Modules
- app: the Android application entry, Gradle config, manifest, Proguard, Firebase messaging service.
- build-logic: custom Gradle convention plugins (AndroidApplicationPlugin, HiltPlugin, RetrofitPlugin, etc.) and version catalog.
- core/**: shared libraries:
– common: MVVM base classes, DI qualifiers, utilities, resources
– data: repository interfaces, mappers, implementations, ContentResolver utils
– datastore: local Preferences DataStore module
– designsystem: reusable UI components and theme definitions
– domain: pure business-logic use cases (unit tested)
– model: data classes shared across layers
– navigation: NavHost graph types and helpers
– network: Retrofit services, interceptors, DTOs, paging source
– ui: base fragments, UI components, adapters, navigation ext
- feature/**: feature-specific modules for auth, community, home, main-compose, main, news, notification, onboarding, posting, profile, viewit.
- config files: settings.gradle.kts, libs.versions.toml, project.dot (for dependency graph), CI workflows.

##### README Insights
- Architecture: MVVM + Clean Architecture.
- Modularization: clear boundary between “app,” “feature” modules, and “core” libraries.
- Tech stack: Hilt for DI, Retrofit + Coroutines/Flow for networking, DataStore for caching, Jetpack Compose + Navigation + Paging + Material 3 for UI, custom Gradle conventions.

a. Main Components
- App Module: AndroidApplication, FirebaseMessagingService, DI entry point (Hilt).
- Feature Modules (Auth, Community, Home, News, Notification, Posting, Profile, ViewIt, Onboarding, MainCompose, Main)
- Core Libraries:
- UI & DesignSystem (Compose components, theme)
- Navigation (NavHost graphs)
- Domain (UseCases)
- Data (Repositories, Mappers)
- Network (Retrofit services, DTOs)
- Datastore (Preferences)
- Common (Base classes, utilities)
- External Services: REST API endpoints, Firebase Cloud Messaging, local DataStore
b. Relationships & Data Flow
- Features request data via Domain use cases → Data layer (Repository interface) → Network or Datastore
- Network calls made via Retrofit services → parsed into DTOs → mapped to domain/model classes
- Datastore (DataStoreModule) provides local key-value storage for prefs
- DI (Hilt) injects modules into features and core
- UI (Compose or Fragments) binds to ViewModel (inherits BaseViewModel) and observes StateFlow for states and side effects
- Navigation graphs orchestrate fragment/compose screen transitions
- FirebaseMessagingService receives push messages and routes into the app
c. Architectural Patterns
- Clean Architecture layers (UI → Domain → Data → Network / Datastore)
- MVVM with StateFlow & SideEffect pattern
- Feature Modules encapsulate UI + ViewModel + Navigation + DI bindings
- Shared Core modules enforce consistency and avoid duplication
- Custom Gradle convention plugins ensure uniform build settings
d. Key Technologies & Frameworks
- Jetpack Compose & Navigation
- Retrofit + Kotlin Coroutines / Flow
- DataStore (Preferences)
- Hilt for DI
- Paging 3 for list pagination
- Material 3 design system
- JsoupParser for HTML parsing in Data layer
- Custom Gradle Version Catalog + Convention Plugins

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% App Module
    subgraph "App Module"
        direction TB
        WApp["WableApp\n(Application)"]:::app
        WFMS["WableFirebaseMessagingService\n(Service)"]:::app
        AManifest["AndroidManifest.xml"]:::app
        AGradle["app/build.gradle.kts"]:::app
    end

    %% Feature Modules
    subgraph "Feature Modules"
        direction TB
        Auth["Auth Module"]:::feature
        Onboarding["Onboarding Module"]:::feature
        MainCompose["Main-Compose Module"]:::feature
        Main["Main Module"]:::feature
        Home["Home Module"]:::feature
        Community["Community Module"]:::feature
        News["News Module"]:::feature
        Notification["Notification Module"]:::feature
        Posting["Posting Module"]:::feature
        Profile["Profile Module"]:::feature
        ViewIt["ViewIt Module"]:::feature
    end

    %% Core Libraries
    subgraph "Core Libraries"
        direction TB
        subgraph "common"
            direction TB
            BaseVM["BaseViewModel"]:::common
            Qualifier["Qualifier"]:::common
            GetThrowable["GetThrowableMessage"]:::common
        end
        subgraph "data"
            direction TB
            AuthRepo["AuthRepository"]:::data
            AuthMapper["AuthMapper"]:::data
            RepoModule["RepositoryModule"]:::data
            JsoupParser["JsoupParser"]:::data
        end
        subgraph "datastore"
            direction TB
            PrefDS["DefaultWablePreferenceDatasource"]:::datastore
            DSModule["DataStoreModule"]:::datastore
        end
        subgraph "designsystem"
            direction TB
            WButton["WableButton"]:::design
            Theme["Theme"]:::design
        end
        subgraph "domain"
            direction TB
            CommunityUC["GetSortedCommunityListUseCase"]:::domain
        end
        subgraph "model"
            direction TB
            UserModel["UserModel"]:::model
            FeedModel["Feed"]:::model
        end
        subgraph "navigation"
            direction TB
            Route["Route"]:::nav
            NavType["ParcelableNavType"]:::nav
        end
        subgraph "network"
            direction TB
            AuthService["AuthService"]:::network
            ServiceModule["ServiceModule"]:::network
            SocialDto["ResponseSocialLoginDto"]:::network
        end
        subgraph "ui"
            direction TB
            BindingFrag["BindingFragment"]:::ui
            FeedAdapter["FeedAdapter"]:::ui
            NavExt["NavigationExt"]:::ui
        end
    end

    %% External Systems
    subgraph "External Systems"
        direction TB
        REST["REST API"]:::external
        FCM["Firebase Cloud Messaging"]:::external
        LocalDS["Preferences DataStore"]:::external
    end

    %% Build Logic
    subgraph "Build Logic"
        direction TB
        Plugins["Convention Plugins"]:::build
    end

    %% Dependencies
    WApp -->|uses| WFMS
    WApp -->|entry| Auth
    WApp -->|entry| Onboarding
    WApp -->|entry| MainCompose
    WApp -->|entry| Main
    Auth -->|injects| BaseVM
    Onboarding -->|injects| BaseVM
    MainCompose -->|injects| BaseVM
    Main -->|injects| BaseVM
    Home -->|injects| BaseVM
    Community -->|injects| BaseVM
    News -->|injects| BaseVM
    Notification -->|injects| BaseVM
    Posting -->|injects| BaseVM
    Profile -->|injects| BaseVM
    ViewIt -->|injects| BaseVM

    %% Feature to Core
    Auth -->|calls| AuthRepo
    AuthRepo -->|uses| AuthService
    AuthService -->|calls| REST
    AuthRepo -->|maps| AuthMapper
    Community -->|calls| CommunityUC
    CommunityUC -->|uses| AuthRepo
    Home -->|calls| CommunityUC
    CommunityUC -->|uses| PrefDS
    PrefDS -->|stores| LocalDS
    AnyFeature[(Any Feature)] -->|navigation| Route
    AnyFeature -->|navigation| NavType

    WFMS -->|receives| FCM

    %% Build Logic effect
    Plugins -.->|configure| WApp
    Plugins -.->|configure| Auth
    Plugins -.->|configure| Community
    Plugins -.->|configure| data
    Plugins -.->|configure| network

    %% Click Events
    click WApp "https://github.com/team-wable/wable-android/blob/develop/app/src/main/java/com/teamwable/wable/WableApp.kt"
    click WFMS "https://github.com/team-wable/wable-android/blob/develop/app/src/main/java/com/teamwable/wable/service/WableFirebaseMessagingService.kt"
    click AManifest "https://github.com/team-wable/wable-android/blob/develop/app/src/main/AndroidManifest.xml"
    click AGradle "https://github.com/team-wable/wable-android/blob/develop/app/build.gradle.kts"
    click Plugins "https://github.com/team-wable/wable-android/blob/develop/build-logic/src/main/java/com/teamwable/wable/plugin/AndroidApplicationPlugin.kt"
    click BaseVM "https://github.com/team-wable/wable-android/blob/develop/core/common/src/main/java/com/teamwable/common/base/BaseViewModel.kt"
    click Qualifier "https://github.com/team-wable/wable-android/blob/develop/core/common/src/main/java/com/teamwable/common/di/Qualifier.kt"
    click GetThrowable "https://github.com/team-wable/wable-android/blob/develop/core/common/src/main/java/com/teamwable/common/util/GetThrowableMessage.kt"
    click AuthRepo "https://github.com/team-wable/wable-android/blob/develop/core/data/src/main/java/com/teamwable/data/repository/AuthRepository.kt"
    click AuthMapper "https://github.com/team-wable/wable-android/blob/develop/core/data/src/main/java/com/teamwable/data/mapper/toModel/AuthMapper.kt"
    click RepoModule "https://github.com/team-wable/wable-android/blob/develop/core/data/src/main/java/com/teamwable/data/di/RepositoryModule.kt"
    click JsoupParser "https://github.com/team-wable/wable-android/blob/develop/core/data/src/main/java/com/teamwable/data/util/JsoupParser.kt"
    click PrefDS "https://github.com/team-wable/wable-android/blob/develop/core/datastore/src/main/java/com/teamwable/datastore/datasource/DefaultWablePreferenceDatasource.kt"
    click DSModule "https://github.com/team-wable/wable-android/blob/develop/core/datastore/src/main/java/com/teamwable/datastore/di/DataStoreModule.kt"
    click WButton "https://github.com/team-wable/wable-android/blob/develop/core/designsystem/src/main/java/com/teamwable/designsystem/component/button/WableButton.kt"
    click Theme "https://github.com/team-wable/wable-android/blob/develop/core/designsystem/src/main/java/com/teamwable/designsystem/theme/Theme.kt"
    click CommunityUC "https://github.com/team-wable/wable-android/blob/develop/core/domain/src/main/java/com/teamwable/domain/usecase/GetSortedCommunityListUseCase.kt"
    click UserModel "https://github.com/team-wable/wable-android/blob/develop/core/model/src/main/java/com/teamwable/model/auth/UserModel.kt"
    click FeedModel "https://github.com/team-wable/wable-android/blob/develop/core/model/src/main/java/com/teamwable/model/home/Feed.kt"
    click Route "https://github.com/team-wable/wable-android/blob/develop/core/navigation/src/main/java/com/teamwable/navigation/Route.kt"
    click NavType "https://github.com/team-wable/wable-android/blob/develop/core/navigation/src/main/java/com/teamwable/navigation/ParcelableNavType.kt"
    click AuthService "https://github.com/team-wable/wable-android/blob/develop/core/network/src/main/java/com/teamwable/network/datasource/AuthService.kt"
    click ServiceModule "https://github.com/team-wable/wable-android/blob/develop/core/network/src/main/java/com/teamwable/network/di/ServiceModule.kt"
    click SocialDto "https://github.com/team-wable/wable-android/blob/develop/core/network/src/main/java/com/teamwable/network/dto/response/auth/ResponseSocialLoginDto.kt"
    click BindingFrag "https://github.com/team-wable/wable-android/blob/develop/core/ui/src/main/java/com/teamwable/ui/base/BindingFragment.kt"
    click FeedAdapter "https://github.com/team-wable/wable-android/blob/develop/core/ui/src/main/java/com/teamwable/ui/shareAdapter/FeedAdapter.kt"
    click NavExt "https://github.com/team-wable/wable-android/blob/develop/core/ui/src/main/java/com/teamwable/ui/extensions/NavigationExt.kt"

    %% Styles
    classDef app fill:#cce5ff,stroke:#3399ff,color:#000000;
    classDef feature fill:#e6f7ff,stroke:#66b2ff,color:#000000;
    classDef common fill:#e6ffe6,stroke:#33cc33,color:#000000;
    classDef data fill:#fff0e6,stroke:#ff9933,color:#000000;
    classDef datastore fill:#fff0f0,stroke:#ff6666,color:#000000;
    classDef design fill:#e6e6ff,stroke:#6666ff,color:#000000;
    classDef domain fill:#e6ffe6,stroke:#33cc33,color:#000000;
    classDef model fill:#f2e6ff,stroke:#9933ff,color:#000000;
    classDef nav fill:#f0f0f0,stroke:#999999,color:#000000;
    classDef network fill:#f9e6ff,stroke:#cc33cc,color:#000000;
    classDef ui fill:#ffffe6,stroke:#cccc33,color:#000000;
    classDef external fill:#f2f2f2,stroke:#b3b3b3,color:#000000;
    classDef build fill:#e6e6e6,stroke:#7a7a7a,color:#000000;
```
