# ssverma/showtime2 architecture

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

- Interactive diagram: https://gitdiagram.com/ssverma/showtime2
- Repository: https://github.com/ssverma/showtime2

## Overview

##### Main Components
- App Presentation Layer: Represent the app module (which includes the MainActivity, navigation with Compose Navigation, theming, and UI screens – home, details, search, library, etc.).
- Feature Modules: Each “feature-*” module (e.g., feature-movie, feature-tv, feature-person, feature-search, feature-auth, feature-account, etc.) should be depicted as self-contained components that encapsulate their own UI, use cases (domain), and repository logic.
- Shared Modules: Show the “shared-data”, “shared-domain”, and “shared-ui” modules. These modules provide cross-feature functionality such as data mappers, domain models, reusable UI components, and use cases.
- Core Modules: Include the “core-*” modules (core-networking, core-storage, core-paging, core-ui, etc.) that serve as the infrastructure for networking (using Retrofit, interceptors, etc.), data persistence (local storage, database, key-value storage), paging support, and common UI elements.
- API Service Module: Represent the “api-service” sub-module, which specifically interacts with TMDB and acts as an external service provider.
- Dependency Injection: Show that the project uses Dagger Hilt (and its own DI modules in modules like core-di or feature-specific DI) to wire up dependencies across the layers.

##### Relationships and Interactions
- Within each feature module, show that the Presentation Layer interacts with the Domain Layer (use cases and ViewModels) and then with the Data Layer (repositories, remote and local data sources).
- Core modules (networking, storage, paging) as common dependencies that are injected into higher-level modules.
- Role of navigation modules (e.g., feature-movie-navigation, feature-tv-navigation) that provide entry points from the app module into the detailed feature screens.

##### Architectural Patterns & Design Principles
- Modularity: many independent modules that enhance reusability (core-*, shared-*, feature-*).
- Dependency Injection (DI) as a central design aspect, with DI modules providing dependencies such as network clients, database clients, and specific API configurations.
- Design patterns like Repository Pattern for data management and the Paging pattern for gradual data retrieval.

##### Relevant Technologies/Frameworks
- Components with technologies – for example:
- UI with Jetpack Compose and Material Design Components.
- Networking via Retrofit (within core-networking) and use of Coroutines.
- Dependency Injection using Dagger Hilt.
- Local storage relies on core-storage and Database modules.
- Paging libraries as part of core-paging and core-ui-paging.
- Mention the use of various Jetpack Architecture Components (LiveData, ViewModel, Navigation, etc.).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% App Layer
    subgraph "App Layer"
        A1["App Module (UI & Navigation)"]:::app
    end

    %% Feature Navigation Modules
    subgraph "Feature Navigation Modules"
        FN1["Movie Navigation"]:::feature
        FN2["TV Navigation"]:::feature
        FN3["Person Navigation"]:::feature
        FN4["Search Navigation"]:::feature
        FN5["Auth Navigation"]:::feature
        FN6["Account Navigation"]:::feature
        FN7["Library Navigation"]:::feature
    end

    %% Feature Modules
    subgraph "Feature Modules"
        F1["Feature - Movie"]:::feature
        F2["Feature - TV"]:::feature
        F3["Feature - Person"]:::feature
        F4["Feature - Search"]:::feature
        F5["Feature - Auth"]:::feature
        F6["Feature - Account"]:::feature
    end

    %% Shared Modules
    subgraph "Shared Modules"
        S1["Shared Data Module"]:::shared
        S2["Shared Domain Module"]:::shared
        S3["Shared UI Module"]:::shared
    end

    %% Core Modules
    subgraph "Core Modules"
        C1["Core Networking"]:::core
        C2["Core Storage"]:::core
        C3["Core Paging"]:::core
        C4["Core UI"]:::core
        C5["Core DI"]:::core
    end

    %% API & External Services
    subgraph "API & External Services"
        APM["API Service (TMDB)"]:::service
        EXT["TMDB API"]:::external
    end

    %% App Layer navigates to Feature Navigation Modules
    A1 -->|"navigatesTo"| FN1
    A1 -->|"navigatesTo"| FN2
    A1 -->|"navigatesTo"| FN3
    A1 -->|"navigatesTo"| FN4
    A1 -->|"navigatesTo"| FN5
    A1 -->|"navigatesTo"| FN6
    A1 -->|"navigatesTo"| FN7

    %% Feature Navigation routes to Feature Modules
    FN1 -->|"routesTo"| F1
    FN2 -->|"routesTo"| F2
    FN3 -->|"routesTo"| F3
    FN4 -->|"routesTo"| F4
    FN5 -->|"routesTo"| F5
    FN6 -->|"routesTo"| F6
    FN7 -->|"routesTo"| F1

    %% Feature Modules interaction with Shared Modules (MVVM data & domain layers)
    F1 -->|"usesDomain"| S2
    F1 -->|"usesData"| S1

    F2 -->|"usesDomain"| S2
    F2 -->|"usesData"| S1

    F3 -->|"usesDomain"| S2
    F3 -->|"usesData"| S1

    F4 -->|"usesDomain"| S2
    F4 -->|"usesData"| S1

    F5 -->|"usesDomain"| S2
    F5 -->|"usesData"| S1

    F6 -->|"usesDomain"| S2
    F6 -->|"usesData"| S1

    %% Shared Modules integrated via DI
    S1 -->|"integratedBy"| C5
    S2 -->|"integratedBy"| C5
    S3 -->|"integratedBy"| C5

    %% Core Modules provide infrastructure
    C1 -->|"fetchesFrom"| APM
    APM -->|"calls"| EXT

    S1 -->|"persistsData"| C2
    S1 -->|"pagesData"| C3
    S3 -->|"UIComponents"| C4

    %% App Layer and Feature Modules use Dependency Injection
    A1 -->|"wiresUsing"| C5
    F1 -->|"injectsDependencies"| C5
    F2 -->|"injectsDependencies"| C5
    F3 -->|"injectsDependencies"| C5
    F4 -->|"injectsDependencies"| C5
    F5 -->|"injectsDependencies"| C5
    F6 -->|"injectsDependencies"| C5

    %% Shared Modules use Core Networking
    S1 -->|"reposUseNetworking"| C1

    %% API Service integration via DI
    APM -->|"injectedVia"| C5

    %% Class Definitions for Colors
    classDef app fill:#BBDEFB,stroke:#0D47A1,stroke-width:2px;
    classDef feature fill:#C8E6C9,stroke:#1B5E20,stroke-width:2px;
    classDef shared fill:#F0F4C3,stroke:#827717,stroke-width:2px;
    classDef core fill:#FFCDD2,stroke:#B71C1C,stroke-width:2px;
    classDef service fill:#D1C4E9,stroke:#4A148C,stroke-width:2px;
    classDef external fill:#FFE082,stroke:#FF6F00,stroke-width:2px;

    %% Click Events for Component Mapping
    click A1 "https://github.com/ssverma/showtime2/blob/development/app/src/main/java/com/ssverma/showtime/MainActivity.kt"
    click F1 "https://github.com/ssverma/showtime2/tree/development/feature-movie/"
    click F2 "https://github.com/ssverma/showtime2/tree/development/feature-tv/"
    click F3 "https://github.com/ssverma/showtime2/tree/development/feature-person/"
    click F4 "https://github.com/ssverma/showtime2/tree/development/feature-search/"
    click F5 "https://github.com/ssverma/showtime2/tree/development/feature-auth/"
    click F6 "https://github.com/ssverma/showtime2/tree/development/feature-account/"
    click FN1 "https://github.com/ssverma/showtime2/tree/development/feature-movie-navigation/"
    click FN2 "https://github.com/ssverma/showtime2/tree/development/feature-tv-navigation/"
    click FN3 "https://github.com/ssverma/showtime2/tree/development/feature-person-navigation/"
    click FN4 "https://github.com/ssverma/showtime2/tree/development/feature-search-navigation/"
    click FN5 "https://github.com/ssverma/showtime2/tree/development/feature-auth-navigation/"
    click FN6 "https://github.com/ssverma/showtime2/tree/development/feature-account-navigation/"
    click FN7 "https://github.com/ssverma/showtime2/tree/development/feature-library-navigation/"
    click S1 "https://github.com/ssverma/showtime2/tree/development/shared-data/"
    click S2 "https://github.com/ssverma/showtime2/tree/development/shared-domain/"
    click S3 "https://github.com/ssverma/showtime2/tree/development/shared-ui/"
    click C1 "https://github.com/ssverma/showtime2/tree/development/core-networking/"
    click C2 "https://github.com/ssverma/showtime2/tree/development/core-storage/"
    click C3 "https://github.com/ssverma/showtime2/tree/development/core-paging/"
    click C4 "https://github.com/ssverma/showtime2/tree/development/core-ui/"
    click C5 "https://github.com/ssverma/showtime2/tree/development/core-di/"
    click APM "https://github.com/ssverma/showtime2/tree/development/api-service/tmdb/"
```
