# ayush-vyas/password-manager architecture

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

- Interactive diagram: https://gitdiagram.com/ayush-vyas/password-manager
- Repository: https://github.com/ayush-vyas/password-manager

## Overview

This is a PHP password manager: users authenticate, reach a dashboard, and manage saved website credentials, with import/export and OTP password recovery also advertised. The dashboard excerpt confirms session gating, reads vault rows, and routes to credential actions. The README describes encrypted storage and MySQL, but the database configuration and several implementation details are absent from the tree or excerpts, so those internals are not inferred. The bundled PHPMailer library supports the shown recovery-email flow; its broader transport internals are represented only where source excerpts establish them.

Main entry points: [`dashboard.php`](https://github.com/ayush-vyas/password-manager/blob/main/dashboard.php) (Vault dashboard), [`forgot.php`](https://github.com/ayush-vyas/password-manager/blob/main/forgot.php) (Recovery mailer), [`PHPMailer-master/src/PHPMailer.php`](https://github.com/ayush-vyas/password-manager/blob/main/PHPMailer-master/src/PHPMailer.php) (Message composer), [`login.php`](https://github.com/ayush-vyas/password-manager/blob/main/login.php) (Login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and recovery"]
  node_login["Login<br/>[login.php]"]
  node_registration["Registration<br/>[register.php]"]
  node_logout["Logout<br/>[logout.php]"]
  node_recovery["OTP recovery<br/>[forgot.php]"]
  node_otpverify["OTP verification<br/>[verify_otp.php]"]
end

subgraph group_vault["Credential management"]
  node_dashboard["Vault dashboard<br/>[dashboard.php]"]
  node_add["Add credential<br/>[add.php]"]
  node_view["View credential<br/>[view.php]"]
  node_edit["Edit credential<br/>[edit.php]"]
  node_delete["Delete credential<br/>[delete.php]"]
  node_import["Import credentials<br/>[import.php]"]
  node_export["Export credentials<br/>[export.php]"]
  node_vaultdb[("MySQL vault")]
end

subgraph group_mail["Mail delivery"]
  node_mailerclient["Recovery mailer<br/>[forgot.php]"]
end

subgraph group_mailer["PHPMailer runtime"]
  node_phpmailer["Message composer<br/>[PHPMailer.php]"]
  node_smtp["SMTP transport<br/>[SMTP.php]"]
  node_exceptions["Mail exceptions<br/>[Exception.php]"]
end

node_user(("User"))

node_user -->|"signs in"| node_login
node_user -->|"registers"| node_registration
node_user -->|"manages vault"| node_dashboard
node_dashboard -->|"redirects unauthenticated"| node_login
node_user -->|"requests reset"| node_recovery
node_recovery -->|"sends OTP"| node_mailerclient
node_user -.->|"submits OTP"| node_otpverify
node_user -->|"logs out"| node_logout
node_dashboard -->|"reads vault rows"| node_vaultdb
node_dashboard -->|"links to add"| node_add
node_dashboard -->|"links to import"| node_import
node_dashboard -->|"links to export"| node_export
node_dashboard -->|"links to view"| node_view
node_dashboard -->|"links to edit"| node_edit
node_dashboard -->|"links to delete"| node_delete
node_dashboard -->|"lists credentials"| node_vaultdb
node_mailerclient -->|"creates and sends"| node_phpmailer
node_phpmailer -->|"uses transport"| node_smtp
node_mailerclient -->|"catches errors"| node_exceptions
node_phpmailer -->|"throws errors"| node_exceptions

click node_login "https://github.com/ayush-vyas/password-manager/blob/main/login.php"
click node_registration "https://github.com/ayush-vyas/password-manager/blob/main/register.php"
click node_logout "https://github.com/ayush-vyas/password-manager/blob/main/logout.php"
click node_recovery "https://github.com/ayush-vyas/password-manager/blob/main/forgot.php"
click node_otpverify "https://github.com/ayush-vyas/password-manager/blob/main/verify_otp.php"
click node_dashboard "https://github.com/ayush-vyas/password-manager/blob/main/dashboard.php"
click node_add "https://github.com/ayush-vyas/password-manager/blob/main/add.php"
click node_view "https://github.com/ayush-vyas/password-manager/blob/main/view.php"
click node_edit "https://github.com/ayush-vyas/password-manager/blob/main/edit.php"
click node_delete "https://github.com/ayush-vyas/password-manager/blob/main/delete.php"
click node_import "https://github.com/ayush-vyas/password-manager/blob/main/import.php"
click node_export "https://github.com/ayush-vyas/password-manager/blob/main/export.php"
click node_mailerclient "https://github.com/ayush-vyas/password-manager/blob/main/forgot.php"
click node_phpmailer "https://github.com/ayush-vyas/password-manager/blob/main/PHPMailer-master/src/PHPMailer.php"
click node_smtp "https://github.com/ayush-vyas/password-manager/blob/main/PHPMailer-master/src/SMTP.php"
click node_exceptions "https://github.com/ayush-vyas/password-manager/blob/main/PHPMailer-master/src/Exception.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_login,node_registration,node_logout,node_recovery,node_otpverify,node_user toneBlue
class node_dashboard,node_add,node_view,node_edit,node_delete,node_import,node_export,node_vaultdb toneAmber
class node_mailerclient toneMint
class node_phpmailer,node_smtp,node_exceptions toneRose
```

## Components

### Access and recovery

- [Login](https://github.com/ayush-vyas/password-manager/blob/main/login.php): `login.php`
- [Registration](https://github.com/ayush-vyas/password-manager/blob/main/register.php): `register.php`
- [Logout](https://github.com/ayush-vyas/password-manager/blob/main/logout.php): `logout.php`
- [OTP recovery](https://github.com/ayush-vyas/password-manager/blob/main/forgot.php): `forgot.php`
- [OTP verification](https://github.com/ayush-vyas/password-manager/blob/main/verify_otp.php): `verify_otp.php`

### Credential management

- [Vault dashboard](https://github.com/ayush-vyas/password-manager/blob/main/dashboard.php): `dashboard.php`
- [Add credential](https://github.com/ayush-vyas/password-manager/blob/main/add.php): `add.php`
- [View credential](https://github.com/ayush-vyas/password-manager/blob/main/view.php): `view.php`
- [Edit credential](https://github.com/ayush-vyas/password-manager/blob/main/edit.php): `edit.php`
- [Delete credential](https://github.com/ayush-vyas/password-manager/blob/main/delete.php): `delete.php`
- [Import credentials](https://github.com/ayush-vyas/password-manager/blob/main/import.php): `import.php`
- [Export credentials](https://github.com/ayush-vyas/password-manager/blob/main/export.php): `export.php`
- **MySQL vault**

### Mail delivery

- [Recovery mailer](https://github.com/ayush-vyas/password-manager/blob/main/forgot.php): `forgot.php`

### PHPMailer runtime

- [Message composer](https://github.com/ayush-vyas/password-manager/blob/main/PHPMailer-master/src/PHPMailer.php): `PHPMailer-master/src/PHPMailer.php`
- [SMTP transport](https://github.com/ayush-vyas/password-manager/blob/main/PHPMailer-master/src/SMTP.php): `PHPMailer-master/src/SMTP.php`
- [Mail exceptions](https://github.com/ayush-vyas/password-manager/blob/main/PHPMailer-master/src/Exception.php): `PHPMailer-master/src/Exception.php`

### Other components

- **User**

## Connections

- User → Login: signs in (evidence: `README.md`)
- User → Registration: registers (evidence: `README.md`)
- User → Vault dashboard: manages vault (evidence: `README.md`)
- Vault dashboard → Login: redirects unauthenticated (evidence: `dashboard.php`)
- User → OTP recovery: requests reset (evidence: `README.md`)
- OTP recovery → Recovery mailer: sends OTP (evidence: `forgot.php`)
- User → OTP verification: submits OTP
- User → Logout: logs out (evidence: `README.md`)
- Vault dashboard → MySQL vault: reads vault rows (evidence: `dashboard.php`)
- Vault dashboard → Add credential: links to add (evidence: `dashboard.php`)
- Vault dashboard → Import credentials: links to import (evidence: `dashboard.php`)
- Vault dashboard → Export credentials: links to export (evidence: `dashboard.php`)
- Vault dashboard → View credential: links to view (evidence: `dashboard.php`)
- Vault dashboard → Edit credential: links to edit (evidence: `dashboard.php`)
- Vault dashboard → Delete credential: links to delete (evidence: `dashboard.php`)
- Vault dashboard → MySQL vault: lists credentials (evidence: `README.md`)
- Recovery mailer → Message composer: creates and sends (evidence: `forgot.php`)
- Message composer → SMTP transport: uses transport (evidence: `PHPMailer-master/src/PHPMailer.php`)
- Recovery mailer → Mail exceptions: catches errors (evidence: `forgot.php`)
- Message composer → Mail exceptions: throws errors (evidence: `PHPMailer-master/src/PHPMailer.php`)
