Skip to main content

Viben Project Architecture Report

Version: 0.2.0 Updated: 2026-04-28 Project Description: Multi-agent workspace manager with kanban, calendar, timeline, and task management


Table of Contents

  1. Project Overview
  2. Technology Stack
  3. Project Structure
  4. Application Analysis
  5. Shared Packages Analysis
  6. Backend Services
  7. Data Flow and Architecture Patterns
  8. Build and Deployment

1. Project Overview

1.1 Project Positioning

Viben is a multi-agent workspace manager. Core products include:

ProductDescriptionTechnology
Web ApplicationMCP/Skill package marketplace, social featuresNext.js 15 + PostgreSQL
Desktop ApplicationLocal agent orchestration and task managementTauri 2 + React 19
CLI ToolCommand-line agent managementTypeScript + Commander
MCP ServerAcademic paper search service (18 data sources)Python + FastMCP

1.2 Core Architecture

+-------------------------------------------------------------------------+
| Viben Architecture Overview |
+-------------------------------------------------------------------------+
| |
| +---------+ +---------+ +---------+ +---------+ |
| | Web | | Desktop | | CLI | | Docs | |
| | (Next) | | (Tauri) | | (Node) | |(Docusr) | |
| +----+----+ +----+----+ +----+----+ +---------+ |
| | | | |
| | +-------+-------+ |
| | | |
| | +----------+----------+ |
| | | Viben Gateway | |
| | | (Fastify :18790) | |
| | +----------+----------+ |
| | | |
| +-----------------------+----------------------------------------+
| | |
| +-----------------+-----------------+ |
| | @viben/core | |
| +----------+----------+------------+----------+----------+ |
| | | | | | | |
| | Gateway | Services | Executors | Configs | GitHub | |
| | (40+API) | (11 svc) | (9 agents) | (YAML) | (API) | |
| +----------+----------+------------+----------+----------+ |
| |
| +----------+----------+------------+ |
| | @viben | @viben | @viben | |
| | /ui | /kanban | /api-client| |
| +----------+----------+------------+ |
| |
| +---------------------------------------------------------+ |
| | Python Backend Services | |
| | browse-mcp (Academic Search) | |
| +---------------------------------------------------------+ |
| |
+-------------------------------------------------------------------------+

The Desktop and CLI applications communicate with @viben/core through the Viben Gateway, a Fastify-based HTTP/WebSocket server running on port 18790. The Web application connects to @viben/core directly or through the API client. This gateway layer provides a unified interface for agent orchestration, session management, and all workspace operations.


2. Technology Stack

2.1 Frontend Technologies

TechnologyVersionPurpose
React^19.0.0 / ^19.1.0UI framework for all applications
Next.js^15.5.11Web application (apps/web)
React Router DOM^7.13.0Desktop application routing
Docusaurus^3.7.0Documentation site

2.2 Desktop Framework

TechnologyVersionPurpose
Tauri2.xNative desktop application
tauri-plugin-sql2 (SQLite)Local database
tauri-plugin-fs2.4.5File system access
tauri-plugin-shell2.3.4Shell command execution
tauri-plugin-deep-link2OAuth callback handling

2.3 Build Tools

ToolVersionPurpose
Turborepo^2.3.0Monorepo build orchestration
Vite^7.0.4Desktop application bundling
tsup^8.0.0Package bundling
pnpm9.15.0Package manager

2.4 Database and Storage

TechnologyLocationPurpose
PostgreSQL + Drizzle ORMapps/webWeb application database (Neon serverless)
SQLiteapps/desktopDesktop local storage
Zustandapps/desktopClient-side state persistence

2.5 State Management

TechnologyPurpose
ZustandDesktop application global state + persistence
TanStack QueryDesktop application async state/cache management
React ContextComponent local state sharing

2.6 Styling Solutions

TechnologyPurpose
TailwindCSSv3.4 (web), v4.1 (desktop)
Radix UIAccessible component primitives
CVAVariant style management
tailwind-mergeClass name merging
Framer MotionAnimations

2.7 Backend Technologies

TechnologyLanguagePurpose
FastifyTypeScriptViben Gateway (HTTP/WebSocket API server)
FastMCPPythonMCP server implementation
PoetryPythonDependency management
RustRustTauri desktop application backend

3. Project Structure

3.1 Root Directory Organization

viben/
├── apps/ # Application packages
│ ├── web/ # Next.js Web application (marketplace)
│ ├── desktop/ # Tauri desktop application
│ └── docs/ # Docusaurus documentation site

├── packages/ # Shared TypeScript packages
│ ├── api-client/ # API client library
│ ├── cli/ # Command-line interface
│ ├── core/ # Core configuration/agent management/Gateway
│ ├── kanban/ # Kanban component library
│ ├── ui/ # Shared UI component library
│ └── vibe-kanban/ # External kanban component symlink

├── backend/ # Python backend services
│ ├── browse-mcp/ # Academic paper search MCP server
│ └── plugins/ # Plugin system

├── homebrew/ # Homebrew tap support
├── scripts/ # Build/release scripts
├── design-system/ # Design system assets

├── package.json # Root package configuration
├── pnpm-workspace.yaml # pnpm workspace configuration
└── turbo.json # Turborepo configuration

3.2 Monorepo Configuration

pnpm-workspace.yaml:

packages:
- "apps/*"
- "packages/*"

turbo.json:

{
"$schema": "https://turbo.build/schema.json",
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**", "build/**"]
},
"dev": {
"cache": false,
"persistent": true
},
"lint": {},
"typecheck": {
"dependsOn": ["^build"]
},
"clean": {
"cache": false
}
}
}

4. Application Analysis

4.1 apps/web (@viben/web)

Positioning: Web-based marketplace and package registry

Core Features:

  • MCP package marketplace (search, browse, publish)
  • Skill package marketplace
  • User authentication (email + GitHub OAuth)
  • Workspace management
  • Collections (curated package lists)
  • Social features (favorites, ratings, comments)
  • Admin panel (moderation)

Directory Structure:

apps/web/
├── app/
│ ├── (admin)/ # Admin routes
│ ├── (auth)/ # Auth routes (login, register)
│ ├── (dashboard)/ # User dashboard
│ └── api/ # API routes
│ ├── auth/ # Auth endpoints
│ ├── mcp/ # MCP package CRUD
│ ├── skills/ # Skill package CRUD
│ ├── workspaces/ # Workspace management
│ ├── collections/ # Collection management
│ └── admin/ # Admin endpoints
├── components/ # React components
├── lib/
│ └── db/ # Drizzle schema & migrations
└── hooks/ # Custom React hooks

Database Schema Core Tables:

Table NameDescription
usersUser accounts (roles: user, developer, admin, super_admin, moderator, support)
apiKeysAPI keys (programmatic access)
oauthConnectionsOAuth provider connections
organizationsOrganization accounts
mcpPackagesMCP package registry
skillPackagesSkill package registry
collectionsCurated package collections
favorites, ratings, commentsSocial features
workspacesUser workspaces
reports, moderationLogsAdmin/moderation

4.2 apps/desktop (@viben/desktop)

Positioning: Local multi-agent workspace management desktop application

Core Features:

  • MCP server management (start/stop/monitor)
  • Agent configuration and orchestration
  • Provider/Model management
  • Kanban task management
  • AI agent chat interface
  • Skills marketplace integration
  • Offline caching
  • System tray integration
  • OAuth authentication flow

Directory Structure:

apps/desktop/
├── src/
│ ├── components/
│ │ ├── chat/ # Chat UI components
│ │ ├── kanban/ # Kanban
│ │ ├── settings/ # Settings panel
│ │ ├── marketplace/ # Package browser
│ │ ├── workspace/ # Workspace management
│ │ └── ui/ # Base UI components
│ ├── pages/ # Route pages
│ ├── stores/ # Zustand stores
│ ├── hooks/ # Custom hooks
│ ├── db/ # SQLite database layer
│ ├── i18n/ # Internationalization
│ └── lib/ # Utility functions
├── src-tauri/
│ ├── src/
│ │ ├── commands/ # Tauri IPC commands
│ │ └── lib.rs # Tauri main entry
│ └── Cargo.toml # Rust dependencies
└── public/ # Static assets

Tauri IPC Commands (Core):

Command ModuleFunction
commands::mcpMCP server lifecycle (start, stop, status)
commands::agentsAgent configuration read/write
commands::viben_agentsViben agent list management
commands::authCredential management, GitHub OAuth
commands::kanbanKanban data persistence
commands::syncCloud sync (workspaces, packages)
commands::cacheOffline cache

State Management (Zustand Store):

// apps/desktop/src/stores/app-store.ts
interface AppState {
selectedPython: string | null; // Python interpreter selection
providers: DataProvider[]; // Data source providers (18 academic sources)
apiKeys: Record<string, string>; // API key storage
mcpServers: McpServerState[]; // Multiple MCP server instances
agentAssignments: Record<string, string>; // Agent-server mapping
theme: 'light' | 'dark' | 'system'; // UI theme
language: 'en' | 'zh-CN'; // Language
shortcuts: Record<string, string>; // Keyboard shortcuts
onboardingCompleted: boolean; // Onboarding completion status
}

4.3 apps/docs (@viben/docs)

Positioning: Documentation site

Core Features:

  • Multi-language support (English, Chinese)
  • Mermaid diagram support
  • Blog
  • API documentation

Technology: Docusaurus 3.7.0


5. Shared Packages Analysis

5.1 @viben/core

Positioning: Shared core library for configuration, agents, providers, models, Gateway, executors, and services

Exported Modules:

// Configuration management
export { ConfigManager, getStateDir, getConfigPath, ... }

// Agent management
export { AgentManager, agentManager }

// Provider management
export { ProviderManager, providerManager }

// Model management
export { ModelManager, modelManager, KNOWN_MODELS }

// MCP management
export { McpManager, mcpManager }

// Skills management
export { SkillsManager, skillsManager }

// Executors - AI coding agent executors
export { createExecutor, EXECUTOR_TYPES, spawnChat }

// Gateway - HTTP/WebSocket API gateway
export { startGateway, registerRoutes }

// Services - Background service management
export { ServiceManager, EventService, SessionStoreService, CronService }

Directory Structure:

packages/core/src/
├── agents/ # Agent configuration and management
├── channels/ # Message channel management
├── cli/ # CLI command implementations
├── config/ # Configuration file management
├── db/ # Database models (SQLite)
├── executors/ # AI coding agent executors
├── gateway/ # HTTP/WS API gateway
├── group-chat/ # Group chat functionality
├── mcp/ # MCP server configuration
├── models/ # Model definitions and discovery
├── notifications/ # Notification system
├── providers/ # Provider configuration
├── services/ # Background services
├── skills/ # Skills management
├── team/ # Team functionality
├── telemetry/ # Telemetry and logging
├── types/ # Shared type definitions
├── workspace/ # Workspace management
├── browser.ts # Browser-safe exports
└── index.ts # Main exports

5.1.1 Executors - AI Coding Agent Executors

The executors module provides a unified interface for spawning and managing multiple AI coding agents. Each executor wraps a specific CLI tool and exposes a common API for availability checks, chat sessions, and process lifecycle management.

ExecutorCLI ToolDescription
CLAUDE_CODEclaudeClaude Code CLI
AMPampAmp Code Agent
GEMINIgeminiGoogle Gemini CLI
CODEXcodexOpenAI Codex
OPENCODEopencodeOpencode CLI
CURSOR_AGENTcursorCursor Agent
QWEN_CODEqwenQwen Code
COPILOTcopilotGitHub Copilot
DROIDdroidDroid Agent
// Create an executor instance
const executor = createExecutor("CLAUDE_CODE");
const availability = executor.getAvailabilityInfo();

// Executors that support non-interactive chat
const CHAT_SUPPORTED_EXECUTORS = ["CLAUDE_CODE", "GEMINI", "CODEX"];

5.1.2 Gateway - HTTP/WebSocket API Gateway

The Viben Gateway is a Fastify-based server running on port 18790. It serves as the primary interface between the Desktop/CLI frontends and the @viben/core backend, exposing 40+ API routes organized by domain.

Route ModuleEndpoint PrefixFunction
health/healthHealth check
agents/api/agentAgent CRUD
sessions/api/sessionsSession management
executors/api/executorsExecutor management
models/api/modelsModel configuration
providers/api/providersProvider configuration
channels/api/channelsMessage channels
cron/api/cronScheduled tasks
mcp/api/mcpMCP server management
mcp-inspector/api/mcp-inspectorMCP debugger
workspaces/api/workspacesWorkspaces
group-chats/api/group-chatsGroup chats
chat-list/api/chat-listChat list
agent-run/api/agent-runAgent run (SSE)
agent-ws/api/agent-wsAgent WebSocket
files/api/filesFile operations
filesystem/api/filesystemFilesystem browsing
terminal/api/terminalTerminal sessions
history/api/historyHistory records
telemetry/api/telemetryTelemetry data
sandbox/api/sandboxSandbox execution
commands/api/commandsCommand execution
python/api/pythonPython environment
service-keys/api/service-keysService keys
usage/api/usageUsage statistics
installed-sources/api/installed-sourcesInstalled sources
logs/api/logsLog viewer
marketplace/api/marketplaceMarketplace integration
official-registry/api/official-registryOfficial registry
cache/api/cacheCache management
tunnel/api/tunnelTunnel service
kanban-data/api/kanban-dataKanban data
packages/api/packagesPackage management
github/api/githubGitHub integration
tasks/api/tasksTask management
events/api/eventsEvent stream (SSE)
ws/wsWebSocket

5.1.3 Services - Background Services

The services layer provides long-running background capabilities that power the Gateway and agent orchestration. The ServiceManager coordinates startup, shutdown, and health monitoring for all services.

ServiceDescription
EventServiceEvent broadcasting and streaming
SessionStoreServiceFile-based session persistence
CronServiceScheduled task management
ContainerServiceProcess spawning and management
HistoryServiceAgent history management
MessageBusChannel message routing
ServiceManagerBackground service management (MCP, Gateway, Viben)
BackgroundTaskManagerBackground task management (observer pattern)
AgentServiceAgent session lifecycle, plan approval
SandboxServiceIsolated code execution (multi-provider)
GitHubServiceGitHub integration (auth, repos, issues, PRs, releases)

5.1.4 GitHub Integration

The GitHub service module provides deep integration with GitHub for workspace-level repository management.

Capabilities:

  • Authentication: gh CLI / Personal Access Token (PAT)
  • Repository management: Connect, configure, retrieve info
  • Issue management: List, detail, comments, investigation analysis
  • Pull Requests: List, create, detail
  • Releases: List, create, asset management
  • Issue import: Import issues as spec files

Configuration is stored at ~/.viben/workspaces/{workspace_id}/github.yaml.

interface GitHubConfig {
auth?: GitHubAuth; // Authentication info
repository?: GitHubRepositoryConfig; // Connected repository
preferences?: GitHubPreferences; // User preferences
}

5.2 @viben/api-client

Positioning: TypeScript API client for the Viben platform

Usage Example:

import { VibenClient } from '@viben/api-client';

const client = new VibenClient({
baseUrl: 'https://viben-web.vercel.app',
apiKey: 'viben_xxx...',
});

// List MCP packages
const { packages } = await client.mcp.list({ page: 1 });

// Search skills
const { packages: skills } = await client.skill.search('git');

5.3 @viben/kanban

Positioning: Feature-rich kanban component library

Core Components:

ComponentDescription
KanbanProviderKanban context provider
KanbanBoardMain kanban component
KanbanCardTask card
PrioritySelectorPriority selector
AssigneeManagerAssignee management
DueDatePickerDue date picker
TagManagerTag system
FilterSystemFilter system
SubtaskManagerSubtask management
BulkActionsBulk actions
RelationshipTrackerRelationship tracker (blocking relationships)
ActivityFeedActivity feed
CommentListComment list

Dependencies: @dnd-kit/core, @dnd-kit/sortable, @viben/ui


5.4 @viben/ui

Positioning: Shared UI component library (Radix-based)

Component List:

  • Avatar, Badge, Breadcrumb
  • Button, Card, Dialog
  • Dropdown Menu, Input, Label
  • Scroll Area, Select, Separator
  • Skeleton, Switch, Tabs
  • Textarea, Tooltip

Build Foundation: Radix UI primitives + TailwindCSS


5.5 viben (CLI)

Positioning: AI agent cluster orchestration CLI

Dependencies: commander, chalk, yaml

Binary: viben (installed globally via npm)


6. Backend Services

6.1 browse-mcp

Positioning: Academic paper search Python MCP server

Supported Data Sources (18):

CategoryData Sources
FreearXiv, PubMed, PMC, bioRxiv, medRxiv, Google Scholar, Semantic Scholar, CORE, Crossref, IACR
API Key RequiredScienceDirect, Springer, IEEE Xplore, Scopus
Institutional AccessACM, Web of Science, JSTOR, ResearchGate

Architecture: Plugin-based searchers using stevedore


7. Data Flow and Architecture Patterns

7.1 Package Dependency Graph

@viben/core
|
+-------------+-------------+
| | |
@viben/ui @viben/api-client |
| | |
@viben/kanban | |
| | |
+-------------+-------------+
|
+-------------+-------------+
| |
@viben/web @viben/desktop

7.2 Data Flow Patterns

Desktop Application Data Flow:

User Action --> React Component --> Zustand Store --> Tauri Command (IPC)
| |
React Query <----------- Response <----- Rust Backend
|
UI State Update

Web Application Data Flow:

User Action --> React Component --> API Route Handler --> Drizzle ORM --> PostgreSQL
| |
Server Response <----------------------------------------------+

7.3 State Management Patterns

Desktop Application (Zustand + Persistence):

// apps/desktop/src/stores/app-store.ts
export const useAppStore = create<AppState>()(
persist(
(set, get) => ({
// State with getters/setters
}),
{
name: "viben-storage",
partialize: (state) => ({ /* Keys to persist */ }),
}
)
);

Web Application (Server-side + Drizzle):

// Database operations via Drizzle ORM
const user = await db.query.users.findFirst({
where: eq(users.id, userId),
with: { workspaces: true }
});

7.4 API Patterns

Web API Routes (Next.js App Router):

/api/auth/* # Authentication
/api/mcp/* # MCP package CRUD
/api/skill/* # Skill package CRUD
/api/workspaces/* # Workspace management
/api/collections/* # Collections
/api/admin/* # Admin endpoints

Desktop IPC Commands (Tauri):

// Commands exposed via invoke_handler
commands::mcp::start_mcp_server
commands::agents::read_agent_config
commands::viben_agents::viben_list_agents

7.5 Core Architecture Patterns

PatternDescription
Monorepo + TurborepoShared packages, parallel builds, caching
Hybrid Application ArchitectureWeb (Next.js) + Desktop (Tauri + Vite)
Shared Core LibraryTypeScript (@viben/core) provides configuration, Gateway, executors, and services
Gateway LayerFastify-based HTTP/WebSocket server decouples frontends from core logic
Plugin Architecturebrowse-mcp uses stevedore for extensible searchers
Offline-First DesktopSQLite local storage + cloud sync
Component Library PatternRadix primitives wrapped as @viben/ui

8. Build and Deployment

8.1 Build Commands

# Full build
pnpm build

# Type checking
pnpm typecheck

# Development mode
pnpm dev

# Clean
pnpm clean

# Format
pnpm format

8.2 Application-Specific Commands

Web Application:

cd apps/web
pnpm dev # Development server
pnpm build # Production build
pnpm db:push # Push database schema
pnpm db:studio # Open Drizzle Studio

Desktop Application:

cd apps/desktop
pnpm dev # Development mode (Vite + Tauri)
pnpm build # Production build
pnpm tauri dev # Tauri development mode
pnpm tauri build # Tauri production build

8.3 Release Process

  • Web: Vercel automatic deployment
  • Desktop: GitHub Actions + Tauri build
  • CLI: npm publish + Homebrew tap

Appendix

A. Key Configuration Files

FilePurpose
package.jsonRoot package configuration
pnpm-workspace.yamlWorkspace definition
turbo.jsonTurborepo task configuration
tsconfig.jsonTypeScript configuration
apps/web/drizzle.config.tsDrizzle ORM configuration
apps/desktop/src-tauri/Cargo.tomlRust dependencies
apps/desktop/src-tauri/tauri.conf.jsonTauri configuration

B. Environment Variables

Web Application (apps/web/.env):

DATABASE_URL= # PostgreSQL connection string
NEXTAUTH_SECRET= # NextAuth secret
GITHUB_CLIENT_ID= # GitHub OAuth
GITHUB_CLIENT_SECRET= # GitHub OAuth

Desktop Application: Sensitive information managed via Tauri secure storage

C. Version Information

ComponentVersion
Node.js>=20.0.0
pnpm9.15.0
React^19.0.0
Next.js^15.5.11
Tauri2.x
TailwindCSSv3.4 (web), v4.1 (desktop)