# avicennarl/random-password-generator architecture

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

- Interactive diagram: https://gitdiagram.com/avicennarl/random-password-generator
- Repository: https://github.com/avicennarl/random-password-generator

## Overview

pwdgen is an offline password and passphrase generator with two independent user-facing implementations: a Python command-line tool and a static browser app. The CLI parses options, dispatches to password or passphrase generation, and formats results with entropy and strength metadata. The browser app handles configuration, generation, strength display, and copying locally. Both use cryptographic randomness; the Python passphrase path loads the bundled BIP39 list. Web UI internals are combined because they live in one sampled file; unsampled page structure is not mapped.

Main entry points: [`src/pwdgen/cli.py`](https://github.com/avicennarl/random-password-generator/blob/main/src/pwdgen/cli.py) (CLI Options & Output), [`src/pwdgen/passphrase.py`](https://github.com/avicennarl/random-password-generator/blob/main/src/pwdgen/passphrase.py) (Passphrase Generation), [`src/pwdgen/words.py`](https://github.com/avicennarl/random-password-generator/blob/main/src/pwdgen/words.py) (Wordlist Loader), [`web/app.js`](https://github.com/avicennarl/random-password-generator/blob/main/web/app.js) (Web Generation & UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Python CLI"]
  node_cli_entry["CLI Options &amp; Output<br/>[cli.py]"]
end

subgraph group_engine["Python Generation"]
  node_password_gen["Password Generation<br/>[core.py]"]
  node_passphrase_gen["Passphrase Generation<br/>[passphrase.py]"]
  node_word_loader["Wordlist Loader<br/>[words.py]"]
  node_bip39_data["BIP39 Wordlist<br/>[words.txt]"]
end

subgraph group_web["Browser App"]
  node_web_app["Web Generation &amp; UI<br/>[app.js]"]
  node_web_words["Browser Wordlist<br/>[words.js]"]
end

node_terminal_user(("Terminal User"))
node_browser_user(("Browser User"))

node_terminal_user -->|"sets options"| node_cli_entry
node_cli_entry -->|"generates passwords"| node_password_gen
node_cli_entry -->|"generates passphrases"| node_passphrase_gen
node_passphrase_gen -->|"loads words"| node_word_loader
node_word_loader -->|"reads list"| node_bip39_data
node_browser_user -->|"configures and copies"| node_web_app
node_web_app -->|"chooses words from"| node_web_words

click node_cli_entry "https://github.com/avicennarl/random-password-generator/blob/main/src/pwdgen/cli.py"
click node_password_gen "https://github.com/avicennarl/random-password-generator/blob/main/src/pwdgen/core.py"
click node_passphrase_gen "https://github.com/avicennarl/random-password-generator/blob/main/src/pwdgen/passphrase.py"
click node_word_loader "https://github.com/avicennarl/random-password-generator/blob/main/src/pwdgen/words.py"
click node_bip39_data "https://github.com/avicennarl/random-password-generator/blob/main/src/pwdgen/data/words.txt"
click node_web_app "https://github.com/avicennarl/random-password-generator/blob/main/web/app.js"
click node_web_words "https://github.com/avicennarl/random-password-generator/blob/main/web/words.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_cli_entry,node_terminal_user,node_browser_user toneBlue
class node_password_gen,node_passphrase_gen,node_word_loader,node_bip39_data toneAmber
class node_web_app,node_web_words toneMint
```

## Components

### Python CLI

- [CLI Options & Output](https://github.com/avicennarl/random-password-generator/blob/main/src/pwdgen/cli.py): `src/pwdgen/cli.py`

### Python Generation

- [Password Generation](https://github.com/avicennarl/random-password-generator/blob/main/src/pwdgen/core.py): `src/pwdgen/core.py`
- [Passphrase Generation](https://github.com/avicennarl/random-password-generator/blob/main/src/pwdgen/passphrase.py): `src/pwdgen/passphrase.py`
- [Wordlist Loader](https://github.com/avicennarl/random-password-generator/blob/main/src/pwdgen/words.py): `src/pwdgen/words.py`
- [BIP39 Wordlist](https://github.com/avicennarl/random-password-generator/blob/main/src/pwdgen/data/words.txt): `src/pwdgen/data/words.txt`

### Browser App

- [Web Generation & UI](https://github.com/avicennarl/random-password-generator/blob/main/web/app.js): `web/app.js`
- [Browser Wordlist](https://github.com/avicennarl/random-password-generator/blob/main/web/words.js): `web/words.js`

### Other components

- **Terminal User**
- **Browser User**

## Connections

- Terminal User → CLI Options & Output: sets options (evidence: `README.md`)
- CLI Options & Output → Password Generation: generates passwords (evidence: `src/pwdgen/cli.py`)
- CLI Options & Output → Passphrase Generation: generates passphrases (evidence: `src/pwdgen/cli.py`)
- Passphrase Generation → Wordlist Loader: loads words (evidence: `src/pwdgen/passphrase.py`)
- Wordlist Loader → BIP39 Wordlist: reads list (evidence: `src/pwdgen/words.py`)
- Browser User → Web Generation & UI: configures and copies (evidence: `README.md`)
- Web Generation & UI → Browser Wordlist: chooses words from (evidence: `web/app.js`)
