# florent37/movie_android_flutter architecture

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

- Interactive diagram: https://gitdiagram.com/florent37/movie_android_flutter
- Repository: https://github.com/florent37/movie_android_flutter

## Overview

##### Project type and purpose
- This is a cross-platform mobile sample:
- A native Android (Kotlin + MVVM) version under `android/`
- A Flutter version (Dart + Provider/MVVM-style) with Android and iOS targets under `flutter/`
- Its sole purpose is to let users search movies via the external OMDB API and display results.

##### File structure
- Two parallel modules:
- `android/app/src/main/java/com/github/florent37/mvvmsample/`
– `search/` contains UI (Fragment, Adapter), ViewModel, ViewState
– `omdb/` contains Movie models, OMDBApi interface, Repository
- `flutter/lib/` mirrors the same layering:
– `search/`: SearchPage, ViewModel, ViewState
– `omdb/`: Repository, models
- Build and config files: `build.gradle`, `pubspec.yaml`, Gradle and Xcode project files.
- No backend hosted here; it’s a pure client calling an external REST service.

##### README
- Confirms two implementations, used in a Medium article.

##### Detailed breakdown suggestion
- Inside:
– UI Layer: MainActivity/Fragment → MoviesAdapter
– VM Layer: SearchViewModel
– Repo Layer: OmdbRepository + OMDBApi (Retrofit interface)
- Inside:
– UI Layer: SearchPage (StatefulWidget)
– VM Layer: SearchViewModel (ChangeNotifier)
– Repo Layer: OmdbRepository + HTTP client
- Cloud: OMDB REST API (with base URL and endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Native Android Module
    subgraph "Native Android Module"
        direction TB
        MApp["MainApplication"]:::ui
        MA["MainActivity"]:::ui
        SF["SearchFragment"]:::ui
        MAda["MoviesAdapter"]:::ui
        SVM["SearchViewModel"]:::vm
        SVS["SearchViewState"]:::vm
        RepoAnd["OmdbRepository"]:::repo
        APIAnd["OMDBApi"]:::repo
        MovAnd["Movie"]:::model
        RespAnd["SearchResponse"]:::model
    end

    %% Flutter Module
    subgraph "Flutter Module"
        direction TB
        MFD["main.dart"]:::ui
        SP["SearchPage"]:::ui
        FVM["SearchViewModel"]:::vm
        FVS["SearchViewState"]:::vm
        RepoFl["OmdbRepository"]:::repo
        MovFl["Movie"]:::model
        RespFl["SearchResponse"]:::model
    end

    %% External Service
    Cloud["OMDB REST API"]:::external

    %% Android data flow
    MApp --> MA
    MA --> SF
    SF --> SVM
    SF --> MAda
    SVM --> SVS
    SVM --> RepoAnd
    RepoAnd --> APIAnd
    APIAnd --> Cloud
    Cloud --> APIAnd
    APIAnd --> RepoAnd
    RepoAnd --> SVM
    APIAnd --> MovAnd
    APIAnd --> RespAnd
    RepoAnd --> MovAnd
    RepoAnd --> RespAnd
    SVM --> SF

    %% Flutter data flow
    MFD --> SP
    SP --> FVM
    SP --> MFD
    FVM --> FVS
    FVM --> RepoFl
    RepoFl --> Cloud
    Cloud --> RepoFl
    RepoFl --> FVM
    RepoFl --> MovFl
    RepoFl --> RespFl
    FVM --> SP

    %% Click Events Android
    click MApp "https://github.com/florent37/movie_android_flutter/blob/master/android/app/src/main/java/com/github/florent37/mvvmsample/MainApplication.kt"
    click MA "https://github.com/florent37/movie_android_flutter/blob/master/android/app/src/main/java/com/github/florent37/mvvmsample/MainActivity.kt"
    click SF "https://github.com/florent37/movie_android_flutter/blob/master/android/app/src/main/java/com/github/florent37/mvvmsample/search/SearchFragment.kt"
    click MAda "https://github.com/florent37/movie_android_flutter/blob/master/android/app/src/main/java/com/github/florent37/mvvmsample/search/MoviesAdapter.kt"
    click SVM "https://github.com/florent37/movie_android_flutter/blob/master/android/app/src/main/java/com/github/florent37/mvvmsample/search/SearchViewModel.kt"
    click SVS "https://github.com/florent37/movie_android_flutter/blob/master/android/app/src/main/java/com/github/florent37/mvvmsample/search/SearchViewState.kt"
    click RepoAnd "https://github.com/florent37/movie_android_flutter/blob/master/android/app/src/main/java/com/github/florent37/mvvmsample/omdb/OmdbRepository.kt"
    click APIAnd "https://github.com/florent37/movie_android_flutter/blob/master/android/app/src/main/java/com/github/florent37/mvvmsample/omdb/OMDBApi.kt"
    click MovAnd "https://github.com/florent37/movie_android_flutter/blob/master/android/app/src/main/java/com/github/florent37/mvvmsample/omdb/Movie.kt"
    click RespAnd "https://github.com/florent37/movie_android_flutter/blob/master/android/app/src/main/java/com/github/florent37/mvvmsample/omdb/SearchResponse.kt"

    %% Click Events Flutter
    click MFD "https://github.com/florent37/movie_android_flutter/blob/master/flutter/lib/main.dart"
    click SP "https://github.com/florent37/movie_android_flutter/blob/master/flutter/lib/search/SearchPage.dart"
    click FVM "https://github.com/florent37/movie_android_flutter/blob/master/flutter/lib/search/SearchViewModel.dart"
    click FVS "https://github.com/florent37/movie_android_flutter/blob/master/flutter/lib/search/SearchViewState.dart"
    click RepoFl "https://github.com/florent37/movie_android_flutter/blob/master/flutter/lib/omdb/OmdbRepository.dart"
    click MovFl "https://github.com/florent37/movie_android_flutter/blob/master/flutter/lib/omdb/models/Movie.dart"
    click RespFl "https://github.com/florent37/movie_android_flutter/blob/master/flutter/lib/omdb/models/SearchResponse.dart"

    %% Styles
    classDef ui fill:#D6EAF8,stroke:#1B4F72,stroke-width:1px
    classDef vm fill:#D5F5E3,stroke:#196F3D,stroke-width:1px
    classDef repo fill:#FCF3CF,stroke:#B7950B,stroke-width:1px
    classDef model fill:#E5E7E9,stroke:#424949,stroke-width:1px
    classDef external fill:#FADBD8,stroke:#922B21,stroke-width:1px
```
