# yuniaries/yuni-share architecture

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

- Interactive diagram: https://gitdiagram.com/yuniaries/yuni-share
- Repository: https://github.com/yuniaries/yuni-share

## Overview

Yuni Share is a browser-based personal file-storage application: users register or sign in, unlock a client-side encrypted vault, then manage encrypted files through the website and server. The principal file flow keeps encryption and decryption in the browser while the server handles authenticated APIs, chunk transfer, permissions, and storage. The graph also covers account/passkey access, administration, membership reminders, and recovery. Evidence is limited to the README and sampled excerpts, so uncertain integration wiring is omitted.

Main entry points: [`server.mjs`](https://github.com/yuniaries/yuni-share/blob/main/server.mjs) (API and workflows), [`public/app.js`](https://github.com/yuniaries/yuni-share/blob/main/public/app.js) (File workspace), [`membership-expiry.mjs`](https://github.com/yuniaries/yuni-share/blob/main/membership-expiry.mjs) (Expiry reminders), [`public/register-steps.js`](https://github.com/yuniaries/yuni-share/blob/main/public/register-steps.js) (Registration steps)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["File workspace<br/>[app.js]"]
  node_registration["Registration steps<br/>[register-steps.js]"]
  node_adminui["Admin console<br/>[admin.js]"]
  node_recovery["Deletion recovery"]
end

subgraph group_identity["Accounts and access"]
  node_auth["Account sessions<br/>[server.mjs]"]
  node_passkeys["Passkey flows<br/>[server.mjs]"]
end

subgraph group_files["Encrypted file service"]
  node_server["API and workflows<br/>[server.mjs]"]
  node_sqlite[("Application database<br/>[server.mjs]")]
  node_localcrypto["Browser cryptography<br/>[app.js]"]
  node_chunktransfer["Chunk transfer<br/>[server.mjs]"]
  node_storage[("File storage")]
end

subgraph group_operations["Operations"]
  node_membership["Expiry reminders"]
  node_username["Name migration"]
  node_admin["Administrative workflows<br/>[server.mjs]"]
  node_sitecontent["Managed site content<br/>[server.mjs]"]
end

node_user(("User"))
node_browser(("Web browser"))
node_authenticator(("WebAuthn authenticator"))
node_mail["Email service"]
node_payments["Payment service"]

node_user -->|"uses"| node_browser
node_browser -->|"registers through"| node_registration
node_browser -->|"uses"| node_webapp
node_browser -->|"administers through"| node_adminui
node_browser -->|"recovers through"| node_recovery
node_registration -->|"submits account"| node_server
node_webapp -->|"encrypts and decrypts"| node_localcrypto
node_webapp -->|"calls APIs"| node_server
node_localcrypto -.->|"requests credentials"| node_authenticator
node_webapp -.->|"requests credentials"| node_authenticator
node_adminui -->|"calls APIs"| node_server
node_recovery -->|"validates recovery"| node_server
node_server -->|"handles sessions"| node_auth
node_server -->|"handles passkey flows"| node_passkeys
node_passkeys -.->|"verifies credentials"| node_authenticator
node_server -->|"reads and writes"| node_sqlite
node_server -->|"handles chunks"| node_chunktransfer
node_server -->|"stores file data"| node_storage
node_server -.->|"integrates with"| node_payments
node_server -->|"serves admin actions"| node_admin
node_server -->|"manages content"| node_sitecontent
node_server -->|"runs migration"| node_username
node_membership -->|"reads and records reminders"| node_sqlite
node_membership -.->|"sends reminders"| node_mail

click node_webapp "https://github.com/yuniaries/yuni-share/blob/main/public/app.js"
click node_registration "https://github.com/yuniaries/yuni-share/blob/main/public/register-steps.js"
click node_adminui "https://github.com/yuniaries/yuni-share/blob/main/public/admin.js"
click node_recovery "https://github.com/yuniaries/yuni-share/blob/main/public/recovery-account.js"
click node_server "https://github.com/yuniaries/yuni-share/blob/main/server.mjs"
click node_sqlite "https://github.com/yuniaries/yuni-share/blob/main/server.mjs"
click node_localcrypto "https://github.com/yuniaries/yuni-share/blob/main/public/app.js"
click node_chunktransfer "https://github.com/yuniaries/yuni-share/blob/main/server.mjs"
click node_auth "https://github.com/yuniaries/yuni-share/blob/main/server.mjs"
click node_passkeys "https://github.com/yuniaries/yuni-share/blob/main/server.mjs"
click node_membership "https://github.com/yuniaries/yuni-share/blob/main/membership-expiry.mjs"
click node_username "https://github.com/yuniaries/yuni-share/blob/main/username-migration.mjs"
click node_admin "https://github.com/yuniaries/yuni-share/blob/main/server.mjs"
click node_sitecontent "https://github.com/yuniaries/yuni-share/blob/main/server.mjs"

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_webapp,node_registration,node_adminui,node_recovery,node_user,node_browser toneBlue
class node_auth,node_passkeys toneAmber
class node_server,node_sqlite,node_localcrypto,node_chunktransfer,node_storage toneMint
class node_membership,node_username,node_admin,node_sitecontent toneRose
class node_authenticator,node_mail,node_payments toneIndigo
```

## Components

### Web experience

- [File workspace](https://github.com/yuniaries/yuni-share/blob/main/public/app.js): `public/app.js`
- [Registration steps](https://github.com/yuniaries/yuni-share/blob/main/public/register-steps.js): `public/register-steps.js`
- [Admin console](https://github.com/yuniaries/yuni-share/blob/main/public/admin.js): `public/admin.js`
- [Deletion recovery](https://github.com/yuniaries/yuni-share/blob/main/public/recovery-account.js): `public/recovery-account.js`

### Accounts and access

- [Account sessions](https://github.com/yuniaries/yuni-share/blob/main/server.mjs): `server.mjs`
- [Passkey flows](https://github.com/yuniaries/yuni-share/blob/main/server.mjs): `server.mjs`

### Encrypted file service

- [API and workflows](https://github.com/yuniaries/yuni-share/blob/main/server.mjs): `server.mjs`
- [Application database](https://github.com/yuniaries/yuni-share/blob/main/server.mjs): `server.mjs`
- [Browser cryptography](https://github.com/yuniaries/yuni-share/blob/main/public/app.js): `public/app.js`
- [Chunk transfer](https://github.com/yuniaries/yuni-share/blob/main/server.mjs): `server.mjs`
- **File storage**

### Operations

- [Expiry reminders](https://github.com/yuniaries/yuni-share/blob/main/membership-expiry.mjs): `membership-expiry.mjs`
- [Name migration](https://github.com/yuniaries/yuni-share/blob/main/username-migration.mjs): `username-migration.mjs`
- [Administrative workflows](https://github.com/yuniaries/yuni-share/blob/main/server.mjs): `server.mjs`
- [Managed site content](https://github.com/yuniaries/yuni-share/blob/main/server.mjs): `server.mjs`

### Other components

- **User**
- **Web browser**
- **WebAuthn authenticator**
- **Email service**
- **Payment service**

## Connections

- User → Web browser: uses
- Web browser → Registration steps: registers through
- Web browser → File workspace: uses
- Web browser → Admin console: administers through
- Web browser → Deletion recovery: recovers through
- Registration steps → API and workflows: submits account
- File workspace → Browser cryptography: encrypts and decrypts
- File workspace → API and workflows: calls APIs
- Browser cryptography → WebAuthn authenticator: requests credentials
- File workspace → WebAuthn authenticator: requests credentials
- Admin console → API and workflows: calls APIs
- Deletion recovery → API and workflows: validates recovery
- API and workflows → Account sessions: handles sessions
- API and workflows → Passkey flows: handles passkey flows
- Passkey flows → WebAuthn authenticator: verifies credentials
- API and workflows → Application database: reads and writes
- API and workflows → Chunk transfer: handles chunks
- API and workflows → File storage: stores file data
- API and workflows → Payment service: integrates with
- API and workflows → Administrative workflows: serves admin actions
- API and workflows → Managed site content: manages content
- API and workflows → Name migration: runs migration
- Expiry reminders → Application database: reads and records reminders
- Expiry reminders → Email service: sends reminders
