# dev-chris06/password-manager architecture

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

- Interactive diagram: https://gitdiagram.com/dev-chris06/password-manager
- Repository: https://github.com/dev-chris06/password-manager

## Overview

This is a procedural PHP password manager: a user signs in, manages a per-user encrypted vault, and can export/import backups or use a Chrome autofill extension. The request flow passes through the PHP entry point and page/AJAX handlers; authentication, vault operations, and cryptography use shared internal modules and MySQL. The README documents audit logging, login rate limits, password changes, and extension support. Some feature files were not sampled, so links for those documented branches are marked as unverified where appropriate.

Main entry points: [`includes/auth.php`](https://github.com/dev-chris06/password-manager/blob/main/includes/auth.php) (Authentication and limits), [`includes/entrees.php`](https://github.com/dev-chris06/password-manager/blob/main/includes/entrees.php) (Vault operations), [`index.php`](https://github.com/dev-chris06/password-manager/blob/main/index.php) (PHP entry point), [`ajax/importer.php`](https://github.com/dev-chris06/password-manager/blob/main/ajax/importer.php) (Import endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Web application"]
  node_entry["PHP entry point<br/>[index.php]"]
  node_router["Public router<br/>[router.php]"]
  node_dashboard["Vault dashboard<br/>[dashboard.php]"]
  node_entry_forms["Entry management<br/>[ajouter.php]"]
  node_edit_form["Edit entry<br/>[modifier.php]"]
  node_generator["Password generator<br/>[generateur.js]"]
end

subgraph group_vault["Vault and crypto"]
  node_vault_ops["Vault operations<br/>[entrees.php]"]
  node_crypto["Encryption functions<br/>[crypto.php]"]
  node_database[("MySQL database<br/>[database.php]")]
  node_backup_page["Backup controls<br/>[backup.php]"]
  node_backup_export["Export endpoint<br/>[exporter.php]"]
  node_backup_import["Import endpoint<br/>[importer.php]"]
  node_decrypt_endpoint["Decrypt endpoint<br/>[dechiffrer.php]"]
  node_extension_endpoint["Extension endpoints"]
end

subgraph group_security["Account security"]
  node_login["Login and registration<br/>[login.php]"]
  node_registration["Account registration<br/>[register.php]"]
  node_auth["Authentication and limits<br/>[auth.php]"]
  node_audit["Audit journal<br/>[journal.php]"]
  node_password_change["Master password change<br/>[changer_mdp.php]"]
  node_config["Application configuration<br/>[config.php]"]
end

subgraph group_extension["Chrome autofill"]
  node_extension["Chrome extension<br/>[content.js]"]
  node_extension_bg["Extension background<br/>[background.js]"]
end

node_user(("User"))
node_browser(("Browser"))

node_user -->|"uses"| node_browser
node_browser -->|"sends requests"| node_router
node_router -->|"routes root"| node_entry
node_entry -->|"checks session"| node_auth
node_entry -->|"redirects"| node_login
node_entry -->|"redirects"| node_dashboard
node_login -->|"authenticates"| node_auth
node_registration -->|"registers account"| node_auth
node_auth -->|"queries"| node_database
node_auth -->|"uses"| node_crypto
node_auth -.->|"loads config"| node_config
node_dashboard -->|"lists entries"| node_vault_ops
node_entry_forms -->|"adds entries"| node_vault_ops
node_edit_form -->|"updates entries"| node_vault_ops
node_vault_ops -->|"requires"| node_auth
node_vault_ops -->|"encrypts and decrypts"| node_crypto
node_vault_ops -->|"reads and writes"| node_database
node_audit -->|"reads journal"| node_auth
node_password_change -->|"requires account"| node_auth
node_password_change -->|"changes master key"| node_vault_ops
node_backup_page -.->|"requests export"| node_backup_export
node_backup_page -.->|"requests import"| node_backup_import
node_backup_export -->|"requires session"| node_auth
node_backup_export -->|"reads vault"| node_vault_ops
node_backup_import -->|"requires session"| node_auth
node_backup_import -->|"decrypts backup"| node_crypto
node_backup_import -->|"imports entries"| node_database
node_decrypt_endpoint -->|"decrypts entry"| node_vault_ops
node_extension -.->|"exchanges messages"| node_extension_bg
node_extension_bg -.->|"calls endpoints"| node_extension_endpoint
node_extension_endpoint -->|"checks session"| node_auth
node_extension_endpoint -.->|"serves autofill data"| node_browser
node_entry_forms -->|"loads script"| node_generator
node_edit_form -->|"loads script"| node_generator
node_config -->|"configures connection"| node_database

click node_entry "https://github.com/dev-chris06/password-manager/blob/main/index.php"
click node_router "https://github.com/dev-chris06/password-manager/blob/main/public/router.php"
click node_login "https://github.com/dev-chris06/password-manager/blob/main/pages/login.php"
click node_registration "https://github.com/dev-chris06/password-manager/blob/main/pages/register.php"
click node_auth "https://github.com/dev-chris06/password-manager/blob/main/includes/auth.php"
click node_dashboard "https://github.com/dev-chris06/password-manager/blob/main/pages/dashboard.php"
click node_entry_forms "https://github.com/dev-chris06/password-manager/blob/main/pages/ajouter.php"
click node_edit_form "https://github.com/dev-chris06/password-manager/blob/main/pages/modifier.php"
click node_vault_ops "https://github.com/dev-chris06/password-manager/blob/main/includes/entrees.php"
click node_crypto "https://github.com/dev-chris06/password-manager/blob/main/includes/crypto.php"
click node_database "https://github.com/dev-chris06/password-manager/blob/main/config/database.php"
click node_audit "https://github.com/dev-chris06/password-manager/blob/main/pages/journal.php"
click node_password_change "https://github.com/dev-chris06/password-manager/blob/main/pages/changer_mdp.php"
click node_backup_page "https://github.com/dev-chris06/password-manager/blob/main/pages/backup.php"
click node_backup_export "https://github.com/dev-chris06/password-manager/blob/main/ajax/exporter.php"
click node_backup_import "https://github.com/dev-chris06/password-manager/blob/main/ajax/importer.php"
click node_decrypt_endpoint "https://github.com/dev-chris06/password-manager/blob/main/ajax/dechiffrer.php"
click node_extension_endpoint "https://github.com/dev-chris06/password-manager/blob/main/ajax/enregistrer_extension.php"
click node_extension "https://github.com/dev-chris06/password-manager/blob/main/extension-chrome/content.js"
click node_extension_bg "https://github.com/dev-chris06/password-manager/blob/main/extension-chrome/background.js"
click node_generator "https://github.com/dev-chris06/password-manager/blob/main/assets/js/generateur.js"
click node_config "https://github.com/dev-chris06/password-manager/blob/main/config/config.php"

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_entry,node_router,node_dashboard,node_entry_forms,node_edit_form,node_generator,node_user,node_browser toneBlue
class node_vault_ops,node_crypto,node_database,node_backup_page,node_backup_export,node_backup_import,node_decrypt_endpoint,node_extension_endpoint toneAmber
class node_login,node_registration,node_auth,node_audit,node_password_change,node_config toneMint
class node_extension,node_extension_bg toneRose
```

## Components

### Web application

- [PHP entry point](https://github.com/dev-chris06/password-manager/blob/main/index.php): `index.php`
- [Public router](https://github.com/dev-chris06/password-manager/blob/main/public/router.php): `public/router.php`
- [Vault dashboard](https://github.com/dev-chris06/password-manager/blob/main/pages/dashboard.php): `pages/dashboard.php`
- [Entry management](https://github.com/dev-chris06/password-manager/blob/main/pages/ajouter.php): `pages/ajouter.php`
- [Edit entry](https://github.com/dev-chris06/password-manager/blob/main/pages/modifier.php): `pages/modifier.php`
- [Password generator](https://github.com/dev-chris06/password-manager/blob/main/assets/js/generateur.js): `assets/js/generateur.js`

### Vault and crypto

- [Vault operations](https://github.com/dev-chris06/password-manager/blob/main/includes/entrees.php): `includes/entrees.php`
- [Encryption functions](https://github.com/dev-chris06/password-manager/blob/main/includes/crypto.php): `includes/crypto.php`
- [MySQL database](https://github.com/dev-chris06/password-manager/blob/main/config/database.php): `config/database.php`
- [Backup controls](https://github.com/dev-chris06/password-manager/blob/main/pages/backup.php): `pages/backup.php`
- [Export endpoint](https://github.com/dev-chris06/password-manager/blob/main/ajax/exporter.php): `ajax/exporter.php`
- [Import endpoint](https://github.com/dev-chris06/password-manager/blob/main/ajax/importer.php): `ajax/importer.php`
- [Decrypt endpoint](https://github.com/dev-chris06/password-manager/blob/main/ajax/dechiffrer.php): `ajax/dechiffrer.php`
- [Extension endpoints](https://github.com/dev-chris06/password-manager/blob/main/ajax/enregistrer_extension.php): `ajax/enregistrer_extension.php`

### Account security

- [Login and registration](https://github.com/dev-chris06/password-manager/blob/main/pages/login.php): `pages/login.php`
- [Account registration](https://github.com/dev-chris06/password-manager/blob/main/pages/register.php): `pages/register.php`
- [Authentication and limits](https://github.com/dev-chris06/password-manager/blob/main/includes/auth.php): `includes/auth.php`
- [Audit journal](https://github.com/dev-chris06/password-manager/blob/main/pages/journal.php): `pages/journal.php`
- [Master password change](https://github.com/dev-chris06/password-manager/blob/main/pages/changer_mdp.php): `pages/changer_mdp.php`
- [Application configuration](https://github.com/dev-chris06/password-manager/blob/main/config/config.php): `config/config.php`

### Chrome autofill

- [Chrome extension](https://github.com/dev-chris06/password-manager/blob/main/extension-chrome/content.js): `extension-chrome/content.js`
- [Extension background](https://github.com/dev-chris06/password-manager/blob/main/extension-chrome/background.js): `extension-chrome/background.js`

### Other components

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

## Connections

- User → Browser: uses (evidence: `README.md`)
- Browser → Public router: sends requests (evidence: `README.md`)
- Public router → PHP entry point: routes root (evidence: `public/router.php`)
- PHP entry point → Authentication and limits: checks session (evidence: `index.php`)
- PHP entry point → Login and registration: redirects (evidence: `index.php`)
- PHP entry point → Vault dashboard: redirects (evidence: `index.php`)
- Login and registration → Authentication and limits: authenticates (evidence: `pages/login.php`)
- Account registration → Authentication and limits: registers account (evidence: `pages/register.php`)
- Authentication and limits → MySQL database: queries (evidence: `includes/auth.php`)
- Authentication and limits → Encryption functions: uses (evidence: `includes/auth.php`)
- Authentication and limits → Application configuration: loads config
- Vault dashboard → Vault operations: lists entries (evidence: `pages/dashboard.php`)
- Entry management → Vault operations: adds entries (evidence: `pages/ajouter.php`)
- Edit entry → Vault operations: updates entries (evidence: `pages/modifier.php`)
- Vault operations → Authentication and limits: requires (evidence: `includes/entrees.php`)
- Vault operations → Encryption functions: encrypts and decrypts (evidence: `includes/entrees.php`)
- Vault operations → MySQL database: reads and writes (evidence: `README.md`)
- Audit journal → Authentication and limits: reads journal (evidence: `pages/journal.php`)
- Master password change → Authentication and limits: requires account
- Master password change → Vault operations: changes master key (evidence: `README.md`)
- Backup controls → Export endpoint: requests export
- Backup controls → Import endpoint: requests import
- Export endpoint → Authentication and limits: requires session (evidence: `ajax/exporter.php`)
- Export endpoint → Vault operations: reads vault (evidence: `ajax/exporter.php`)
- Import endpoint → Authentication and limits: requires session (evidence: `ajax/importer.php`)
- Import endpoint → Encryption functions: decrypts backup (evidence: `ajax/importer.php`)
- Import endpoint → MySQL database: imports entries (evidence: `ajax/importer.php`)
- Decrypt endpoint → Vault operations: decrypts entry (evidence: `ajax/dechiffrer.php`)
- Chrome extension → Extension background: exchanges messages
- Extension background → Extension endpoints: calls endpoints
- Extension endpoints → Authentication and limits: checks session
- Extension endpoints → Browser: serves autofill data (evidence: `README.md`)
- Entry management → Password generator: loads script (evidence: `pages/ajouter.php`)
- Edit entry → Password generator: loads script (evidence: `pages/modifier.php`)
- Application configuration → MySQL database: configures connection (evidence: `config/database.php`)
