# paldhaduk7-png/password-manger architecture

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

- Interactive diagram: https://gitdiagram.com/paldhaduk7-png/password-manger
- Repository: https://github.com/paldhaduk7-png/password-manger

## Overview

PassOP is a web password manager with account authentication, a credential vault, profile management, and password recovery. Users enter through the React app, authenticate or create an account, then manage saved credentials and their profile; recovery uses an OTP emailed to the account. The backend exposes user and password API routes backed by MongoDB, with optional Google sign-in and Cloudinary profile images. Password-route handlers and several frontend pages were not sampled, so their internal calls are not asserted; dashed links mark unverified API connections.

Main entry points: [`Frontend/src/App.jsx`](https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/App.jsx) (React app routes), [`Backend/server.js`](https://github.com/paldhaduk7-png/password-manger/blob/main/Backend/server.js) (Express API), [`Backend/controllers/user.js`](https://github.com/paldhaduk7-png/password-manger/blob/main/Backend/controllers/user.js) (Account controller), [`Frontend/src/auth/Signup.jsx`](https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/auth/Signup.jsx) (Sign-in and signup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["React app routes<br/>[App.jsx]"]
  node_authstate["Auth state<br/>[AuthContext.jsx]"]
  node_theme["Theme state<br/>[ThemeContext.jsx]"]
end

subgraph group_identity["Identity and profiles"]
  node_authforms["Sign-in and signup<br/>[Signup.jsx]"]
  node_googlebutton["Google sign-in"]
  node_recoveryui["Password recovery UI<br/>[ForgotPassword.jsx]"]
  node_profileui["Profile screens<br/>[Profile.jsx]"]
  node_otpcontroller["OTP recovery<br/>[otpController.js]"]
  node_usercontroller["Account controller<br/>[user.js]"]
end

subgraph group_vault["Password vault"]
  node_home["Vault home<br/>[Home.jsx]"]
  node_display["Credential display<br/>[Display.jsx]"]
  node_update["Credential editor<br/>[Update.jsx]"]
  node_saved["Saved credentials<br/>[SavedPasswords.jsx]"]
  node_passwordmodel[("Password records<br/>[Password.js]")]
end

subgraph group_backend["Backend and storage"]
  node_api["Express API<br/>[server.js]"]
  node_userroutes["User and OTP routes<br/>[user.js]"]
  node_passwordroutes["Password routes<br/>[passwordRoutes.js]"]
  node_usermodel[("User records<br/>[user.js]")]
  node_email["Email delivery<br/>[sendEmail.js]"]
  node_mongo[("MongoDB")]
end

node_user(("User"))
node_cloudinary[("Cloudinary")]
node_google["Google identity"]
node_mailservice["Email service"]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_authforms
node_app -->|"routes to"| node_recoveryui
node_app -->|"routes to"| node_profileui
node_app -->|"routes to"| node_saved
node_app -->|"routes to"| node_update
node_authforms -->|"uses"| node_authstate
node_authforms -->|"renders"| node_googlebutton
node_googlebutton -->|"uses"| node_authstate
node_authstate -.->|"API calls"| node_api
node_home -->|"renders"| node_display
node_display -.->|"edits credentials"| node_update
node_home -.->|"loads vault"| node_api
node_update -.->|"saves credentials"| node_api
node_saved -.->|"loads saved"| node_api
node_profileui -.->|"profile requests"| node_api
node_api -->|"mounts at"| node_userroutes
node_api -->|"mounts at"| node_passwordroutes
node_userroutes -->|"routes requests"| node_usercontroller
node_userroutes -->|"mounts OTP routes"| node_otpcontroller
node_passwordroutes -.->|"uses records"| node_passwordmodel
node_usercontroller -->|"reads and writes"| node_usermodel
node_otpcontroller -->|"reads and writes"| node_usermodel
node_otpcontroller -->|"sends recovery"| node_email
node_email -.->|"delivers mail"| node_mailservice
node_usercontroller -->|"uploads images"| node_cloudinary
node_usercontroller -->|"verifies token"| node_google
node_api -.->|"connects"| node_mongo
node_usermodel -.->|"persists users"| node_mongo
node_passwordmodel -.->|"persists credentials"| node_mongo
node_app -->|"reads theme"| node_theme

click node_app "https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/App.jsx"
click node_authstate "https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/ContextAPI/AuthContext.jsx"
click node_theme "https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/ContextAPI/ThemeContext.jsx"
click node_authforms "https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/auth/Signup.jsx"
click node_googlebutton "https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/auth/GoogleLoginButton.jsx"
click node_recoveryui "https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/auth/ForgotPassword.jsx"
click node_profileui "https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/pages/Profile.jsx"
click node_home "https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/pages/Home.jsx"
click node_display "https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/pages/Display.jsx"
click node_update "https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/pages/Update.jsx"
click node_saved "https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/pages/SavedPasswords.jsx"
click node_api "https://github.com/paldhaduk7-png/password-manger/blob/main/Backend/server.js"
click node_userroutes "https://github.com/paldhaduk7-png/password-manger/blob/main/Backend/routes/user.js"
click node_otpcontroller "https://github.com/paldhaduk7-png/password-manger/blob/main/Backend/controllers/otpController.js"
click node_usercontroller "https://github.com/paldhaduk7-png/password-manger/blob/main/Backend/controllers/user.js"
click node_passwordroutes "https://github.com/paldhaduk7-png/password-manger/blob/main/Backend/routes/passwordRoutes.js"
click node_passwordmodel "https://github.com/paldhaduk7-png/password-manger/blob/main/Backend/models/Password.js"
click node_usermodel "https://github.com/paldhaduk7-png/password-manger/blob/main/Backend/models/user.js"
click node_email "https://github.com/paldhaduk7-png/password-manger/blob/main/Backend/utils/sendEmail.js"

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_app,node_authstate,node_theme,node_user toneBlue
class node_authforms,node_googlebutton,node_recoveryui,node_profileui,node_otpcontroller,node_usercontroller,node_cloudinary toneAmber
class node_home,node_display,node_update,node_saved,node_passwordmodel toneMint
class node_api,node_userroutes,node_passwordroutes,node_usermodel,node_email,node_mongo toneRose
class node_google,node_mailservice toneIndigo
```

## Components

### Web application

- [React app routes](https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/App.jsx): `Frontend/src/App.jsx`
- [Auth state](https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/ContextAPI/AuthContext.jsx): `Frontend/src/ContextAPI/AuthContext.jsx`
- [Theme state](https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/ContextAPI/ThemeContext.jsx): `Frontend/src/ContextAPI/ThemeContext.jsx`

### Identity and profiles

- [Sign-in and signup](https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/auth/Signup.jsx): `Frontend/src/auth/Signup.jsx`
- [Google sign-in](https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/auth/GoogleLoginButton.jsx): `Frontend/src/auth/GoogleLoginButton.jsx`
- [Password recovery UI](https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/auth/ForgotPassword.jsx): `Frontend/src/auth/ForgotPassword.jsx`
- [Profile screens](https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/pages/Profile.jsx): `Frontend/src/pages/Profile.jsx`
- [OTP recovery](https://github.com/paldhaduk7-png/password-manger/blob/main/Backend/controllers/otpController.js): `Backend/controllers/otpController.js`
- [Account controller](https://github.com/paldhaduk7-png/password-manger/blob/main/Backend/controllers/user.js): `Backend/controllers/user.js`

### Password vault

- [Vault home](https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/pages/Home.jsx): `Frontend/src/pages/Home.jsx`
- [Credential display](https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/pages/Display.jsx): `Frontend/src/pages/Display.jsx`
- [Credential editor](https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/pages/Update.jsx): `Frontend/src/pages/Update.jsx`
- [Saved credentials](https://github.com/paldhaduk7-png/password-manger/blob/main/Frontend/src/pages/SavedPasswords.jsx): `Frontend/src/pages/SavedPasswords.jsx`
- [Password records](https://github.com/paldhaduk7-png/password-manger/blob/main/Backend/models/Password.js): `Backend/models/Password.js`

### Backend and storage

- [Express API](https://github.com/paldhaduk7-png/password-manger/blob/main/Backend/server.js): `Backend/server.js`
- [User and OTP routes](https://github.com/paldhaduk7-png/password-manger/blob/main/Backend/routes/user.js): `Backend/routes/user.js`
- [Password routes](https://github.com/paldhaduk7-png/password-manger/blob/main/Backend/routes/passwordRoutes.js): `Backend/routes/passwordRoutes.js`
- [User records](https://github.com/paldhaduk7-png/password-manger/blob/main/Backend/models/user.js): `Backend/models/user.js`
- [Email delivery](https://github.com/paldhaduk7-png/password-manger/blob/main/Backend/utils/sendEmail.js): `Backend/utils/sendEmail.js`
- **MongoDB**

### Other components

- **User**
- **Cloudinary**
- **Google identity**
- **Email service**

## Connections

- User → React app routes: uses
- React app routes → Vault home: routes to (evidence: `Frontend/src/App.jsx`)
- React app routes → Sign-in and signup: routes to (evidence: `Frontend/src/App.jsx`)
- React app routes → Password recovery UI: routes to (evidence: `Frontend/src/App.jsx`)
- React app routes → Profile screens: routes to (evidence: `Frontend/src/App.jsx`)
- React app routes → Saved credentials: routes to (evidence: `Frontend/src/App.jsx`)
- React app routes → Credential editor: routes to (evidence: `Frontend/src/App.jsx`)
- Sign-in and signup → Auth state: uses
- Sign-in and signup → Google sign-in: renders (evidence: `Frontend/src/auth/Signup.jsx`)
- Google sign-in → Auth state: uses (evidence: `Frontend/src/auth/GoogleLoginButton.jsx`)
- Auth state → Express API: API calls
- Vault home → Credential display: renders (evidence: `Frontend/src/pages/Home.jsx`)
- Credential display → Credential editor: edits credentials
- Vault home → Express API: loads vault
- Credential editor → Express API: saves credentials
- Saved credentials → Express API: loads saved
- Profile screens → Express API: profile requests
- Express API → User and OTP routes: mounts at (evidence: `Backend/server.js`)
- Express API → Password routes: mounts at (evidence: `Backend/server.js`)
- User and OTP routes → Account controller: routes requests (evidence: `Backend/routes/user.js`)
- User and OTP routes → OTP recovery: mounts OTP routes (evidence: `Backend/routes/user.js`)
- Password routes → Password records: uses records
- Account controller → User records: reads and writes (evidence: `Backend/controllers/user.js`)
- OTP recovery → User records: reads and writes (evidence: `Backend/controllers/otpController.js`)
- OTP recovery → Email delivery: sends recovery (evidence: `Backend/controllers/otpController.js`)
- Email delivery → Email service: delivers mail
- Account controller → Cloudinary: uploads images (evidence: `Backend/controllers/user.js`)
- Account controller → Google identity: verifies token (evidence: `Backend/controllers/user.js`)
- Express API → MongoDB: connects
- User records → MongoDB: persists users
- Password records → MongoDB: persists credentials
- React app routes → Theme state: reads theme (evidence: `Frontend/src/App.jsx`)
