# virtual-browser/virtualbrowser architecture

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

- Interactive diagram: https://gitdiagram.com/virtual-browser/virtualbrowser
- Repository: https://github.com/virtual-browser/virtualbrowser

## Overview

1. **What this repo is**
   - VirtualBrowser is a Chromium-based anti-fingerprint browser product.
   - The repository is organized around a **control UI**, a **runtime/worker companion**, and **automation scripts** rather than a classic client-server web app.

2. **Top-level subsystem split**
   - `server/` is the main Vue SPA used to manage browser environments.
   - `worker/` is a separate Vue/TypeScript app that likely participates in local/native browser operations.
   - `automation/` contains test and demo automation for interacting with the browser/API layer.
   - `assets/` holds shared product imagery and branding.

3. **Primary control plane: `server/`**
   - This is the largest subsystem and looks like the main administrative console.
   - It uses Vue, Vue Router, Vuex, Element UI, SCSS, and a large internal component library.
   - The app shell is built from `src/layout/`, with global navigation, sidebar, tags view, settings, and responsive handling.

4. **User-facing functional areas in `server/src/views`**
   - `login/` handles authentication entry and social sign-in.
   - `browser/` appears to manage browser groups and instances.
   - `crx/` handles extension store/list management.
   - `error-page/` and `redirect/` are supporting navigation and error routes.
   - This suggests the UI is centered on creating, organizing, and launching isolated browser profiles.

5. **State, routing, and access control**
   - `src/router/`, `src/store/`, and `src/permission.js` implement route registration, navigation guards, and permission-aware UI behavior.
   - Vuex modules cover `user`, `permission`, `settings`, `tagsView`, `app`, and `errorLog`.
   - The architecture is strongly shell-driven: route changes update the layout and the selected browser-management task.

6. **API boundary and data flow in `server/`**
   - `src/api/*.js` centralizes all backend-facing calls for users, roles, articles, remote search, and native integration.
   - `src/utils/request.js` is the network boundary wrapper.
   - `server/mock/` provides a mock backend for local development, so this repo does **not** include a full production backend service.
   - In architecture terms, the UI talks to a mocked or external native/API layer through this request boundary.

7. **Reusable UI and interaction components**
   - `src/components/` contains a broad internal toolkit: charts, drag/drop, upload, image cropper, JSON editor, markdown editor, Tinymce editor, pagination, sticky elements, and more.
   - `src/directive/` adds cross-cutting behaviors like clipboard, drag dialogs, table adaptation, permission gating, and wave effects.
   - These are presentation-layer building blocks, not core domain logic.

8. **Fingerprint and localization support**
   - The repo includes configuration/data files for languages, timezones, speech voices, SSL, WebGL, versions, and user-agent-related metadata.
   - `src/lang/`, `src/utils/i18n.js`, and the custom theme assets indicate the UI is localized and themable.
   - These files support the browser-fingerprint manipulation story described in the README.

9. **`worker/` as a separate execution-side app**
   - `worker/` is a second application with its own build config, TypeScript entry (`src/main.ts`), and `src/utils/native.js`.
   - Compared with `server/`, it is much smaller and appears intended for a local helper/runtime role rather than the main admin experience.
   - For a diagram, treat it as a separate frontend/runtime boundary that likely participates in native browser control or message exchange.

10. **Automation subsystem**
   - `automation/` contains both Node.js and Python tooling plus API test scripts.
   - The README explicitly frames this as a Chromium automation demo, suitable for Playwright or similar tooling.
   - This subsystem sits outside the product UI path and is used for validation, integration testing, or scripted browser control.

11. **Runtime and deployment characteristics**
   - The project is built for desktop Chromium environments, with support focused on Windows and future multi-OS expansion.
   - `server/.env.*` and `server/vue.config.js` suggest environment-specific builds and deployment modes.
   - There is no evidence of a large standalone backend service in this repo; the important boundary is between the Vue apps, the mock/native API surface, and the Chromium runtime itself.

12. **How to draw the architecture**
   - Put Chromium/virtual-browser runtime at the center or bottom.
   - Place `server/` as the main control plane UI above it.
   - Place `worker/` as a companion execution/helper layer beside or beneath the UI.
   - Show `server/mock/` as a development-only substitute for real API/native services.
   - Show `automation/` as an external test harness that drives the browser or its APIs.

Main entry points: [`server/src/api/user.js`](https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/api/user.js) (API layer), [`server/src/main.js`](https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/main.js) (Admin UI), [`server/src/router/index.js`](https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/router/index.js) (Routing), [`server/src/layout/index.vue`](https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/layout/index.vue) (Shell layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Control plane"]
  node_server_app["Admin UI<br/>Vue SPA<br/>[main.js]"]
  node_server_layout["Shell layout<br/>UI shell<br/>[index.vue]"]
  node_server_router["Routing<br/>router<br/>[index.js]"]
  node_server_store["State store<br/>Vuex<br/>[index.js]"]
  node_server_permission["Access guard<br/>navigation guard<br/>[permission.js]"]
  node_server_api["API layer<br/>request boundary<br/>[user.js]"]
  node_server_mock["Mock backend<br/>dev mock<br/>[mock-server.js]"]
  node_server_views_login["Login<br/>view<br/>[index.vue]"]
  node_server_views_browser["Browser mgmt<br/>view<br/>[index.vue]"]
  node_server_views_crx["Extension mgmt<br/>view<br/>[list.vue]"]
  node_server_components["UI toolkit<br/>shared components<br/>[index.vue]"]
  node_server_utils["Browser data<br/>local data<br/>[index.js]"]
end

subgraph group_worker["Companion runtime"]
  node_worker_app["Worker app<br/>Vue+TS app<br/>[main.ts]"]
  node_worker_native["Native bridge<br/>native helper<br/>[native.js]"]
end

subgraph group_automation["Automation"]
  node_automation_harness["Automation<br/>scripts<br/>[index.js]"]
end

subgraph group_runtime["Browser runtime"]
  node_chromium_runtime(("Chromium<br/>browser runtime"))
  node_assets_brand["Brand assets<br/>static assets"]
end

node_server_app -->|"renders shell"| node_server_layout
node_server_app -->|"uses routes"| node_server_router
node_server_app -->|"uses state"| node_server_store
node_server_app -->|"guards access"| node_server_permission
node_server_router -->|"opens"| node_server_views_login
node_server_router -->|"opens"| node_server_views_browser
node_server_router -->|"opens"| node_server_views_crx
node_server_layout -->|"composes"| node_server_components
node_server_views_browser -->|"calls"| node_server_api
node_server_views_crx -->|"calls"| node_server_api
node_server_views_login -->|"auth via"| node_server_api
node_server_api -.->|"dev mode"| node_server_mock
node_server_api -->|"targets"| node_chromium_runtime
node_server_utils -->|"data for"| node_chromium_runtime
node_worker_app -->|"bridges to"| node_worker_native
node_worker_native -->|"controls"| node_chromium_runtime
node_automation_harness -->|"tests"| node_server_api
node_automation_harness -->|"drives"| node_chromium_runtime
node_assets_brand -->|"brands"| node_server_app
node_server_store -->|"drives shell"| node_server_layout
node_server_mock -.->|"serves data"| node_server_utils

click node_server_app "https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/main.js"
click node_server_layout "https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/layout/index.vue"
click node_server_router "https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/router/index.js"
click node_server_store "https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/store/index.js"
click node_server_permission "https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/permission.js"
click node_server_api "https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/api/user.js"
click node_server_mock "https://github.com/virtual-browser/virtualbrowser/blob/main/server/mock/mock-server.js"
click node_server_views_login "https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/views/login/index.vue"
click node_server_views_browser "https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/views/browser/index.vue"
click node_server_views_crx "https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/views/crx/list.vue"
click node_server_components "https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/components/JsonEditor/index.vue"
click node_server_utils "https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/utils/index.js"
click node_worker_app "https://github.com/virtual-browser/virtualbrowser/blob/main/worker/src/main.ts"
click node_worker_native "https://github.com/virtual-browser/virtualbrowser/blob/main/worker/src/utils/native.js"
click node_automation_harness "https://github.com/virtual-browser/virtualbrowser/blob/main/automation/index.js"
click node_assets_brand "https://github.com/virtual-browser/virtualbrowser/tree/main/assets/img"

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_server_app,node_server_layout,node_server_router,node_server_store,node_server_permission,node_server_api,node_server_mock,node_server_views_login,node_server_views_browser,node_server_views_crx,node_server_components,node_server_utils toneBlue
class node_worker_app,node_worker_native toneAmber
class node_automation_harness toneMint
class node_chromium_runtime,node_assets_brand toneRose
```

## Components

### Control plane

Main browser management UI and shared frontend architecture

- [Admin UI](https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/main.js): Vue SPA · Main control console for browser environments · `server/src/main.js`
- [Shell layout](https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/layout/index.vue): UI shell · App chrome, sidebar, tags view, settings, responsive shell · `server/src/layout/index.vue`
- [Routing](https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/router/index.js): router · Route registration and navigation structure · `server/src/router/index.js`
- [State store](https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/store/index.js): Vuex · Global state modules for user, permission, settings, tags, app, and errors · `server/src/store/index.js`
- [Access guard](https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/permission.js): navigation guard · Permission-aware route and UI gating · `server/src/permission.js`
- [API layer](https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/api/user.js): request boundary · Frontend service calls for user, role, article, native, and search APIs · `server/src/api/user.js`
- [Mock backend](https://github.com/virtual-browser/virtualbrowser/blob/main/server/mock/mock-server.js): dev mock · Local mock server used during development · `server/mock/mock-server.js`
- [Login](https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/views/login/index.vue): view · Authentication entry and social sign-in · `server/src/views/login/index.vue`
- [Browser mgmt](https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/views/browser/index.vue): view · Browser group and instance management · `server/src/views/browser/index.vue`
- [Extension mgmt](https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/views/crx/list.vue): view · Extension store and installed extension lists · `server/src/views/crx/list.vue`
- [UI toolkit](https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/components/JsonEditor/index.vue): shared components · Reusable charts, upload, editor, drag/drop, and presentation components · `server/src/components/JsonEditor/index.vue`
- [Browser data](https://github.com/virtual-browser/virtualbrowser/blob/main/server/src/utils/index.js): local data · Language, timezone, voice, SSL, UA, and WebGL metadata plus request/auth helpers · `server/src/utils/index.js`

### Companion runtime

Secondary app for local/native browser-side operations

- [Worker app](https://github.com/virtual-browser/virtualbrowser/blob/main/worker/src/main.ts): Vue+TS app · Companion frontend/runtime for native or local browser tasks · `worker/src/main.ts`
- [Native bridge](https://github.com/virtual-browser/virtualbrowser/blob/main/worker/src/utils/native.js): native helper · Worker-side integration surface for native/browser operations · `worker/src/utils/native.js`

### Automation

External scripts and demos for scripted control and validation

- [Automation](https://github.com/virtual-browser/virtualbrowser/blob/main/automation/index.js): scripts · Node/Python test and demo scripts for API/browser automation · `automation/index.js`

### Browser runtime

Chromium/virtual-browser execution boundary

- **Chromium**: browser runtime · Virtual browser execution target and fingerprinted runtime boundary
- [Brand assets](https://github.com/virtual-browser/virtualbrowser/tree/main/assets/img): static assets · Shared product imagery and branding · `assets/img`

## Connections

- Admin UI → Shell layout: renders shell · The main app is composed through the shared layout system
- Admin UI → Routing: uses routes · Route table drives view switching and navigation
- Admin UI → State store: uses state · Vuex store provides global app and permission state
- Admin UI → Access guard: guards access · Navigation guards enforce authenticated and permitted routes
- Routing → Login: opens · Login route maps to authentication views
- Routing → Browser mgmt: opens · Browser management route maps to browser views
- Routing → Extension mgmt: opens · Extension management routes map to crx views
- Shell layout → UI toolkit: composes · Layout uses shared UI building blocks
- Browser mgmt → API layer: calls · Browser management reads and mutates via API boundary
- Extension mgmt → API layer: calls · Extension management uses backend/native-facing services
- Login → API layer: auth via · Login flow exchanges credentials and session state through APIs
- API layer → Mock backend: dev mode · Mock server substitutes for backend during local development
- API layer → Chromium: targets · Native/browser-related endpoints bridge toward the Chromium runtime
- Browser data → Chromium: data for · Language, UA, timezone, and fingerprint datasets support browser profiles
- Worker app → Native bridge: bridges to · Worker app delegates local/native operations through its bridge layer
- Native bridge → Chromium: controls · Native helper participates in browser/runtime operations
- Automation → API layer: tests · Automation scripts exercise API and integration paths
- Automation → Chromium: drives · Automation can control Chromium through browser automation tooling
- Brand assets → Admin UI: brands · Static imagery and branding support the main UI
- State store → Shell layout: drives shell · Store state affects tags, settings, sidebar, and layout behavior
- Mock backend → Browser data: serves data · Mocked responses may include browser-related reference data
