# hariharen9/scync architecture

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

- Interactive diagram: https://gitdiagram.com/hariharen9/scync
- Repository: https://github.com/hariharen9/scync

## Overview

Scync is a cross-platform, zero-knowledge secrets manager. Its main workflow is sign in, set up or unlock the encrypted vault, then find and use a secret; project organization, import/export, SSH keys, TOTP, certificates, and secure sharing extend that workflow. The web app routes through authentication and vault guards, while shared UI state and core cryptography/cloud modules support the product. Some feature wiring is documented in the README but its implementation was not sampled, so those subsystems are represented without speculative call edges.

Main entry points: [`apps/web/src/App.tsx`](https://github.com/hariharen9/scync/blob/main/apps/web/src/App.tsx) (Web app), [`packages/ui/src/components/VaultGuard.tsx`](https://github.com/hariharen9/scync/blob/main/packages/ui/src/components/VaultGuard.tsx) (Vault guard), [`packages/ui/src/components/Dashboard.tsx`](https://github.com/hariharen9/scync/blob/main/packages/ui/src/components/Dashboard.tsx) (Secret dashboard), [`packages/core/src/crypto.ts`](https://github.com/hariharen9/scync/blob/main/packages/core/src/crypto.ts) (Encryption and crypto)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["App clients"]
  node_web["Web app<br/>[App.tsx]"]
  node_desktop["Desktop shell<br/>[main.ts]"]
end

subgraph group_access["Access and vault"]
  node_authguard["Auth guard<br/>[AuthGuard.tsx]"]
  node_authpage["Sign in<br/>[AuthPage.tsx]"]
  node_setup["Vault setup<br/>[SetupPage.tsx]"]
  node_unlock["Vault unlock<br/>[UnlockPage.tsx]"]
  node_vaultguard["Vault guard<br/>[VaultGuard.tsx]"]
end

subgraph group_features["Secret workflows"]
  node_vaultpage["Vault workspace<br/>[VaultPage.tsx]"]
  node_dashboard["Secret dashboard<br/>[Dashboard.tsx]"]
  node_vaultstore["Vault state<br/>[vaultStore.ts]"]
  node_projectstore["Project state<br/>[projectStore.ts]"]
  node_service["Service state<br/>[serviceStore.ts]"]
  node_envimport["Environment import<br/>[EnvImportModal.tsx]"]
  node_totp["TOTP manager<br/>[TOTPDashboard.tsx]"]
  node_ssh["SSH manager"]
  node_certs["Certificate manager"]
  node_sharing["Share management<br/>[shareStore.ts]"]
  node_consume["Share consumption"]
end

subgraph group_platform["Core and services"]
  node_crypto["Encryption and crypto<br/>[crypto.ts]"]
  node_webauthn["Biometric unlock<br/>[webauthn.ts]"]
  node_totpcrypto["TOTP utilities<br/>[totp.ts]"]
  node_sshcrypto["SSH utilities<br/>[ssh.ts]"]
  node_certutils["Certificate utilities<br/>[certificates.ts]"]
  node_firebase["Firebase<br/>[firebase.ts]"]
  node_firestore["Firestore data<br/>[firestore.ts]"]
end

node_user(("Developer"))
node_clipboard["System clipboard"]

node_user -->|"opens"| node_web
node_web -->|"renders"| node_authguard
node_authguard -->|"shows when unauthenticated"| node_authpage
node_web -->|"renders after auth"| node_vaultguard
node_vaultguard -->|"shows for setup"| node_setup
node_vaultguard -->|"shows when locked"| node_unlock
node_vaultguard -->|"shows when unlocked"| node_vaultpage
node_vaultpage -->|"renders"| node_dashboard
node_dashboard -->|"reads vault state"| node_vaultstore
node_dashboard -->|"reads project state"| node_projectstore
node_service -->|"subscribes and writes"| node_firestore
node_web -->|"renders share route"| node_consume
node_consume -->|"consumes shared data"| node_sharing
node_setup -->|"sets up encryption"| node_crypto
node_unlock -->|"unlocks vault"| node_crypto
node_webauthn -->|"derives and uses key"| node_crypto
node_totp -->|"uses TOTP operations"| node_totpcrypto
node_ssh -->|"uses SSH operations"| node_sshcrypto
node_certs -->|"parses certificates"| node_certutils
node_desktop -->|"hosts app"| node_web
node_user -->|"copies secret"| node_clipboard

click node_web "https://github.com/hariharen9/scync/blob/main/apps/web/src/App.tsx"
click node_desktop "https://github.com/hariharen9/scync/blob/main/apps/desktop/src/main.ts"
click node_authguard "https://github.com/hariharen9/scync/blob/main/packages/ui/src/components/AuthGuard.tsx"
click node_authpage "https://github.com/hariharen9/scync/blob/main/apps/web/src/pages/AuthPage.tsx"
click node_setup "https://github.com/hariharen9/scync/blob/main/apps/web/src/pages/SetupPage.tsx"
click node_unlock "https://github.com/hariharen9/scync/blob/main/apps/web/src/pages/UnlockPage.tsx"
click node_vaultguard "https://github.com/hariharen9/scync/blob/main/packages/ui/src/components/VaultGuard.tsx"
click node_vaultpage "https://github.com/hariharen9/scync/blob/main/apps/web/src/pages/VaultPage.tsx"
click node_dashboard "https://github.com/hariharen9/scync/blob/main/packages/ui/src/components/Dashboard.tsx"
click node_vaultstore "https://github.com/hariharen9/scync/blob/main/packages/ui/src/stores/vaultStore.ts"
click node_projectstore "https://github.com/hariharen9/scync/blob/main/packages/ui/src/stores/projectStore.ts"
click node_service "https://github.com/hariharen9/scync/blob/main/packages/ui/src/stores/serviceStore.ts"
click node_envimport "https://github.com/hariharen9/scync/blob/main/packages/ui/src/components/EnvImportModal.tsx"
click node_totp "https://github.com/hariharen9/scync/blob/main/packages/ui/src/components/TOTPDashboard.tsx"
click node_ssh "https://github.com/hariharen9/scync/blob/main/packages/ui/src/components/SSHManagerDashboard.tsx"
click node_certs "https://github.com/hariharen9/scync/blob/main/packages/ui/src/components/CertificateDashboard.tsx"
click node_sharing "https://github.com/hariharen9/scync/blob/main/packages/ui/src/stores/shareStore.ts"
click node_consume "https://github.com/hariharen9/scync/blob/main/packages/ui/src/components/ShareConsumePage.tsx"
click node_crypto "https://github.com/hariharen9/scync/blob/main/packages/core/src/crypto.ts"
click node_webauthn "https://github.com/hariharen9/scync/blob/main/packages/core/src/webauthn.ts"
click node_totpcrypto "https://github.com/hariharen9/scync/blob/main/packages/core/src/totp.ts"
click node_sshcrypto "https://github.com/hariharen9/scync/blob/main/packages/core/src/ssh.ts"
click node_certutils "https://github.com/hariharen9/scync/blob/main/packages/core/src/certificates.ts"
click node_firebase "https://github.com/hariharen9/scync/blob/main/packages/core/src/firebase.ts"
click node_firestore "https://github.com/hariharen9/scync/blob/main/packages/core/src/firestore.ts"

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_web,node_desktop toneBlue
class node_authguard,node_authpage,node_setup,node_unlock,node_vaultguard toneAmber
class node_vaultpage,node_dashboard,node_vaultstore,node_projectstore,node_service,node_envimport,node_totp,node_ssh,node_certs,node_sharing,node_consume toneMint
class node_crypto,node_webauthn,node_totpcrypto,node_sshcrypto,node_certutils,node_firebase,node_firestore toneRose
class node_user,node_clipboard toneIndigo
```

## Components

### App clients

- [Web app](https://github.com/hariharen9/scync/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Desktop shell](https://github.com/hariharen9/scync/blob/main/apps/desktop/src/main.ts): `apps/desktop/src/main.ts`

### Access and vault

- [Auth guard](https://github.com/hariharen9/scync/blob/main/packages/ui/src/components/AuthGuard.tsx): `packages/ui/src/components/AuthGuard.tsx`
- [Sign in](https://github.com/hariharen9/scync/blob/main/apps/web/src/pages/AuthPage.tsx): `apps/web/src/pages/AuthPage.tsx`
- [Vault setup](https://github.com/hariharen9/scync/blob/main/apps/web/src/pages/SetupPage.tsx): `apps/web/src/pages/SetupPage.tsx`
- [Vault unlock](https://github.com/hariharen9/scync/blob/main/apps/web/src/pages/UnlockPage.tsx): `apps/web/src/pages/UnlockPage.tsx`
- [Vault guard](https://github.com/hariharen9/scync/blob/main/packages/ui/src/components/VaultGuard.tsx): `packages/ui/src/components/VaultGuard.tsx`

### Secret workflows

- [Vault workspace](https://github.com/hariharen9/scync/blob/main/apps/web/src/pages/VaultPage.tsx): `apps/web/src/pages/VaultPage.tsx`
- [Secret dashboard](https://github.com/hariharen9/scync/blob/main/packages/ui/src/components/Dashboard.tsx): `packages/ui/src/components/Dashboard.tsx`
- [Vault state](https://github.com/hariharen9/scync/blob/main/packages/ui/src/stores/vaultStore.ts): `packages/ui/src/stores/vaultStore.ts`
- [Project state](https://github.com/hariharen9/scync/blob/main/packages/ui/src/stores/projectStore.ts): `packages/ui/src/stores/projectStore.ts`
- [Service state](https://github.com/hariharen9/scync/blob/main/packages/ui/src/stores/serviceStore.ts): `packages/ui/src/stores/serviceStore.ts`
- [Environment import](https://github.com/hariharen9/scync/blob/main/packages/ui/src/components/EnvImportModal.tsx): `packages/ui/src/components/EnvImportModal.tsx`
- [TOTP manager](https://github.com/hariharen9/scync/blob/main/packages/ui/src/components/TOTPDashboard.tsx): `packages/ui/src/components/TOTPDashboard.tsx`
- [SSH manager](https://github.com/hariharen9/scync/blob/main/packages/ui/src/components/SSHManagerDashboard.tsx): `packages/ui/src/components/SSHManagerDashboard.tsx`
- [Certificate manager](https://github.com/hariharen9/scync/blob/main/packages/ui/src/components/CertificateDashboard.tsx): `packages/ui/src/components/CertificateDashboard.tsx`
- [Share management](https://github.com/hariharen9/scync/blob/main/packages/ui/src/stores/shareStore.ts): `packages/ui/src/stores/shareStore.ts`
- [Share consumption](https://github.com/hariharen9/scync/blob/main/packages/ui/src/components/ShareConsumePage.tsx): `packages/ui/src/components/ShareConsumePage.tsx`

### Core and services

- [Encryption and crypto](https://github.com/hariharen9/scync/blob/main/packages/core/src/crypto.ts): `packages/core/src/crypto.ts`
- [Biometric unlock](https://github.com/hariharen9/scync/blob/main/packages/core/src/webauthn.ts): `packages/core/src/webauthn.ts`
- [TOTP utilities](https://github.com/hariharen9/scync/blob/main/packages/core/src/totp.ts): `packages/core/src/totp.ts`
- [SSH utilities](https://github.com/hariharen9/scync/blob/main/packages/core/src/ssh.ts): `packages/core/src/ssh.ts`
- [Certificate utilities](https://github.com/hariharen9/scync/blob/main/packages/core/src/certificates.ts): `packages/core/src/certificates.ts`
- [Firebase](https://github.com/hariharen9/scync/blob/main/packages/core/src/firebase.ts): `packages/core/src/firebase.ts`
- [Firestore data](https://github.com/hariharen9/scync/blob/main/packages/core/src/firestore.ts): `packages/core/src/firestore.ts`

### Other components

- **Developer**
- **System clipboard**

## Connections

- Developer → Web app: opens
- Web app → Auth guard: renders
- Auth guard → Sign in: shows when unauthenticated
- Web app → Vault guard: renders after auth
- Vault guard → Vault setup: shows for setup
- Vault guard → Vault unlock: shows when locked
- Vault guard → Vault workspace: shows when unlocked
- Vault workspace → Secret dashboard: renders
- Secret dashboard → Vault state: reads vault state
- Secret dashboard → Project state: reads project state
- Service state → Firestore data: subscribes and writes
- Web app → Share consumption: renders share route
- Share consumption → Share management: consumes shared data
- Vault setup → Encryption and crypto: sets up encryption
- Vault unlock → Encryption and crypto: unlocks vault
- Biometric unlock → Encryption and crypto: derives and uses key
- TOTP manager → TOTP utilities: uses TOTP operations
- SSH manager → SSH utilities: uses SSH operations
- Certificate manager → Certificate utilities: parses certificates
- Desktop shell → Web app: hosts app
- Developer → System clipboard: copies secret
