# likon16/password_generator architecture

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

- Interactive diagram: https://gitdiagram.com/likon16/password_generator
- Repository: https://github.com/likon16/password_generator

## Overview

This browser-based password generator lets users choose a length and character categories, generate a password, view a strength indicator, and copy the result. Its main workflow runs in `main.js`; the README documents the UI and copy feature, while the sampled source shows generation, strength calculation, and clipboard handling. The HTML and CSS are present in the tree but were not sampled, so their internal structure and wiring are not detailed here.

Main entry points: [`main.js`](https://github.com/likon16/password_generator/blob/main/main.js) (UI event handlers), [`index.html`](https://github.com/likon16/password_generator/blob/main/index.html) (Length and options)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_controls["Length and options<br/>[index.html]"]
  node_controller["UI event handlers<br/>[main.js]"]
  node_display["Password display<br/>[index.html]"]
end

subgraph group_generation["Password generation"]
  node_random["Character generators<br/>[main.js]"]
  node_shuffle["Password shuffle<br/>[main.js]"]
end

subgraph group_feedback["Feedback and copy"]
  node_strength["Strength indicator<br/>[main.js]"]
  node_copy["Clipboard copy<br/>[main.js]"]
end

node_user(("User"))
node_clipboard["Browser clipboard"]

node_user -->|"sets options"| node_controls
node_controls -->|"provides input"| node_controller
node_user -->|"requests generation"| node_controller
node_controller -->|"selects generators"| node_random
node_controller -->|"shuffles password"| node_shuffle
node_controller -->|"writes password"| node_display
node_controller -->|"calculates strength"| node_strength
node_user -->|"requests copy"| node_copy
node_copy -->|"reads password"| node_display
node_copy -->|"writes text"| node_clipboard

click node_controls "https://github.com/likon16/password_generator/blob/main/index.html"
click node_controller "https://github.com/likon16/password_generator/blob/main/main.js"
click node_random "https://github.com/likon16/password_generator/blob/main/main.js"
click node_shuffle "https://github.com/likon16/password_generator/blob/main/main.js"
click node_display "https://github.com/likon16/password_generator/blob/main/index.html"
click node_strength "https://github.com/likon16/password_generator/blob/main/main.js"
click node_copy "https://github.com/likon16/password_generator/blob/main/main.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_controls,node_controller,node_display,node_user,node_clipboard toneBlue
class node_random,node_shuffle toneAmber
class node_strength,node_copy toneMint
```

## Components

### User interface

- [Length and options](https://github.com/likon16/password_generator/blob/main/index.html): `index.html`
- [UI event handlers](https://github.com/likon16/password_generator/blob/main/main.js): `main.js`
- [Password display](https://github.com/likon16/password_generator/blob/main/index.html): `index.html`

### Password generation

- [Character generators](https://github.com/likon16/password_generator/blob/main/main.js): `main.js`
- [Password shuffle](https://github.com/likon16/password_generator/blob/main/main.js): `main.js`

### Feedback and copy

- [Strength indicator](https://github.com/likon16/password_generator/blob/main/main.js): `main.js`
- [Clipboard copy](https://github.com/likon16/password_generator/blob/main/main.js): `main.js`

### Other components

- **User**
- **Browser clipboard**

## Connections

- User → Length and options: sets options (evidence: `README.md`)
- Length and options → UI event handlers: provides input (evidence: `README.md`)
- User → UI event handlers: requests generation (evidence: `README.md`)
- UI event handlers → Character generators: selects generators (evidence: `main.js`)
- UI event handlers → Password shuffle: shuffles password (evidence: `main.js`)
- UI event handlers → Password display: writes password (evidence: `main.js`)
- UI event handlers → Strength indicator: calculates strength (evidence: `main.js`)
- User → Clipboard copy: requests copy (evidence: `README.md`)
- Clipboard copy → Password display: reads password (evidence: `main.js`)
- Clipboard copy → Browser clipboard: writes text (evidence: `main.js`)
