# mannu691/tachiyomiat architecture

> Architecture diagram of the GitHub repository mannu691/tachiyomiat, 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/mannu691/tachiyomiat
- Repository: https://github.com/mannu691/tachiyomiat

## Overview

##### Main Components
- App Module: The “app” directory contains the Android application entry point (MainActivity, UI components, and configuration files) and serves as the bridge between the UI and the business logic.
- Core & Core-Metadata Modules: These directories (core, core-metadata, and submodules like core/archive and core/common) include shared functionalities, low‑level utilities, and metadata parsing/logging.
- Data Module: Contains repositories, database interactions, network services (using OkHttp, interceptors, caches), and domain data mappers to fetch and persist manga, chapters, history, source data, etc.
- Domain Module: Holds business logic, use-case interactors for chapters, manga, categories, history, and other domain models. This module encapsulates core use cases and algorithms.
- Presentation Modules: “presentation-core” and “presentation-widget” handle the UI components; they define screens (like reading, browsing, setting screens) and custom material components.
- Internationalization (i18n): Manages multilingual strings and resources using the moko-resources structure.
- Source Modules: “source-api” and “source-local” encapsulate the source fetching and parsing (i.e. integration for different online and local manga sources).
- Build & Configuration: Gradle scripts, buildSrc modules and configuration files which define the build logic and dependency injection setup to wire these layers.

##### Relationships and Interactions
- The “app” module acts as the entry point where the user’s interactions trigger calls to domain-level use cases.
- The Domain layer, organized in the “domain” directory, implements the business logic and uses interactors that call methods defined in the Data layer.
- The Data layer (in “data”) interacts with external resources like databases, network APIs, and file systems; it also feeds data to the Domain layer.
- UI components under “presentation-core” and “presentation-widget” render the data and react to user inputs.
- Modular separation allows easy swapping or updating of components (for example, adding new translators or sources).
- Dependency injection (as evidenced by the “di” directory in the app module and build logic modules) binds these layers together.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Repository
    Repo("Mihon Repository"):::blue

    %% Build & Configuration Layer
    subgraph "Build & Configuration"
        Build("Gradle Scripts & buildSrc"):::blue
    end

    %% UI Layer
    subgraph "UI Layer"
        App("app – Main UI"):::blue
        PCore("presentation-core – UI Components"):::blue
        PWidget("presentation-widget – UI Components"):::blue
    end

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        Domain("domain – Business Logic"):::blue
    end

    %% Data Layer
    subgraph "Data Layer"
        Data("data – Repository & Storage"):::blue
    end

    %% Core Modules Layer
    subgraph "Core Modules"
        Core("core – Shared Utilities"):::blue
        Archive("archive"):::blue
        Common("common"):::blue
        CoreMeta("core-metadata – Metadata Parsing"):::blue
    end

    %% Integration Layer
    subgraph "Integration Layer"
        SourceAPI("source-api – API Sources"):::blue
        SourceLocal("source-local – Local Sources"):::blue
    end

    %% Internationalization Layer
    subgraph "Internationalization"
        I18n("i18n – Language Resources"):::blue
        I18nAt("i18n-at"):::blue
    end

    %% Connections from Repository to Layers
    Repo --> Build
    Repo --> App
    Repo --> PCore
    Repo --> PWidget
    Repo --> Domain
    Repo --> Data
    Repo --> Core
    Repo --> CoreMeta
    Repo --> SourceAPI
    Repo --> SourceLocal
    Repo --> I18n
    Repo --> I18nAt

    %% Intra-Layer Connections
    %% UI interactions triggering business logic
    App -->|"UI_triggers_use_cases"| Domain
    %% Business logic fetching data
    Domain -->|"fetches_data"| Data
    %% Data layer uses core utilities and metadata parsing
    Data -->|"uses_utilities"| Core
    Data -->|"uses_metadata"| CoreMeta
    %% Data layer fetching from source integrations
    Data -->|"fetches_from"| SourceAPI
    Data -->|"fetches_from"| SourceLocal
    %% UI layer rendering components
    App -->|"renders_UI"| PCore
    App -->|"renders_UI"| PWidget
    %% Build layer injects dependencies into UI
    Build -->|"injects_dependencies"| App

    %% Core Modules internal structure
    Core --> Archive
    Core --> Common

    %% Click Events
    click App "https://github.com/mannu691/tachiyomiat/blob/main/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt"
    click Core "https://github.com/mannu691/tachiyomiat/tree/main/core/"
    click Archive "https://github.com/mannu691/tachiyomiat/tree/main/core/archive"
    click Common "https://github.com/mannu691/tachiyomiat/tree/main/core/common"
    click CoreMeta "https://github.com/mannu691/tachiyomiat/tree/main/core-metadata/src/main/java/tachiyomi/core/metadata"
    click Data "https://github.com/mannu691/tachiyomiat/tree/main/data/src/main/java/tachiyomi/data/"
    click Domain "https://github.com/mannu691/tachiyomiat/tree/main/domain/src/main/java/"
    click PCore "https://github.com/mannu691/tachiyomiat/tree/main/presentation-core/"
    click PWidget "https://github.com/mannu691/tachiyomiat/tree/main/presentation-widget/"
    click I18n "https://github.com/mannu691/tachiyomiat/tree/main/i18n/"
    click I18nAt "https://github.com/mannu691/tachiyomiat/tree/main/i18n-at/"
    click SourceAPI "https://github.com/mannu691/tachiyomiat/tree/main/source-api/"
    click SourceLocal "https://github.com/mannu691/tachiyomiat/tree/main/source-local/"
    click Build "https://github.com/mannu691/tachiyomiat/tree/main/buildSrc/"

    %% Style Definitions
    classDef blue fill:#DAE8FC,stroke:#6C8EBF,stroke-width:2px
    
    %% Assign classes to all nodes
    class Repo,Build,App,PCore,PWidget,Domain,Data,Core,Archive,Common,CoreMeta,SourceAPI,SourceLocal,I18n,I18nAt blue
```
