# tasomaniac/openlinkwith architecture

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

## Overview

##### Main Components
- Core Android Application: The “app” module is the primary Android component that includes the main entry point (App.kt, AndroidManifest.xml, assets, resources, etc.). This is where the application’s primary functionality lives.
- Resolver/Intent Handling: Several modules (for example, the “resolver”, “browser-resolver” and parts within the “app” module under resolver/) handle the logic to capture link intents, resolve the correct target application, and display a list to choose from.
- Settings and Preferences: Multiple packages under “settings” (and additional modules like “base-prefs”) indicate that there is a robust settings layer. This includes advanced settings, rating prompts, and general user preferences.
- Additional Modules Separating Features:
- Localization/Translations: The “base-translations” module houses various language resources.
- Browser-specific UI: The “browser-preferred” module likely manages the UI for preferred browsers.
- Homescreen & Shortcuts: Modules like “homescreen” manage adding apps/shortcuts to the device launcher.
- Intro Screens: “intro-lib” and “intro” contain the onboarding experience for new users.
- Redirect Handling: There is a dedicated “redirect” module managing the fix or redirection of URLs.
- Data Layer: The “data” module handles persistence (e.g., databases, DAOs, migrations), analytics tracking, and other data-related logic.
- Testing & Build Infrastructure: The “test-support” package and various Gradle configuration files point to automated testing and CI/CD capabilities.

##### Relationships and Interactions
- The Resolver component receives a shared URL intent and then communicates with the various “resolver” implementations (e.g., default resolver, browser resolver) to display available target applications.
- The Settings modules likely use dependency injection (as suggested by the presence of modules such as AppModule, BindingModule) to allow different parts (like advanced and feature toggles) to be added or modified independently.
- The Data module supports persistent storage and might interact with other modules when storing user choices/preferences or managing analytics.
- Localization (base-translations) supplies strings and other resources across modules.

##### Architectural Patterns and Technologies
- Modularization: The project splits its code into many modules (app, homescreen, resolver, intro, and more) to keep features decoupled and maintainable.
- Separation of Concerns: Each module handles a specific aspect (UI routing, settings management, localization, etc.).
- Dependency Injection: The existence of “Module” and “Component” classes (e.g., AppComponent.kt, AppModule.java, BindingModule.java) suggests the use of DI frameworks (likely Dagger or similar).
- Reactive Programming: The “rx” package under “base” implies usage of reactive extensions (RxJava) for asynchronous operations.
- Testing: Multiple “test” directories ensure unit and integration tests for key functionalities, reinforcing a design that emphasizes testability.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        P1["Core Android UI (Main App Module)"] 
        P2["Resolver UI"]
        P3["Settings UI"]
        P4["Browser UI"]
        P5["Homescreen UI"]
        P6["Intro UI"]
        P7["Redirect UI"]
    end

    %% Business Logic & Use Cases
    subgraph "Business Logic & Use Cases"
        B1["Dependency Injection (App Component & Modules)"]
        B2["Resolver Service"]
        B3["Settings Service"]
    end

    %% Data Layer
    subgraph "Data Layer"
        D1["Data Persistence (Data Module)"]
    end

    %% Integration Points
    subgraph "Integration Points"
        I1["Localization/Translations"]
        I2["Testing & CI/CD"]
    end

    %% Presentation Layer Arrows
    P1 --> P2
    P1 --> P3
    P1 --> P4
    P1 --> P5
    P1 --> P6
    P1 --> P7

    %% UI to Business Logic Arrows
    P2 -->|"resolveIntent"| B2
    P3 -->|"updateSettings"| B3
    P4 -->|"selectBrowser"| B2
    P7 -->|"redirectFix"| B2

    %% Dependency Injection Feeding Business Logic
    B1 -->|"injects"| B2
    B1 -->|"injects"| B3

    %% Business Logic to Data Layer Arrows
    B2 -->|"storesChoice"| D1
    B3 -->|"savesPrefs"| D1

    %% Integration Points to Presentation Layer Arrows
    I1 -->|"providesStrings"| P1
    I1 -->|"providesStrings"| P2
    I1 -->|"providesStrings"| P3
    I1 -->|"providesStrings"| P4
    I1 -->|"providesStrings"| P5
    I1 -->|"providesStrings"| P6
    I1 -->|"providesStrings"| P7

    I2 -->|"builds"| P1

    %% Styles
    classDef presentation fill:#bbdefb,stroke:#0d47a1,stroke-width:2px;
    classDef business fill:#c8e6c9,stroke:#1b5e20,stroke-width:2px;
    classDef data fill:#fff9c4,stroke:#f57f17,stroke-width:2px;
    classDef integration fill:#d1c4e9,stroke:#4a148c,stroke-width:2px;

    class P1,P2,P3,P4,P5,P6,P7 presentation;
    class B1,B2,B3 business;
    class D1 data;
    class I1,I2 integration;

    %% Click Events
    click P1 "https://github.com/tasomaniac/openlinkwith/tree/master/app/"
    click P2 "https://github.com/tasomaniac/openlinkwith/tree/master/app/src/main/java/com/tasomaniac/openwith/resolver"
    click P3 "https://github.com/tasomaniac/openlinkwith/tree/master/app/src/main/java/com/tasomaniac/openwith/settings"
    click P4 "https://github.com/tasomaniac/openlinkwith/tree/master/browser-preferred/"
    click P5 "https://github.com/tasomaniac/openlinkwith/tree/master/homescreen/"
    click P6 "https://github.com/tasomaniac/openlinkwith/tree/master/intro-lib/"
    click P7 "https://github.com/tasomaniac/openlinkwith/tree/master/redirect/"
    click B1 "https://github.com/tasomaniac/openlinkwith/tree/master/app/"
    click D1 "https://github.com/tasomaniac/openlinkwith/tree/master/data/"
    click I1 "https://github.com/tasomaniac/openlinkwith/tree/master/base-translations/"
    click I2 "https://github.com/tasomaniac/openlinkwith/tree/master/test-support/"
    click I2 "https://github.com/tasomaniac/openlinkwith/blob/master/.github/workflows/ci.yml"
```
