# eat-ssu/android architecture

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

- Interactive diagram: https://gitdiagram.com/eat-ssu/android
- Repository: https://github.com/eat-ssu/android

## Overview

##### Project type and purpose
- This is a native Android mobile client (“Eat-SSU”) for campus cafeteria reviews.
- It follows MVVM + Clean Architecture: a single APK that consumes remote APIs, uses local prefs, and integrates with 3rd-party SDKs (Kakao OAuth, Firebase).

##### High-level layers and top-level directories
- Presentation (app/src/main/java/.../presentation): Activities, Fragments, ViewModels, UI components (XML+viewBinding & a small Compose sample)
- Domain (…/domain): business models, repository interfaces, use-cases (application logic)
- Data (…/data): DTOs, Retrofit service interfaces, repository implementations, SharedPreferences wrapper
- DI (…/di): Hilt modules (AppModule, NetworkModule, DataModule) and TokenInterceptor
- External/Infra: Retrofit2 + OkHttp3, Hilt, Coroutine+Flow, Firebase RemoteConfig & Crashlytics, Kakao OAuth SDK, local storage (MySharedPreferences)
- Tests, build scripts and proguard rules are ancillary

## Diagram (Mermaid)

```mermaid
graph TB
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        UI["Activities & Fragments"]:::presentation
        VM_Main["MainViewModel"]:::presentation
        VM_Login["LoginViewModel"]:::presentation
        VM_Review["ReviewViewModel"]:::presentation
    end

    %% Domain Layer
    subgraph "Domain Layer"
        direction TB
        Models["Domain Models"]:::domain
        Repo_Interface["Repository Interfaces"]:::domain
        UseCases["Use-Cases"]:::domain
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        DTOs["DTOs"]:::data
        Services["Retrofit Services"]:::data
        Repo_Impl["Repository Implementations"]:::data
        Prefs["MySharedPreferences"]:::data
    end

    %% DI Layer
    subgraph "DI (Hilt Modules)"
        direction TB
        AppModule["AppModule"]:::infra
        NetworkModule["NetworkModule"]:::infra
        DataModule["DataModule"]:::infra
        TokenInterceptor["TokenInterceptor"]:::infra
    end

    %% External & Infra
    subgraph "External / Infra"
        direction TB
        RetrofitClient["Retrofit2 + OkHttp3"]:::infra
        BackendAPI["Backend REST API"]:::external
        KakaoSDK["Kakao OAuth SDK"]:::external
        FirebaseRC["Firebase RemoteConfig"]:::external
        Crashlytics["Firebase Crashlytics"]:::external
    end

    %% Connections
    UI -->|"calls"| VM_Main
    UI --> VM_Login
    UI --> VM_Review
    VM_Main -->|"execute()"| UseCases
    VM_Login --> UseCases
    VM_Review --> UseCases
    UseCases -->|"invoke()"| Repo_Interface
    Repo_Interface --> Repo_Impl
    Repo_Impl --> Services
    Repo_Impl --> Prefs
    Repo_Impl --> FirebaseRC
    Services --> RetrofitClient
    RetrofitClient --> TokenInterceptor
    TokenInterceptor --> BackendAPI
    FirebaseRC --> Crashlytics
    VM_Main -->|"UiState Flow"| UI
    VM_Login -->|"UiState Flow"| UI
    VM_Review -->|"UiState Flow"| UI

    %% Click Events
    click UI "https://github.com/eat-ssu/android/tree/develop/app/src/main/java/com/eatssu/android/presentation"
    click VM_Main "https://github.com/eat-ssu/android/blob/develop/app/src/main/java/com/eatssu/android/presentation/main/MainViewModel.kt"
    click VM_Login "https://github.com/eat-ssu/android/blob/develop/app/src/main/java/com/eatssu/android/presentation/login/LoginViewModel.kt"
    click VM_Review "https://github.com/eat-ssu/android/blob/develop/app/src/main/java/com/eatssu/android/presentation/review/list/ReviewViewModel.kt"
    click Models "https://github.com/eat-ssu/android/tree/develop/app/src/main/java/com/eatssu/android/domain/model"
    click Repo_Interface "https://github.com/eat-ssu/android/tree/develop/app/src/main/java/com/eatssu/android/domain/repository"
    click UseCases "https://github.com/eat-ssu/android/tree/develop/app/src/main/java/com/eatssu/android/domain/usecase"
    click DTOs "https://github.com/eat-ssu/android/tree/develop/app/src/main/java/com/eatssu/android/data/dto"
    click Services "https://github.com/eat-ssu/android/tree/develop/app/src/main/java/com/eatssu/android/data/service"
    click Repo_Impl "https://github.com/eat-ssu/android/tree/develop/app/src/main/java/com/eatssu/android/data/repository"
    click Prefs "https://github.com/eat-ssu/android/blob/develop/app/src/main/java/com/eatssu/android/data/MySharedPreferences.kt"
    click AppModule "https://github.com/eat-ssu/android/blob/develop/app/src/main/java/com/eatssu/android/di/AppModule.kt"
    click NetworkModule "https://github.com/eat-ssu/android/blob/develop/app/src/main/java/com/eatssu/android/di/NetworkModule.kt"
    click DataModule "https://github.com/eat-ssu/android/blob/develop/app/src/main/java/com/eatssu/android/di/DataModule.kt"
    click TokenInterceptor "https://github.com/eat-ssu/android/blob/develop/app/src/main/java/com/eatssu/android/di/network/TokenInterceptor.kt"
    click RetrofitClient "https://github.com/eat-ssu/android/blob/develop/app/src/main/java/com/eatssu/android/data/RetrofitImpl.kt"
    click KakaoSDK "https://github.com/eat-ssu/android/blob/develop/app/src/main/java/com/eatssu/android/presentation/login/UserApiClient.kt"
    click FirebaseRC "https://github.com/eat-ssu/android/blob/develop/app/src/main/res/xml/firebase_remote_config.xml"
    click Crashlytics "https://github.com/eat-ssu/android/blob/develop/app/proguard-rules.pro"

    %% Styles
    classDef presentation fill:#e0f7fa,stroke:#006064,color:#006064
    classDef domain fill:#e8f5e9,stroke:#2e7d32,color:#2e7d32
    classDef data fill:#fff3e0,stroke:#ef6c00,color:#e65100
    classDef infra fill:#eceff1,stroke:#455a64,color:#37474f
    classDef external fill:#f3e5f5,stroke:#6a1b9a,color:#4a148c
```
