# scgrs/uyap-haciz-yardimcisi architecture

> Architecture diagram of the GitHub repository scgrs/uyap-haciz-yardimcisi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/scgrs/uyap-haciz-yardimcisi
- Repository: https://github.com/scgrs/uyap-haciz-yardimcisi

## Overview

UYAP Haciz Yardımcısı is a Chrome extension that prepares (but does not submit) enforcement requests in the UYAP Avukat Portal. The user selects seizure types in the popup; the service worker injects page scripts, and the page-side automation runs selected queries, adds eligible results, prepares bank requests, and creates the final document. The popup displays progress and preferences. The README documents the product stages; the sampled content.js excerpt confirms page automation and bank-list transfer, but does not expose every stage’s implementation details.

Main entry points: [`content.js`](https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/content.js) (Page automation), [`background.js`](https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/background.js) (Service worker), [`bridge.js`](https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/bridge.js) (Page bridge), [`popup.js`](https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/popup.js) (Popup controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Extension interface"]
  node_popup["Popup controls<br/>[popup.js]"]
end

subgraph group_coordination["Extension coordination"]
  node_worker["Service worker<br/>[background.js]"]
  node_bridge["Page bridge<br/>[bridge.js]"]
end

subgraph group_automation["Portal automation"]
  node_page_automation["Page automation<br/>[content.js]"]
end

subgraph group_workflow["Seizure workflow"]
  node_egm["EGM query<br/>[content.js]"]
  node_icra["Enforcement-file query<br/>[content.js]"]
  node_takbis["TAKBİS query<br/>[content.js]"]
  node_bank_query["Bank query<br/>[content.js]"]
  node_bank_matching["Bank matching<br/>[content.js]"]
  node_request_prep["Request preparation<br/>[content.js]"]
  node_document["Document creation<br/>[content.js]"]
end

subgraph group_state["Temporary state"]
  node_state_store[("Chrome session state<br/>[background.js]")]
  node_preferences[("User preferences<br/>[popup.js]")]
end

node_user(("User"))
node_portal["UYAP portal"]

node_user -->|"chooses options"| node_popup
node_popup -->|"starts run"| node_worker
node_worker -->|"injects script"| node_bridge
node_worker -->|"injects script"| node_page_automation
node_worker -->|"sends start"| node_bridge
node_bridge -->|"forwards start"| node_page_automation
node_page_automation -.->|"runs selected"| node_egm
node_page_automation -.->|"runs selected"| node_icra
node_page_automation -.->|"runs selected"| node_takbis
node_page_automation -.->|"runs selected"| node_bank_query
node_egm -->|"queries and adds"| node_portal
node_icra -->|"queries and adds"| node_portal
node_takbis -->|"queries and adds"| node_portal
node_bank_query -->|"queries results"| node_portal
node_bank_query -->|"passes names"| node_bank_matching
node_bank_query -->|"saves names"| node_bridge
node_bridge -->|"forwards names"| node_worker
node_worker -->|"stores temporarily"| node_state_store
node_bank_matching -->|"retrieves names"| node_state_store
node_bank_matching -->|"selects matches"| node_request_prep
node_request_prep -->|"adds bank requests"| node_portal
node_page_automation -->|"creates document"| node_document
node_document -->|"requests creation"| node_portal
node_page_automation -->|"sends progress"| node_bridge
node_bridge -->|"forwards progress"| node_worker
node_worker -->|"publishes progress"| node_state_store
node_popup -->|"reads progress"| node_state_store
node_popup -->|"reads and saves"| node_preferences
node_user -->|"reviews and submits"| node_portal

click node_popup "https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/popup.js"
click node_worker "https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/background.js"
click node_bridge "https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/bridge.js"
click node_page_automation "https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/content.js"
click node_egm "https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/content.js"
click node_icra "https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/content.js"
click node_takbis "https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/content.js"
click node_bank_query "https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/content.js"
click node_bank_matching "https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/content.js"
click node_request_prep "https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/content.js"
click node_document "https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/content.js"
click node_state_store "https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/background.js"
click node_preferences "https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/popup.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_popup,node_user toneBlue
class node_worker,node_bridge toneAmber
class node_page_automation toneMint
class node_egm,node_icra,node_takbis,node_bank_query,node_bank_matching,node_request_prep,node_document toneRose
class node_state_store,node_preferences,node_portal toneIndigo
```

## Components

### Extension interface

- [Popup controls](https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/popup.js): `popup.js`

### Extension coordination

- [Service worker](https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/background.js): `background.js`
- [Page bridge](https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/bridge.js): `bridge.js`

### Portal automation

- [Page automation](https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/content.js): `content.js`

### Seizure workflow

- [EGM query](https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/content.js): `content.js`
- [Enforcement-file query](https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/content.js): `content.js`
- [TAKBİS query](https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/content.js): `content.js`
- [Bank query](https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/content.js): `content.js`
- [Bank matching](https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/content.js): `content.js`
- [Request preparation](https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/content.js): `content.js`
- [Document creation](https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/content.js): `content.js`

### Temporary state

- [Chrome session state](https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/background.js): `background.js`
- [User preferences](https://github.com/scgrs/uyap-haciz-yardimcisi/blob/main/popup.js): `popup.js`

### Other components

- **User**
- **UYAP portal**

## Connections

- User → Popup controls: chooses options (evidence: `README.md`)
- Popup controls → Service worker: starts run (evidence: `popup.js`)
- Service worker → Page bridge: injects script (evidence: `background.js`)
- Service worker → Page automation: injects script (evidence: `background.js`)
- Service worker → Page bridge: sends start (evidence: `background.js`)
- Page bridge → Page automation: forwards start (evidence: `bridge.js`)
- Page automation → EGM query: runs selected (evidence: `README.md`)
- Page automation → Enforcement-file query: runs selected (evidence: `README.md`)
- Page automation → TAKBİS query: runs selected (evidence: `README.md`)
- Page automation → Bank query: runs selected (evidence: `README.md`)
- EGM query → UYAP portal: queries and adds (evidence: `README.md`)
- Enforcement-file query → UYAP portal: queries and adds (evidence: `README.md`)
- TAKBİS query → UYAP portal: queries and adds (evidence: `README.md`)
- Bank query → UYAP portal: queries results (evidence: `README.md`)
- Bank query → Bank matching: passes names (evidence: `README.md`)
- Bank query → Page bridge: saves names (evidence: `content.js`)
- Page bridge → Service worker: forwards names (evidence: `bridge.js`)
- Service worker → Chrome session state: stores temporarily (evidence: `background.js`)
- Bank matching → Chrome session state: retrieves names (evidence: `background.js`)
- Bank matching → Request preparation: selects matches (evidence: `README.md`)
- Request preparation → UYAP portal: adds bank requests (evidence: `README.md`)
- Page automation → Document creation: creates document (evidence: `README.md`)
- Document creation → UYAP portal: requests creation (evidence: `README.md`)
- Page automation → Page bridge: sends progress (evidence: `bridge.js`)
- Page bridge → Service worker: forwards progress (evidence: `bridge.js`)
- Service worker → Chrome session state: publishes progress (evidence: `background.js`)
- Popup controls → Chrome session state: reads progress (evidence: `popup.js`)
- Popup controls → User preferences: reads and saves (evidence: `popup.js`)
- User → UYAP portal: reviews and submits (evidence: `README.md`)
