# dharanigovardhan2008/safethelock architecture

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

- Interactive diagram: https://gitdiagram.com/dharanigovardhan2008/safethelock
- Repository: https://github.com/dharanigovardhan2008/safethelock

## Overview

SafetheLock is a browser password vault and project-credential organizer. Users sign in with Google, create or verify a PIN, then manage searchable password and project records; the app encrypts selected credential fields and synchronizes records with Firestore. The graph covers the sampled app orchestration, auth gate, forms, cards, and Firebase setup. Password-form and card internals were not sampled, so their detailed behavior is omitted; README-described encryption and Firebase capabilities are retained where supported.

Main entry points: [`src/App.tsx`](https://github.com/dharanigovardhan2008/safethelock/blob/main/src/App.tsx) (Vault orchestration), [`src/components/AuthScreen.tsx`](https://github.com/dharanigovardhan2008/safethelock/blob/main/src/components/AuthScreen.tsx) (Sign-in and PIN), [`src/firebase.ts`](https://github.com/dharanigovardhan2008/safethelock/blob/main/src/firebase.ts) (Firebase setup), [`src/main.tsx`](https://github.com/dharanigovardhan2008/safethelock/blob/main/src/main.tsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access control"]
  node_authscreen["Sign-in and PIN<br/>[AuthScreen.tsx]"]
end

subgraph group_workspace["Vault workspace"]
  node_entry["React entry<br/>[main.tsx]"]
  node_app["Vault orchestration<br/>[App.tsx]"]
  node_crypto["Credential encryption<br/>[App.tsx]"]
end

subgraph group_ui["Record interfaces"]
  node_passwordform["Password form"]
  node_passwordcard["Password card<br/>[PasswordCard.tsx]"]
  node_projectform["Project form"]
  node_projectcard["Project card<br/>[ProjectCard.tsx]"]
end

subgraph group_backend["Cloud services"]
  node_firebase["Firebase setup<br/>[firebase.ts]"]
  node_firebaseauth["Firebase Authentication"]
  node_firestore[("Cloud Firestore")]
end

node_user(("Vault user"))

node_user -->|"opens app"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"gates access"| node_authscreen
node_authscreen -->|"uses services"| node_firebase
node_firebase -->|"configures"| node_firebaseauth
node_firebase -->|"configures"| node_firestore
node_authscreen -->|"signs in"| node_firebaseauth
node_authscreen -->|"reads/writes PIN"| node_firestore
node_authscreen -->|"unlocks children"| node_app
node_app -->|"syncs records"| node_firestore
node_app -->|"encrypts/decrypts fields"| node_crypto
node_app -->|"opens and saves"| node_passwordform
node_app -->|"renders records"| node_passwordcard
node_app -->|"opens and saves"| node_projectform
node_app -->|"renders records"| node_projectcard
node_projectcard -->|"copies or opens links"| node_user

click node_entry "https://github.com/dharanigovardhan2008/safethelock/blob/main/src/main.tsx"
click node_authscreen "https://github.com/dharanigovardhan2008/safethelock/blob/main/src/components/AuthScreen.tsx"
click node_app "https://github.com/dharanigovardhan2008/safethelock/blob/main/src/App.tsx"
click node_passwordform "https://github.com/dharanigovardhan2008/safethelock/blob/main/src/components/AddPasswordModal.tsx"
click node_passwordcard "https://github.com/dharanigovardhan2008/safethelock/blob/main/src/components/PasswordCard.tsx"
click node_projectform "https://github.com/dharanigovardhan2008/safethelock/blob/main/src/components/AddProjectModal.tsx"
click node_projectcard "https://github.com/dharanigovardhan2008/safethelock/blob/main/src/components/ProjectCard.tsx"
click node_firebase "https://github.com/dharanigovardhan2008/safethelock/blob/main/src/firebase.ts"
click node_crypto "https://github.com/dharanigovardhan2008/safethelock/blob/main/src/App.tsx"

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_authscreen,node_user toneBlue
class node_entry,node_app,node_crypto toneAmber
class node_passwordform,node_passwordcard,node_projectform,node_projectcard toneMint
class node_firebase,node_firebaseauth,node_firestore toneRose
```

## Components

### Access control

- [Sign-in and PIN](https://github.com/dharanigovardhan2008/safethelock/blob/main/src/components/AuthScreen.tsx): `src/components/AuthScreen.tsx`

### Vault workspace

- [React entry](https://github.com/dharanigovardhan2008/safethelock/blob/main/src/main.tsx): `src/main.tsx`
- [Vault orchestration](https://github.com/dharanigovardhan2008/safethelock/blob/main/src/App.tsx): `src/App.tsx`
- [Credential encryption](https://github.com/dharanigovardhan2008/safethelock/blob/main/src/App.tsx): `src/App.tsx`

### Record interfaces

- [Password form](https://github.com/dharanigovardhan2008/safethelock/blob/main/src/components/AddPasswordModal.tsx): `src/components/AddPasswordModal.tsx`
- [Password card](https://github.com/dharanigovardhan2008/safethelock/blob/main/src/components/PasswordCard.tsx): `src/components/PasswordCard.tsx`
- [Project form](https://github.com/dharanigovardhan2008/safethelock/blob/main/src/components/AddProjectModal.tsx): `src/components/AddProjectModal.tsx`
- [Project card](https://github.com/dharanigovardhan2008/safethelock/blob/main/src/components/ProjectCard.tsx): `src/components/ProjectCard.tsx`

### Cloud services

- [Firebase setup](https://github.com/dharanigovardhan2008/safethelock/blob/main/src/firebase.ts): `src/firebase.ts`
- **Firebase Authentication**
- **Cloud Firestore**

### Other components

- **Vault user**

## Connections

- Vault user → React entry: opens app (evidence: `src/main.tsx`)
- React entry → Vault orchestration: renders (evidence: `src/main.tsx`)
- Vault orchestration → Sign-in and PIN: gates access (evidence: `src/App.tsx`)
- Sign-in and PIN → Firebase setup: uses services (evidence: `src/components/AuthScreen.tsx`)
- Firebase setup → Firebase Authentication: configures (evidence: `src/firebase.ts`)
- Firebase setup → Cloud Firestore: configures (evidence: `src/firebase.ts`)
- Sign-in and PIN → Firebase Authentication: signs in (evidence: `src/components/AuthScreen.tsx`)
- Sign-in and PIN → Cloud Firestore: reads/writes PIN (evidence: `src/components/AuthScreen.tsx`)
- Sign-in and PIN → Vault orchestration: unlocks children (evidence: `src/components/AuthScreen.tsx`)
- Vault orchestration → Cloud Firestore: syncs records (evidence: `src/App.tsx`)
- Vault orchestration → Credential encryption: encrypts/decrypts fields (evidence: `src/App.tsx`)
- Vault orchestration → Password form: opens and saves (evidence: `src/App.tsx`)
- Vault orchestration → Password card: renders records (evidence: `src/App.tsx`)
- Vault orchestration → Project form: opens and saves (evidence: `src/App.tsx`)
- Vault orchestration → Project card: renders records (evidence: `src/App.tsx`)
- Project card → Vault user: copies or opens links (evidence: `src/components/ProjectCard.tsx`)
