Skip to main content

Backend Development Guide

Viben project backend development best practices


Overview

This directory contains backend development guidelines. The backend is built with TypeScript in packages/core, serving as the foundation for all frontend applications.

Important: packages/core is the sole boundary for all apps to access underlying capabilities.

Architecture

Important: Viben uses a dual-language architecture:

ComponentLanguagePurpose
packages/coreTypeScriptGateway API, CLI, Agent system, MCP client
backend/browse-mcpPythonAcademic search MCP server (arXiv, PubMed, etc.)

The guidelines in this directory primarily focus on packages/core (TypeScript).

For Python MCP server development, see Plugin Architecture, which documents the stevedore-based plugin system in backend/browse-mcp.


Guide Index

Core Guides

GuideDescriptionStatus
Directory StructureModule organization and file layoutDone
Plugin ArchitecturePython MCP pluggable Provider systemDone
Database GuidelinesORM patterns, queries, migrationsDone
Error HandlingError types, handling strategiesDone
Quality GuidelinesCode standards, forbidden patternsDone
Logging GuidelinesStructured logging, log levelsDone

Gateway API

GuideDescriptionStatus
Gateway IndexGateway module indexDone
Health CheckHealth check endpointDone
Agent APIAgent management APIDone
Model APIModel configuration APIDone
Session APISession management APIDone
Group Chat APIGroup chat APIDone
Executor APIExecutor execution APIDone
Cron APIScheduled task APIDone
Channel APIChannel management APIDone
Provider APIProvider configuration APIDone
Task APITask management APIDone
Chat List APIChat list aggregation APIDone
Event Stream APISSE event streamDone
WebSocketWebSocket real-time communicationDone

Web API

GuideDescriptionStatus
MCP APIMCP package APIDone
Skill APISkill package APIDone
User APIUser management APIDone
Social APISocial features APIDone
Collections APICollections APIDone
Package ManagementCommon package operationsDone

Modules

GuideDescriptionStatus
Auth ModuleAuthentication systemDone
Database ModuleDatabase configurationDone
Storage ModuleFile storageDone
Project SetupProject initializationDone

Deployment

GuideDescriptionStatus
Vercel DeploymentVercel deployment guideDone
GitHub OAuthGitHub OAuth integrationDone

Tech Stack

  • Runtime: Node.js + TypeScript
  • HTTP Framework: Hono
  • AI SDK: Vercel AI SDK
  • Configuration: YAML (file-native paradigm)
  • Storage: File-based (~/.viben/)
  • Telemetry: OpenTelemetry

API Naming Convention

Important: All Gateway API query parameters use snake_case format:

// Correct
workspace_path, include_global, session_id

// Incorrect
workspacePath, includeGlobal, sessionId

Language: Documentation in English, code comments in English.