# theandroguy/plinkz architecture

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

- Interactive diagram: https://gitdiagram.com/theandroguy/plinkz
- Repository: https://github.com/theandroguy/plinkz

## Overview

**Plinkz** is a **single-module Android application** (Gradle multi-file setup, but only one app module) whose purpose is: **capture URLs via Android’s Share sheet, persist them locally for offline access, and present/manage/share them in a list UI**.

- **Android entry points** (Activities, Dialog)
- **Data layer** (Room DB: Entity/DAO/Database)
- **UI layer** (RecyclerView + Adapter + XML layouts)
- **OS integrations** (Android Sharesheet intents, browser intents)
- **Build/release** (Gradle, APK/AAB outputs) as a side note

##### File-structure-driven component identification
From the tree, the main components map cleanly:

##### Data / Persistence (Room)
`app/src/main/java/com/tushar/plinkz/Modal/`
- `Link.java` (Room Entity model)
- `LinkDao.java` (DAO: CRUD queries)
- `AppDatabase.java` (RoomDatabase singleton)

##### Resources (UI assets)
`app/src/main/res/`
- `layout/*` (activity screens, list row, dialogs)
- `menu/toolbar_menu.xml` (actions: search/share/delete/etc.)

##### App configuration & build
- `AndroidManifest.xml` (declares Activities, intent-filters, share handling)
- `app/build.gradle.kts`, root `build.gradle.kts`, `settings.gradle.kts`, `libs.versions.toml` (dependencies and versions)
- `app/release/*` (prebuilt artifacts; not part of runtime architecture but relevant to “deployment”)

##### User actions
- Open in browser (implicit intent)
- Share saved link (share intent)
- Delete/update (DAO writes)

##### Android OS / External Apps
- “Other apps (YouTube/Chrome/Instagram)”
- “Android Sharesheet / Intent Resolver”
- “Browser (Chrome Custom Tabs / external browser)” (if used; otherwise generic “Browser app”)

##### App (Plinkz)
By package/folder:
- **Entry/Navigation**
- MainActivity
- **Share Capture**
- ShareActivity (+ intent-filter in Manifest)
- SaveLinkDialog / activity_save_link_dialog.xml / dialog_save_link.xml
- **Link Management UI**
- LinkViewRecyclerActivity / LinkListActivity
- LinkAdapter + link_list_item.xml
- Toolbar menu actions (search/share/delete/open)
- (Optionally) “UI Resources” bubble pointing to layouts/drawables/themes

##### Data Layer
- Room:
- AppDatabase
- LinkDao
- Link (Entity)
- Under that: “SQLite (on-device)” (Room sits atop SQLite)

- Intents coming in/out (Share/Open/Share)
- DB reads/writes (DAO calls)
- UI rendering (Adapter binds Link list)

For maximum accuracy without overcomplicating:

##### External / OS interactions
- **External App → Android Sharesheet → ShareActivity**
- **Link list/detail → “Open in browser” intent → Browser App**
- **Link list/detail → “Share” intent → Android Sharesheet → External Apps**

##### UI ↔ Data interactions
- `ShareActivity` → `AppDatabase`/`LinkDao` (**INSERT Link**)
- `ManualSaveLinkActivity` → `LinkDao` (**INSERT Link**)
- `LinkViewRecyclerActivity`/`LinkListActivity` → `LinkDao` (**SELECT list**, maybe **DELETE/UPDATE**)
- `LinkAdapter` consumes `List<Link>` (data binding)

In Android, the Manifest is architecture:
- `AndroidManifest.xml` as configuring:
- Activities
- Intent filters (especially share)

##### High-level runtime architecture (single page)
OS/external apps ↔ Plinkz Activities ↔ Room/SQLite
External App → Sharesheet → ShareActivity → SaveLinkDialog → DAO → DB → UI refresh
##### UI composition mini-map (optional but accurate for Android)
Activities → associated XML layouts and key widgets (RecyclerView row layout + menu)

## Diagram (Mermaid)

```mermaid
flowchart TD
  %% =========================
  %% External / Android OS
  %% =========================
  subgraph "Android OS + External Apps"
    EXT["External Apps\n(Chrome/YouTube/Instagram/etc.)"]:::external
    OSRES["Android Sharesheet\n(Intent Resolver)"]:::external
    BROWSER["Browser App\n(implicit ACTION_VIEW)"]:::external
  end

  %% =========================
  %% Plinkz App
  %% =========================
  subgraph "Plinkz Android App (single module)"
    direction TB

    subgraph "App Wiring + Config"
      direction TB
      MANIFEST["AndroidManifest.xml\n(Activities + intent-filters)"]:::config
      BACKUPRULES["backup_rules.xml"]:::config
      DATAEXTR["data_extraction_rules.xml"]:::config
    end

    subgraph "UI / Presentation (Activities + Dialog)"
      direction TB

      MAIN["MainActivity\n(Landing / navigation)"]:::activity

      subgraph "Capture Links"
        direction TB
        SHARE["ShareActivity\n(Share Target: ACTION_SEND)"]:::activity
        MANUAL["ManualSaveLinkActivity\n(Manual entry)"]:::activity
        DIALOG["SaveLinkDialog\n(Save/Edit title/tags)"]:::dialog
      end

      subgraph "Browse / Manage Links"
        direction TB
        LISTA["LinkListActivity\n(List UI)"]:::activity
        RECYCA["LinkViewRecyclerActivity\n(RecyclerView list UI)"]:::activity
        ADAPTER["LinkAdapter\n(RecyclerView Adapter)"]:::adapter
        TOOLBARMENU["Toolbar Menu\n(search/share/delete/open)"]:::resource
      end

      subgraph "Resources"
        direction TB
        LAYOUTS["Layout XMLs\n(activities/dialogs/list row)"]:::resource
        DRAWABLES["Drawables\n(icons/backgrounds)"]:::resource
        VALUES["Values\n(themes/strings/colors)\n+ values-night"]:::resource
      end
    end

    %% =========================
    %% Data Layer (Room)
    %% =========================
    subgraph "Data Layer (Room Persistence)"
      direction TB
      DB["AppDatabase\n(RoomDatabase)"]:::data
      DAO["LinkDao\n(CRUD queries)"]:::data
      ENTITY["Link\n(Room Entity)"]:::data
      SQLITE[("SQLite\n(on-device)")]:::db
    end

    %% =========================
    %% Build / Release (side note)
    %% =========================
    subgraph "Build / Release (side note)"
      direction TB
      GRADLE_APP["app/build.gradle.kts\n(app module)"]:::build
      GRADLE_ROOT["build.gradle.kts\n(project)"]:::build
      SETTINGS["settings.gradle.kts"]:::build
      VERSIONCAT["libs.versions.toml"]:::build
      RELEASE["Release Outputs\n(APK/AAB artifacts)"]:::build
    end
  end

  %% =========================
  %% Runtime Flows (Intents + DB)
  %% =========================

  %% Flow A — Save from other apps (Share sheet)
  EXT -->|"ACTION_SEND"| OSRES
  OSRES -->|"resolvesTo"| SHARE
  SHARE -->|"extractsText/URL"| DIALOG
  DIALOG -->|"confirmSave"| SHARE
  SHARE -->|"INSERT(Link)"| DAO

  %% Flow B — Manual save
  MAIN -->|"navigate"| MANUAL
  MANUAL -->|"openSaveUI"| DIALOG
  MANUAL -->|"INSERT(Link)"| DAO

  %% Flow B — Browse/manage offline
  MAIN -->|"navigate"| RECYCA
  MAIN -->|"navigate"| LISTA
  RECYCA -->|"SELECT(list)"| DAO
  LISTA -->|"SELECT(list)"| DAO
  DAO -->|"returns List[Link]"| RECYCA
  DAO -->|"returns List[Link]"| LISTA
  RECYCA -->|"bindsData"| ADAPTER
  ADAPTER -->|"rendersRows"| LAYOUTS

  %% User actions from list
  RECYCA -->|"ACTION_VIEW"| BROWSER
  LISTA -->|"ACTION_VIEW"| BROWSER
  RECYCA -->|"ACTION_SEND(share)"| OSRES
  LISTA -->|"ACTION_SEND(share)"| OSRES
  OSRES -->|"chooseTarget"| EXT
  RECYCA -->|"DELETE/UPDATE"| DAO
  LISTA -->|"DELETE/UPDATE"| DAO

  %% =========================
  %% Structural Dependencies (dashed)
  %% =========================
  MANIFEST -.->|"declaresActivities"| MAIN
  MANIFEST -.->|"declaresShareIntentFilter"| SHARE
  MANIFEST -.->|"references"| BACKUPRULES
  MANIFEST -.->|"references"| DATAEXTR

  SHARE -.->|"uses"| DB
  MANUAL -.->|"uses"| DB
  RECYCA -.->|"uses"| DB
  LISTA -.->|"uses"| DB
  DB -.->|"provides"| DAO
  DAO -.->|"mapsTo"| ENTITY
  DB -->|"RoomOnTopOf"| SQLITE

  TOOLBARMENU -.->|"inflatedBy"| RECYCA
  TOOLBARMENU -.->|"inflatedBy"| LISTA
  LAYOUTS -.->|"usedBy"| MAIN
  LAYOUTS -.->|"usedBy"| SHARE
  LAYOUTS -.->|"usedBy"| MANUAL
  LAYOUTS -.->|"usedBy"| RECYCA
  LAYOUTS -.->|"usedBy"| LISTA
  LAYOUTS -.->|"usedBy"| DIALOG
  DRAWABLES -.->|"iconsFor"| TOOLBARMENU
  VALUES -.->|"themesAndStringsFor"| MAIN

  %% Build relationships (side note)
  SETTINGS -->|"includes"| GRADLE_APP
  GRADLE_ROOT -->|"configures"| GRADLE_APP
  VERSIONCAT -->|"versionsFor"| GRADLE_APP
  GRADLE_APP -->|"produces"| RELEASE

  %% =========================
  %% Click Events (component mapping)
  %% =========================
  click MAIN "https://github.com/theandroguy/plinkz/blob/main/app/src/main/java/com/tushar/plinkz/MainActivity.java"
  click SHARE "https://github.com/theandroguy/plinkz/blob/main/app/src/main/java/com/tushar/plinkz/ShareActivity.java"
  click MANUAL "https://github.com/theandroguy/plinkz/blob/main/app/src/main/java/com/tushar/plinkz/ManualSaveLinkActivity.java"
  click LISTA "https://github.com/theandroguy/plinkz/blob/main/app/src/main/java/com/tushar/plinkz/LinkListActivity.java"
  click RECYCA "https://github.com/theandroguy/plinkz/blob/main/app/src/main/java/com/tushar/plinkz/LinkViewRecyclerActivity.java"
  click DIALOG "https://github.com/theandroguy/plinkz/blob/main/app/src/main/java/com/tushar/plinkz/SaveLinkDialog.java"
  click ADAPTER "https://github.com/theandroguy/plinkz/blob/main/app/src/main/java/com/tushar/plinkz/Adapter/LinkAdapter.java"
  click ENTITY "https://github.com/theandroguy/plinkz/blob/main/app/src/main/java/com/tushar/plinkz/Modal/Link.java"
  click DAO "https://github.com/theandroguy/plinkz/blob/main/app/src/main/java/com/tushar/plinkz/Modal/LinkDao.java"
  click DB "https://github.com/theandroguy/plinkz/blob/main/app/src/main/java/com/tushar/plinkz/Modal/AppDatabase.java"
  click MANIFEST "https://github.com/theandroguy/plinkz/blob/main/app/src/main/AndroidManifest.xml"
  click LAYOUTS "https://github.com/theandroguy/plinkz/tree/main/app/src/main/res/layout/"
  click TOOLBARMENU "https://github.com/theandroguy/plinkz/blob/main/app/src/main/res/menu/toolbar_menu.xml"
  click DRAWABLES "https://github.com/theandroguy/plinkz/tree/main/app/src/main/res/drawable/"
  click VALUES "https://github.com/theandroguy/plinkz/tree/main/app/src/main/res/values/"
  click BACKUPRULES "https://github.com/theandroguy/plinkz/blob/main/app/src/main/res/xml/backup_rules.xml"
  click DATAEXTR "https://github.com/theandroguy/plinkz/blob/main/app/src/main/res/xml/data_extraction_rules.xml"
  click GRADLE_APP "https://github.com/theandroguy/plinkz/blob/main/app/build.gradle.kts"
  click GRADLE_ROOT "https://github.com/theandroguy/plinkz/blob/main/build.gradle.kts"
  click SETTINGS "https://github.com/theandroguy/plinkz/blob/main/settings.gradle.kts"
  click VERSIONCAT "https://github.com/theandroguy/plinkz/blob/main/gradle/libs.versions.toml"
  click RELEASE "https://github.com/theandroguy/plinkz/tree/main/app/release/"

  %% =========================
  %% Styles (color is critical)
  %% =========================
  classDef external fill:#ECEFF1,stroke:#546E7A,stroke-width:1px,color:#263238
  classDef activity fill:#E3F2FD,stroke:#1565C0,stroke-width:1.2px,color:#0D47A1
  classDef dialog fill:#E8EAF6,stroke:#3949AB,stroke-width:1.2px,color:#1A237E
  classDef adapter fill:#E1F5FE,stroke:#0277BD,stroke-width:1.2px,color:#01579B
  classDef data fill:#E8F5E9,stroke:#2E7D32,stroke-width:1.2px,color:#1B5E20
  classDef db fill:#C8E6C9,stroke:#1B5E20,stroke-width:1.4px,color:#1B5E20
  classDef resource fill:#F3E5F5,stroke:#6A1B9A,stroke-width:1.1px,color:#4A148C
  classDef config fill:#FCE4EC,stroke:#AD1457,stroke-width:1.1px,color:#880E4F
  classDef build fill:#FFF8E1,stroke:#FF8F00,stroke-width:1.1px,color:#E65100
```
