# dev-pradhuman/virtual-office-clean architecture

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

- Interactive diagram: https://gitdiagram.com/dev-pradhuman/virtual-office-clean
- Repository: https://github.com/dev-pradhuman/virtual-office-clean

## Overview

Virtual Office is a private team collaboration app: members sign in through the desktop client, then use presence, messaging, calls/screen sharing, and shared work tools backed by an Express service and persistent storage. The React client is the documented primary frontend; the repository also includes a vanilla fallback frontend. Edges are limited to relationships supported by the README or shown excerpts/SOURCE INDEX; unsampled feature wiring is not inferred.

Main entry points: [`backend/server.js`](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/backend/server.js) (REST API), [`Team Hearth/src/components/app-shell.tsx`](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/components/app-shell.tsx) (App shell), [`main.js`](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/main.js) (Electron shell), [`Team Hearth/src/lib/app-context.tsx`](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/lib/app-context.tsx) (Session and app state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop client"]
  node_electron["Electron shell<br/>[main.js]"]
  node_preload["Renderer bridge<br/>[preload.js]"]
end

subgraph group_client["Team Hearth client"]
  node_login["Sign-in screen<br/>[login-screen.tsx]"]
  node_app["App shell<br/>[app-shell.tsx]"]
  node_context["Session and app state<br/>[app-context.tsx]"]
  node_api["HTTP client<br/>[api.ts]"]
  node_calls["Call coordination<br/>[use-call.tsx]"]
  node_office["Virtual office<br/>[OfficeScene.tsx]"]
  node_chat["Team chat<br/>[chat.tsx]"]
  node_worktools["Shared work tools<br/>[tasks.tsx]"]
  node_settings["Admin settings<br/>[settings.tsx]"]
  node_vanilla["Vanilla fallback<br/>[app.js]"]
end

subgraph group_backend["Backend services"]
  node_rest["REST API<br/>[server.js]"]
  node_realtime["Socket.IO events<br/>[socket.js]"]
end

subgraph group_data["Persistence and integrations"]
  node_database[("SQLite database<br/>[database.js]")]
  node_config["Runtime config<br/>[config-store.js]"]
end

node_member(("Team member"))
node_drive["Google Drive"]
node_webrtc["WebRTC peers"]
node_server["Hosted backend"]

node_member -->|"signs in"| node_login
node_login -.->|"submits credentials"| node_context
node_context -->|"requests data"| node_api
node_api -.->|"calls REST"| node_rest
node_member -->|"uses tools"| node_app
node_app -.->|"shows office"| node_office
node_app -.->|"shows chat"| node_chat
node_app -.->|"shows tools"| node_worktools
node_app -.->|"shows settings"| node_settings
node_context -->|"provides app state"| node_calls
node_calls -.->|"coordinates media"| node_webrtc
node_member -.->|"uses fallback"| node_vanilla
node_electron -->|"bundles backend"| node_server
node_electron -.->|"bridges renderer"| node_preload
node_electron -->|"starts server"| node_rest
node_rest -->|"reads and writes"| node_database
node_rest -->|"sets up sockets"| node_realtime
node_realtime -.->|"reads and writes"| node_database
node_settings -.->|"configures admin"| node_rest
node_rest -.->|"loads Drive config"| node_config
node_rest -->|"uploads files"| node_drive
node_server -->|"hosts API"| node_rest
node_server -->|"hosts events"| node_realtime

click node_electron "https://github.com/dev-pradhuman/virtual-office-clean/blob/main/main.js"
click node_preload "https://github.com/dev-pradhuman/virtual-office-clean/blob/main/preload.js"
click node_login "https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/components/login-screen.tsx"
click node_app "https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/components/app-shell.tsx"
click node_context "https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/lib/app-context.tsx"
click node_api "https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/lib/api.ts"
click node_calls "https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/lib/use-call.tsx"
click node_office "https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/components/office/OfficeScene.tsx"
click node_chat "https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/components/views/chat.tsx"
click node_worktools "https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/components/views/tasks.tsx"
click node_settings "https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/components/views/settings.tsx"
click node_vanilla "https://github.com/dev-pradhuman/virtual-office-clean/blob/main/frontend/js/app.js"
click node_rest "https://github.com/dev-pradhuman/virtual-office-clean/blob/main/backend/server.js"
click node_realtime "https://github.com/dev-pradhuman/virtual-office-clean/blob/main/backend/socket.js"
click node_database "https://github.com/dev-pradhuman/virtual-office-clean/blob/main/backend/database.js"
click node_config "https://github.com/dev-pradhuman/virtual-office-clean/blob/main/backend/config-store.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_electron,node_preload toneBlue
class node_login,node_app,node_context,node_api,node_calls,node_office,node_chat,node_worktools,node_settings,node_vanilla toneAmber
class node_rest,node_realtime toneMint
class node_database,node_config toneRose
class node_member,node_drive,node_webrtc,node_server toneIndigo
```

## Components

### Desktop client

- [Electron shell](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/main.js): `main.js`
- [Renderer bridge](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/preload.js): `preload.js`

### Team Hearth client

- [Sign-in screen](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/components/login-screen.tsx): `Team Hearth/src/components/login-screen.tsx`
- [App shell](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/components/app-shell.tsx): `Team Hearth/src/components/app-shell.tsx`
- [Session and app state](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/lib/app-context.tsx): `Team Hearth/src/lib/app-context.tsx`
- [HTTP client](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/lib/api.ts): `Team Hearth/src/lib/api.ts`
- [Call coordination](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/lib/use-call.tsx): `Team Hearth/src/lib/use-call.tsx`
- [Virtual office](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/components/office/OfficeScene.tsx): `Team Hearth/src/components/office/OfficeScene.tsx`
- [Team chat](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/components/views/chat.tsx): `Team Hearth/src/components/views/chat.tsx`
- [Shared work tools](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/components/views/tasks.tsx): `Team Hearth/src/components/views/tasks.tsx`
- [Admin settings](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/Team%20Hearth/src/components/views/settings.tsx): `Team Hearth/src/components/views/settings.tsx`
- [Vanilla fallback](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/frontend/js/app.js): `frontend/js/app.js`

### Backend services

- [REST API](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/backend/server.js): `backend/server.js`
- [Socket.IO events](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/backend/socket.js): `backend/socket.js`

### Persistence and integrations

- [SQLite database](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/backend/database.js): `backend/database.js`
- [Runtime config](https://github.com/dev-pradhuman/virtual-office-clean/blob/main/backend/config-store.js): `backend/config-store.js`

### Other components

- **Team member**
- **Google Drive**
- **WebRTC peers**
- **Hosted backend**

## Connections

- Team member → Sign-in screen: signs in
- Sign-in screen → Session and app state: submits credentials
- Session and app state → HTTP client: requests data (evidence: `Team Hearth/src/lib/app-context.tsx`)
- HTTP client → REST API: calls REST
- Team member → App shell: uses tools
- App shell → Virtual office: shows office
- App shell → Team chat: shows chat
- App shell → Shared work tools: shows tools
- App shell → Admin settings: shows settings
- Session and app state → Call coordination: provides app state (evidence: `Team Hearth/src/lib/use-call.tsx`)
- Call coordination → WebRTC peers: coordinates media
- Team member → Vanilla fallback: uses fallback
- Electron shell → Hosted backend: bundles backend
- Electron shell → Renderer bridge: bridges renderer
- Electron shell → REST API: starts server (evidence: `main.js`)
- REST API → SQLite database: reads and writes (evidence: `backend/server.js`)
- REST API → Socket.IO events: sets up sockets (evidence: `backend/server.js`)
- Socket.IO events → SQLite database: reads and writes
- Admin settings → REST API: configures admin
- REST API → Runtime config: loads Drive config (evidence: `backend/server.js`)
- REST API → Google Drive: uploads files
- Hosted backend → REST API: hosts API
- Hosted backend → Socket.IO events: hosts events
