# like2k1/dirty-stuff architecture

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

- Interactive diagram: https://gitdiagram.com/like2k1/dirty-stuff
- Repository: https://github.com/like2k1/dirty-stuff

## Overview

This repository contains two legacy Tampermonkey scripts for USMS-related browser pages. The main workflow reads inmate rows from the detention table, saves them in Tampermonkey storage, and uses that data to populate a Google-hosted intake form. A separate script displays the citizen ID on a case page. The graph reflects the shown script behavior; the README notes the scripts are old and that Dirty no longer exists.

Main entry points: [`usms-hafterfassung-tweak.user.js`](https://github.com/like2k1/dirty-stuff/blob/main/usms-hafterfassung-tweak.user.js) (Form autofill), [`akte-show-user-id.user.js`](https://github.com/like2k1/dirty-stuff/blob/main/akte-show-user-id.user.js) (ID display)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_operator(("USMS user"))
node_detention_page["Detention table"]
node_table_extraction["Inmate extraction"]
node_inmate_cache[("Inmate cache")]
node_intake_form["Google intake form"]
node_form_autofill["Form autofill"]
node_citizen_page["Citizen case page"]
node_id_display["ID display"]

node_operator -->|"opens"| node_detention_page
node_detention_page -->|"provides rows"| node_table_extraction
node_table_extraction -->|"writes data"| node_inmate_cache
node_inmate_cache -->|"provides data"| node_form_autofill
node_intake_form -->|"hosts script"| node_form_autofill
node_form_autofill -->|"fills fields"| node_intake_form
node_operator -->|"opens"| node_citizen_page
node_citizen_page -->|"provides URL ID"| node_id_display
node_id_display -->|"adds ID"| node_citizen_page

click node_table_extraction "https://github.com/like2k1/dirty-stuff/blob/main/usms-hafterfassung-tweak.user.js"
click node_inmate_cache "https://github.com/like2k1/dirty-stuff/blob/main/usms-hafterfassung-tweak.user.js"
click node_form_autofill "https://github.com/like2k1/dirty-stuff/blob/main/usms-hafterfassung-tweak.user.js"
click node_id_display "https://github.com/like2k1/dirty-stuff/blob/main/akte-show-user-id.user.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_operator toneBlue
class node_detention_page,node_intake_form,node_citizen_page toneIndigo
class node_table_extraction,node_form_autofill,node_id_display toneTeal
class node_inmate_cache toneAmber
```

## Components

### Other components

- **USMS user**
- **Detention table**
- [Inmate extraction](https://github.com/like2k1/dirty-stuff/blob/main/usms-hafterfassung-tweak.user.js): `usms-hafterfassung-tweak.user.js`
- [Inmate cache](https://github.com/like2k1/dirty-stuff/blob/main/usms-hafterfassung-tweak.user.js): `usms-hafterfassung-tweak.user.js`
- **Google intake form**
- [Form autofill](https://github.com/like2k1/dirty-stuff/blob/main/usms-hafterfassung-tweak.user.js): `usms-hafterfassung-tweak.user.js`
- **Citizen case page**
- [ID display](https://github.com/like2k1/dirty-stuff/blob/main/akte-show-user-id.user.js): `akte-show-user-id.user.js`

## Connections

- USMS user → Detention table: opens
- Detention table → Inmate extraction: provides rows (evidence: `usms-hafterfassung-tweak.user.js`)
- Inmate extraction → Inmate cache: writes data (evidence: `usms-hafterfassung-tweak.user.js`)
- Inmate cache → Form autofill: provides data (evidence: `usms-hafterfassung-tweak.user.js`)
- Google intake form → Form autofill: hosts script (evidence: `usms-hafterfassung-tweak.user.js`)
- Form autofill → Google intake form: fills fields (evidence: `usms-hafterfassung-tweak.user.js`)
- USMS user → Citizen case page: opens
- Citizen case page → ID display: provides URL ID (evidence: `akte-show-user-id.user.js`)
- ID display → Citizen case page: adds ID (evidence: `akte-show-user-id.user.js`)
