# keyaraaa/cloud-safe-vault architecture

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

- Interactive diagram: https://gitdiagram.com/keyaraaa/cloud-safe-vault
- Repository: https://github.com/keyaraaa/cloud-safe-vault
- Video tour (about a minute): https://gitdiagram.com/keyaraaa/cloud-safe-vault/video

## Overview

Cloud-safe-vault is a Flask web app for password tools and temporary text encryption. Users interact through browser pages: password generation, passphrase creation, strength scoring and breach checks call password APIs; encryption returns a token and one-time key, which the browser retains for later decryption. The backend stores encrypted tokens with expiry and exposes basic statistics and health checks. Password implementation excerpts were not supplied, so those internal links are limited to the documented feature boundaries; deployment and test machinery are omitted.

Main entry points: [`app/static/js/app.js`](https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/static/js/app.js) (Browser UI), [`app/__init__.py`](https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/__init__.py) (App factory and pages), [`app/passwords/services.py`](https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/passwords/services.py) (Password operations), [`app/passwords/routes.py`](https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/passwords/routes.py) (Password API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_browser["Browser UI<br/>[app.js]"]
  node_language["Language switcher<br/>[i18n.js]"]
  node_templates["Page templates"]
  node_local_storage[("Browser token records<br/>[app.js]")]
end

subgraph group_app["Flask application"]
  node_factory["App factory and pages<br/>[__init__.py]"]
end

subgraph group_passwords["Password tools"]
  node_password_routes["Password API<br/>[routes.py]"]
  node_password_services["Password operations<br/>[services.py]"]
  node_wordlist["Passphrase wordlist<br/>[wordlist.py]"]
end

subgraph group_crypto["Encryption and storage"]
  node_crypto_routes["Crypto API<br/>[routes.py]"]
  node_crypto_services["Fernet operations<br/>[services.py]"]
  node_token_model["Encrypted token model<br/>[models.py]"]
  node_database[("SQL database")]
end

subgraph group_observability["Metrics"]
  node_metrics["Prometheus metrics<br/>[__init__.py]"]
end

node_visitor(("User"))
node_hibp["Have I Been Pwned"]
node_prometheus["Prometheus scraper"]

node_visitor -->|"uses"| node_browser
node_browser -->|"views"| node_templates
node_browser -->|"applies translations"| node_language
node_browser -->|"calls password APIs"| node_password_routes
node_browser -->|"calls crypto APIs"| node_crypto_routes
node_factory -->|"renders pages"| node_templates
node_factory -->|"registers blueprint"| node_password_routes
node_factory -->|"registers blueprint"| node_crypto_routes
node_password_routes -->|"calls operations"| node_password_services
node_password_services -.->|"uses words"| node_wordlist
node_password_services -->|"checks hash range"| node_hibp
node_crypto_routes -->|"calls operations"| node_crypto_services
node_crypto_services -->|"queries and writes"| node_token_model
node_token_model -->|"persists records"| node_database
node_browser -->|"saves token and key"| node_local_storage
node_factory -->|"queries statistics"| node_token_model
node_factory -->|"initializes"| node_metrics
node_prometheus -.->|"scrapes metrics"| node_metrics

click node_browser "https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/static/js/app.js"
click node_language "https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/static/js/i18n.js"
click node_templates "https://github.com/keyaraaa/cloud-safe-vault/tree/main/app/templates"
click node_factory "https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/__init__.py"
click node_password_routes "https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/passwords/routes.py"
click node_password_services "https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/passwords/services.py"
click node_wordlist "https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/passwords/wordlist.py"
click node_crypto_routes "https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/crypto/routes.py"
click node_crypto_services "https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/crypto/services.py"
click node_token_model "https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/crypto/models.py"
click node_local_storage "https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/static/js/app.js"
click node_metrics "https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/__init__.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_browser,node_language,node_templates,node_local_storage,node_visitor toneBlue
class node_factory toneAmber
class node_password_routes,node_password_services,node_wordlist toneMint
class node_crypto_routes,node_crypto_services,node_token_model,node_database toneRose
class node_metrics,node_hibp,node_prometheus toneIndigo
```

## Components

### Web interface

- [Browser UI](https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/static/js/app.js): `app/static/js/app.js`
- [Language switcher](https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/static/js/i18n.js): `app/static/js/i18n.js`
- [Page templates](https://github.com/keyaraaa/cloud-safe-vault/tree/main/app/templates): `app/templates`
- [Browser token records](https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/static/js/app.js): `app/static/js/app.js`

### Flask application

- [App factory and pages](https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/__init__.py): `app/__init__.py`

### Password tools

- [Password API](https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/passwords/routes.py): `app/passwords/routes.py`
- [Password operations](https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/passwords/services.py): `app/passwords/services.py`
- [Passphrase wordlist](https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/passwords/wordlist.py): `app/passwords/wordlist.py`

### Encryption and storage

- [Crypto API](https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/crypto/routes.py): `app/crypto/routes.py`
- [Fernet operations](https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/crypto/services.py): `app/crypto/services.py`
- [Encrypted token model](https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/crypto/models.py): `app/crypto/models.py`
- **SQL database**

### Metrics

- [Prometheus metrics](https://github.com/keyaraaa/cloud-safe-vault/blob/main/app/__init__.py): `app/__init__.py`

### Other components

- **User**
- **Have I Been Pwned**
- **Prometheus scraper**

## Connections

- User → Browser UI: uses
- Browser UI → Page templates: views
- Browser UI → Language switcher: applies translations
- Browser UI → Password API: calls password APIs
- Browser UI → Crypto API: calls crypto APIs
- App factory and pages → Page templates: renders pages
- App factory and pages → Password API: registers blueprint
- App factory and pages → Crypto API: registers blueprint
- Password API → Password operations: calls operations
- Password operations → Passphrase wordlist: uses words
- Password operations → Have I Been Pwned: checks hash range
- Crypto API → Fernet operations: calls operations
- Fernet operations → Encrypted token model: queries and writes
- Encrypted token model → SQL database: persists records
- Browser UI → Browser token records: saves token and key
- App factory and pages → Encrypted token model: queries statistics
- App factory and pages → Prometheus metrics: initializes
- Prometheus scraper → Prometheus metrics: scrapes metrics
