# endier-ray/passwordgenerator architecture

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

- Interactive diagram: https://gitdiagram.com/endier-ray/passwordgenerator
- Repository: https://github.com/endier-ray/passwordgenerator

## Overview

PasswordGenerator is a browser-based password generator backed by a FastAPI service. The main workflow is selecting password options, submitting them for generation and recording, then displaying the returned password; the UI also supports copying it. The sampled frontend script establishes the UI-to-service call, while backend route implementation was not sampled, so its internal generation and persistence wiring is not expanded beyond the evidence available.

Main entry points: [`FrontEnd/src/scripts/generatorPayload.ts`](https://github.com/endier-ray/passwordgenerator/blob/main/FrontEnd/src/scripts/generatorPayload.ts) (Generator script), [`BackEnd/app/routes/passwords.py`](https://github.com/endier-ray/passwordgenerator/blob/main/BackEnd/app/routes/passwords.py) (Password route), [`FrontEnd/src/components/PasswordGenerator.astro`](https://github.com/endier-ray/passwordgenerator/blob/main/FrontEnd/src/components/PasswordGenerator.astro) (Generator UI), [`BackEnd/app/db/database.py`](https://github.com/endier-ray/passwordgenerator/blob/main/BackEnd/app/db/database.py) (Database sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_generator_ui["Generator UI"]
  node_home_page["Home page<br/>[index.astro]"]
  node_generator_script["Generator script"]
  node_password_service["Password service<br/>[passwords.ts]"]
  node_docs_ui["Documentation UI"]
end

subgraph group_backend["Backend API"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_password_route["Password route<br/>[passwords.py]"]
  node_request_schema["Request validation<br/>[schemas.py]"]
end

subgraph group_storage["Persistence"]
  node_password_model["Password record<br/>[models.py]"]
  node_db_session["Database sessions<br/>[database.py]"]
end

node_user(("User"))
node_postgres[("PostgreSQL")]
node_clipboard["Clipboard"]

node_user -->|"sets options"| node_generator_ui
node_home_page -->|"renders"| node_generator_ui
node_generator_ui -->|"provides controls"| node_generator_script
node_generator_script -->|"requests generation"| node_password_service
node_password_service -->|"sends request"| node_password_route
node_password_route -->|"validates options"| node_request_schema
node_api_app -->|"registers routes"| node_password_route
node_password_route -->|"uses session"| node_db_session
node_password_model -->|"uses base"| node_db_session
node_db_session -->|"connects"| node_postgres
node_generator_script -->|"copies password"| node_clipboard
node_generator_script -->|"displays result"| node_user

click node_generator_ui "https://github.com/endier-ray/passwordgenerator/blob/main/FrontEnd/src/components/PasswordGenerator.astro"
click node_home_page "https://github.com/endier-ray/passwordgenerator/blob/main/FrontEnd/src/pages/index.astro"
click node_generator_script "https://github.com/endier-ray/passwordgenerator/blob/main/FrontEnd/src/scripts/generatorPayload.ts"
click node_password_service "https://github.com/endier-ray/passwordgenerator/blob/main/FrontEnd/src/services/passwords.ts"
click node_docs_ui "https://github.com/endier-ray/passwordgenerator/blob/main/FrontEnd/src/components/Documentation.astro"
click node_api_app "https://github.com/endier-ray/passwordgenerator/blob/main/BackEnd/main.py"
click node_password_route "https://github.com/endier-ray/passwordgenerator/blob/main/BackEnd/app/routes/passwords.py"
click node_request_schema "https://github.com/endier-ray/passwordgenerator/blob/main/BackEnd/app/schemas.py"
click node_password_model "https://github.com/endier-ray/passwordgenerator/blob/main/BackEnd/app/db/table/models.py"
click node_db_session "https://github.com/endier-ray/passwordgenerator/blob/main/BackEnd/app/db/database.py"

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_generator_ui,node_home_page,node_generator_script,node_password_service,node_docs_ui,node_user toneBlue
class node_api_app,node_password_route,node_request_schema,node_postgres toneAmber
class node_password_model,node_db_session toneMint
class node_clipboard toneIndigo
```

## Components

### Frontend

- [Generator UI](https://github.com/endier-ray/passwordgenerator/blob/main/FrontEnd/src/components/PasswordGenerator.astro): `FrontEnd/src/components/PasswordGenerator.astro`
- [Home page](https://github.com/endier-ray/passwordgenerator/blob/main/FrontEnd/src/pages/index.astro): `FrontEnd/src/pages/index.astro`
- [Generator script](https://github.com/endier-ray/passwordgenerator/blob/main/FrontEnd/src/scripts/generatorPayload.ts): `FrontEnd/src/scripts/generatorPayload.ts`
- [Password service](https://github.com/endier-ray/passwordgenerator/blob/main/FrontEnd/src/services/passwords.ts): `FrontEnd/src/services/passwords.ts`
- [Documentation UI](https://github.com/endier-ray/passwordgenerator/blob/main/FrontEnd/src/components/Documentation.astro): `FrontEnd/src/components/Documentation.astro`

### Backend API

- [FastAPI app](https://github.com/endier-ray/passwordgenerator/blob/main/BackEnd/main.py): `BackEnd/main.py`
- [Password route](https://github.com/endier-ray/passwordgenerator/blob/main/BackEnd/app/routes/passwords.py): `BackEnd/app/routes/passwords.py`
- [Request validation](https://github.com/endier-ray/passwordgenerator/blob/main/BackEnd/app/schemas.py): `BackEnd/app/schemas.py`

### Persistence

- [Password record](https://github.com/endier-ray/passwordgenerator/blob/main/BackEnd/app/db/table/models.py): `BackEnd/app/db/table/models.py`
- [Database sessions](https://github.com/endier-ray/passwordgenerator/blob/main/BackEnd/app/db/database.py): `BackEnd/app/db/database.py`

### Other components

- **User**
- **PostgreSQL**
- **Clipboard**

## Connections

- User → Generator UI: sets options
- Home page → Generator UI: renders
- Generator UI → Generator script: provides controls
- Generator script → Password service: requests generation
- Password service → Password route: sends request
- Password route → Request validation: validates options
- FastAPI app → Password route: registers routes
- Password route → Database sessions: uses session
- Password record → Database sessions: uses base
- Database sessions → PostgreSQL: connects
- Generator script → Clipboard: copies password
- Generator script → User: displays result
