# kunalsambyal/safevault-passwordmanager architecture

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

- Interactive diagram: https://gitdiagram.com/kunalsambyal/safevault-passwordmanager
- Repository: https://github.com/kunalsambyal/safevault-passwordmanager

## Overview

This is an Expo/React Native SafeVault scaffold. Its visible runtime currently registers a placeholder screen; the sampled data layer provisions SQLite tables and exposes vault-metadata operations, while a credentials repository is present in the tree but unsampled. No README documents broader user workflows, and the excerpts show no credential UI, encryption flow, or vault-unlock orchestration, so those relationships are not inferred.

Main entry points: [`app/src/db/connection.ts`](https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/src/db/connection.ts) (Database connection), [`app/src/db/metadataRepository.ts`](https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/src/db/metadataRepository.ts) (Vault metadata), [`app/index.ts`](https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/index.ts) (Expo entry), [`app/App.tsx`](https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/App.tsx) (Placeholder screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Mobile app"]
  node_entry["Expo entry<br/>[index.ts]"]
  node_screen["Placeholder screen<br/>[App.tsx]"]
end

subgraph group_storage["Vault storage"]
  node_dbconn["Database connection<br/>[connection.ts]"]
  node_schema["SQLite schema<br/>[schema.ts]"]
  node_vaultmeta["Vault metadata"]
  node_credentials["Credential repository"]
  node_dbtypes["Database types<br/>[database.ts]"]
end

subgraph group_security["Platform security"]
  node_secureflag["Secure window flag<br/>[withFlagSecure.js]"]
end

node_user(("User"))
node_sqlite["Expo SQLite"]
node_store[("Local SQLite file")]

node_user -->|"opens app"| node_entry
node_entry -->|"registers"| node_screen
node_dbconn -->|"opens database"| node_sqlite
node_dbconn -->|"executes schema"| node_schema
node_dbconn -->|"initializes"| node_store
node_vaultmeta -->|"gets database"| node_dbconn
node_vaultmeta -->|"reads and writes metadata"| node_store
node_vaultmeta -->|"uses metadata type"| node_dbtypes

click node_entry "https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/index.ts"
click node_screen "https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/App.tsx"
click node_dbconn "https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/src/db/connection.ts"
click node_schema "https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/src/db/schema.ts"
click node_vaultmeta "https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/src/db/metadataRepository.ts"
click node_credentials "https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/src/db/credentialsRepository.ts"
click node_dbtypes "https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/src/types/database.ts"
click node_secureflag "https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/plugins/withFlagSecure.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_entry,node_screen,node_user toneBlue
class node_dbconn,node_schema,node_vaultmeta,node_credentials,node_dbtypes,node_sqlite,node_store toneAmber
class node_secureflag toneMint
```

## Components

### Mobile app

- [Expo entry](https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/index.ts): `app/index.ts`
- [Placeholder screen](https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/App.tsx): `app/App.tsx`

### Vault storage

- [Database connection](https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/src/db/connection.ts): `app/src/db/connection.ts`
- [SQLite schema](https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/src/db/schema.ts): `app/src/db/schema.ts`
- [Vault metadata](https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/src/db/metadataRepository.ts): `app/src/db/metadataRepository.ts`
- [Credential repository](https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/src/db/credentialsRepository.ts): `app/src/db/credentialsRepository.ts`
- [Database types](https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/src/types/database.ts): `app/src/types/database.ts`

### Platform security

- [Secure window flag](https://github.com/kunalsambyal/safevault-passwordmanager/blob/main/app/plugins/withFlagSecure.js): `app/plugins/withFlagSecure.js`

### Other components

- **User**
- **Expo SQLite**
- **Local SQLite file**

## Connections

- User → Expo entry: opens app (evidence: `app/index.ts`)
- Expo entry → Placeholder screen: registers (evidence: `app/index.ts`)
- Database connection → Expo SQLite: opens database (evidence: `app/src/db/connection.ts`)
- Database connection → SQLite schema: executes schema (evidence: `app/src/db/connection.ts`)
- Database connection → Local SQLite file: initializes (evidence: `app/src/db/connection.ts`)
- Vault metadata → Database connection: gets database (evidence: `app/src/db/metadataRepository.ts`)
- Vault metadata → Local SQLite file: reads and writes metadata (evidence: `app/src/db/metadataRepository.ts`)
- Vault metadata → Database types: uses metadata type (evidence: `app/src/db/metadataRepository.ts`)
