# ayoub81a/keynest architecture

> Architecture diagram of the GitHub repository ayoub81a/keynest, 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/ayoub81a/keynest
- Repository: https://github.com/ayoub81a/keynest

## Overview

KeyNest is a browser-based password manager with a PHP/MySQL backend and a separate static information site. The main workflow is account authentication, browser-side key derivation and encryption, then ciphertext-only vault storage and retrieval. README capabilities are represented, but frontend source was not sampled, so detailed UI-to-feature wiring is not inferred.

Main entry points: [`keynest/assets/app.js`](https://github.com/ayoub81a/keynest/blob/main/keynest/assets/app.js) (Vault controller), [`keynest/assets/api.js`](https://github.com/ayoub81a/keynest/blob/main/keynest/assets/api.js) (API client), [`keynest-site/index.html`](https://github.com/ayoub81a/keynest/blob/main/keynest-site/index.html) (Information site), [`keynest/api/db.php`](https://github.com/ayoub81a/keynest/blob/main/keynest/api/db.php) (DB and session helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Vault client"]
  node_vault_shell["Vault app shell<br/>[index.html]"]
  node_app["Vault controller<br/>[app.js]"]
  node_crypto["Encryption and keys<br/>[crypto.js]"]
  node_api_client["API client<br/>[api.js]"]
  node_password_vault["Password vault<br/>[app.js]"]
  node_secure_notes["Secure notes<br/>[app.js]"]
  node_tags["Tag management<br/>[app.js]"]
  node_search_copy["Search and copy<br/>[app.js]"]
  node_password_tools["Password tools<br/>[app.js]"]
  node_trash["Trash and restore<br/>[app.js]"]
end

subgraph group_backend["Backend and storage"]
  node_auth_api["Authentication API<br/>[auth.php]"]
  node_entries_api["Entries API<br/>[entries.php]"]
  node_db_helpers["DB and session helpers<br/>[db.php]"]
  node_mysql[("MySQL data<br/>[keynest.sql]")]
end

subgraph group_site["Information site"]
  node_info_site["Information site<br/>[index.html]"]
  node_features_page["Features overview<br/>[features.html]"]
  node_security_page["Security details<br/>[security.html]"]
end

node_user(("User"))

node_user -->|"opens"| node_vault_shell
node_vault_shell -->|"loads"| node_app
node_app -->|"requests"| node_api_client
node_app -->|"encrypts and decrypts"| node_crypto
node_app -->|"manages"| node_password_vault
node_app -->|"manages"| node_secure_notes
node_app -->|"manages"| node_tags
node_app -->|"supports"| node_search_copy
node_app -->|"provides"| node_password_tools
node_app -->|"manages"| node_trash
node_api_client -->|"calls"| node_auth_api
node_api_client -->|"calls"| node_entries_api
node_auth_api -->|"uses"| node_db_helpers
node_entries_api -->|"uses"| node_db_helpers
node_db_helpers -->|"connects to"| node_mysql
node_user -->|"visits"| node_info_site
node_info_site -->|"links to"| node_features_page
node_info_site -->|"links to"| node_security_page

click node_vault_shell "https://github.com/ayoub81a/keynest/blob/main/keynest/index.html"
click node_app "https://github.com/ayoub81a/keynest/blob/main/keynest/assets/app.js"
click node_crypto "https://github.com/ayoub81a/keynest/blob/main/keynest/assets/crypto.js"
click node_api_client "https://github.com/ayoub81a/keynest/blob/main/keynest/assets/api.js"
click node_password_vault "https://github.com/ayoub81a/keynest/blob/main/keynest/assets/app.js"
click node_secure_notes "https://github.com/ayoub81a/keynest/blob/main/keynest/assets/app.js"
click node_tags "https://github.com/ayoub81a/keynest/blob/main/keynest/assets/app.js"
click node_search_copy "https://github.com/ayoub81a/keynest/blob/main/keynest/assets/app.js"
click node_password_tools "https://github.com/ayoub81a/keynest/blob/main/keynest/assets/app.js"
click node_trash "https://github.com/ayoub81a/keynest/blob/main/keynest/assets/app.js"
click node_auth_api "https://github.com/ayoub81a/keynest/blob/main/keynest/api/auth.php"
click node_entries_api "https://github.com/ayoub81a/keynest/blob/main/keynest/api/entries.php"
click node_db_helpers "https://github.com/ayoub81a/keynest/blob/main/keynest/api/db.php"
click node_mysql "https://github.com/ayoub81a/keynest/blob/main/keynest/keynest.sql"
click node_info_site "https://github.com/ayoub81a/keynest/blob/main/keynest-site/index.html"
click node_features_page "https://github.com/ayoub81a/keynest/blob/main/keynest-site/features.html"
click node_security_page "https://github.com/ayoub81a/keynest/blob/main/keynest-site/security.html"

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_vault_shell,node_app,node_crypto,node_api_client,node_password_vault,node_secure_notes,node_tags,node_search_copy,node_password_tools,node_trash,node_user toneBlue
class node_auth_api,node_entries_api,node_db_helpers,node_mysql toneAmber
class node_info_site,node_features_page,node_security_page toneMint
```

## Components

### Vault client

- [Vault app shell](https://github.com/ayoub81a/keynest/blob/main/keynest/index.html): `keynest/index.html`
- [Vault controller](https://github.com/ayoub81a/keynest/blob/main/keynest/assets/app.js): `keynest/assets/app.js`
- [Encryption and keys](https://github.com/ayoub81a/keynest/blob/main/keynest/assets/crypto.js): `keynest/assets/crypto.js`
- [API client](https://github.com/ayoub81a/keynest/blob/main/keynest/assets/api.js): `keynest/assets/api.js`
- [Password vault](https://github.com/ayoub81a/keynest/blob/main/keynest/assets/app.js): `keynest/assets/app.js`
- [Secure notes](https://github.com/ayoub81a/keynest/blob/main/keynest/assets/app.js): `keynest/assets/app.js`
- [Tag management](https://github.com/ayoub81a/keynest/blob/main/keynest/assets/app.js): `keynest/assets/app.js`
- [Search and copy](https://github.com/ayoub81a/keynest/blob/main/keynest/assets/app.js): `keynest/assets/app.js`
- [Password tools](https://github.com/ayoub81a/keynest/blob/main/keynest/assets/app.js): `keynest/assets/app.js`
- [Trash and restore](https://github.com/ayoub81a/keynest/blob/main/keynest/assets/app.js): `keynest/assets/app.js`

### Backend and storage

- [Authentication API](https://github.com/ayoub81a/keynest/blob/main/keynest/api/auth.php): `keynest/api/auth.php`
- [Entries API](https://github.com/ayoub81a/keynest/blob/main/keynest/api/entries.php): `keynest/api/entries.php`
- [DB and session helpers](https://github.com/ayoub81a/keynest/blob/main/keynest/api/db.php): `keynest/api/db.php`
- [MySQL data](https://github.com/ayoub81a/keynest/blob/main/keynest/keynest.sql): `keynest/keynest.sql`

### Information site

- [Information site](https://github.com/ayoub81a/keynest/blob/main/keynest-site/index.html): `keynest-site/index.html`
- [Features overview](https://github.com/ayoub81a/keynest/blob/main/keynest-site/features.html): `keynest-site/features.html`
- [Security details](https://github.com/ayoub81a/keynest/blob/main/keynest-site/security.html): `keynest-site/security.html`

### Other components

- **User**

## Connections

- User → Vault app shell: opens
- Vault app shell → Vault controller: loads
- Vault controller → API client: requests
- Vault controller → Encryption and keys: encrypts and decrypts
- Vault controller → Password vault: manages
- Vault controller → Secure notes: manages
- Vault controller → Tag management: manages
- Vault controller → Search and copy: supports
- Vault controller → Password tools: provides
- Vault controller → Trash and restore: manages
- API client → Authentication API: calls
- API client → Entries API: calls
- Authentication API → DB and session helpers: uses
- Entries API → DB and session helpers: uses
- DB and session helpers → MySQL data: connects to
- User → Information site: visits
- Information site → Features overview: links to
- Information site → Security details: links to
