Agent Skills: LobeHub Project Overview

Use for the OSS repository map, code-layer lookup, apps/packages/src ownership and business stubs.

ID: lobehub/lobe-chat/project-overview

Repository

lobehubLicense: NOASSERTION
82,43615,876

Install this agent skill to your local

npx skills add lobehub/lobe-chat --skill project-overview

Skill Files

The files that make up project-overview.

Download Skill

Loading file tree…

.agents/skills/project-overview/SKILL.md

Skill Metadata

Name
project-overview
Description
Use for the OSS repository map, code-layer lookup, apps/packages/src ownership and business stubs.

LobeHub Project Overview

The directory listings below are a curated map of key locations, not an exhaustive tree. packages/, src/store/, route groups etc. grow over time β€” run ls against the real directory for the current set.

Project Description

Open-source, modern-design AI Agent Workspace: LobeHub (previously LobeChat). This repo is the open-source root (github.com/lobehub/lobehub, package @lobehub/lobehub).

Supported platforms:

  • Web desktop/mobile
  • Desktop (Electron) β€” apps/desktop
  • Mobile app (React Native) β€” separate repo, already launched (not in this monorepo)

Logo emoji: 🀯

Complete Tech Stack

CategoryTechnology
FrameworkNext.js 16 + React 19
RoutingSPA inside Next.js with react-router-dom
LanguageTypeScript
UI Components@lobehub/ui
CSS-in-JS@lobehub/ui createStaticStyles
Iconslucide-react, @ant-design/icons
i18nreact-i18next
Statezustand
URL Paramsnuqs
Data FetchingSWR
React HooksaHooks
Date/Timedayjs
Utilitieses-toolkit
APITRPC (type-safe)
DatabaseNeon PostgreSQL + Drizzle ORM
TestingVitest

Exact versions live in the root package.json β€” check there, not here.

Monorepo Layout

Flat layout β€” apps/, packages/, and src/ all sit at the repo root. No git submodules.

(repo root)
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ cli/                  # LobeHub CLI
β”‚   β”œβ”€β”€ desktop/              # Electron desktop app
β”‚   └── server/               # Next.js-backed server (`@/server/*` alias)
β”‚       └── src/
β”‚           β”œβ”€β”€ router-hono/  # Hono endpoint routers and standalone runtime
β”‚           └── ...           # featureFlags, globalConfig, modules, routers, services, utils, workflows
β”œβ”€β”€ docs/                     # changelog, development, self-hosting, usage
β”œβ”€β”€ locales/                  # en-US, zh-CN, ...
β”œβ”€β”€ packages/                 # ~80 @lobechat/* workspace packages β€” `ls` for the full set. Key ones:
β”‚   β”œβ”€β”€ agent-runtime/        # Agent runtime core
β”‚   β”œβ”€β”€ agent-signal/         # Agent Signal pipeline
β”‚   β”œβ”€β”€ agent-tracing/        # Tracing / snapshots
β”‚   β”œβ”€β”€ builtin-tool-*/       # Per-tool packages (calculator, web-browsing, claude-code, ...)
β”‚   β”œβ”€β”€ builtin-tools/        # Central registries that compose builtin-tool-*
β”‚   β”œβ”€β”€ context-engine/
β”‚   β”œβ”€β”€ database/             # src/{models,schemas,repositories}
β”‚   β”œβ”€β”€ model-bank/           # Model definitions & provider cards
β”‚   β”œβ”€β”€ model-runtime/        # src/{core,providers}
β”‚   β”œβ”€β”€ locales/              # i18n source of truth: packages/locales/src/default/
β”‚   β”œβ”€β”€ env/                  # env schemas (@/envs/* β†’ packages/env/src/*)
β”‚   β”œβ”€β”€ app-config/
β”‚   β”œβ”€β”€ business/             # Open-source stubs (config, const, model-bank, model-runtime) β€” overridden by cloud
β”‚   β”œβ”€β”€ types/
β”‚   └── utils/
└── src/
    β”œβ”€β”€ app/
    β”‚   β”œβ”€β”€ (backend)/        # api, f, market, middleware, oidc, trpc, webapi
    β”‚   β”œβ”€β”€ spa/              # SPA HTML template service
    β”‚   └── spa-auth/         # Auth HTML shell (SSR)
    β”œβ”€β”€ routes/               # SPA page segments (thin β€” delegate to features/)
    β”‚   └── (main)/ (mobile)/ (desktop)/ (popup)/ auth/ onboarding/ share/
    β”œβ”€β”€ spa/                  # SPA entries + router config
    β”‚   β”œβ”€β”€ entry.{web,mobile,desktop,popup}.tsx
    β”‚   └── router/
    β”œβ”€β”€ business/             # Open-source stubs (client/server) β€” cloud repo provides real impls
    β”œβ”€β”€ features/             # Domain business components
    β”œβ”€β”€ store/                # ~30 zustand stores β€” `ls` for the full set
    └── ...                   # components, hooks, layout, libs, services, types, utils

Architecture Map

LayerLocation
UI Componentssrc/components, src/features
SPA Pagessrc/routes/
React Routersrc/spa/router/
Global Providerssrc/layout
Zustand Storessrc/store
Client Servicessrc/services/
REST APIsrc/app/(backend)/webapi
tRPC Routersapps/server/src/routers/{async|lambda|mobile|tools}
Server Servicesapps/server/src/services (can access DB)
Server Modulesapps/server/src/modules (no DB access)
Feature Flagsapps/server/src/featureFlags
Global Configapps/server/src/globalConfig
DB Schemapackages/database/src/schemas
DB Modelpackages/database/src/models
DB Repositorypackages/database/src/repositories
Third-partysrc/libs (analytics, oidc, etc.)
Builtin Toolspackages/builtin-tool-*, packages/builtin-tools
Open-source stubsrc/business/*, packages/business/* (this repo)

Data Flow

React UI β†’ Store Actions β†’ Client Service β†’ TRPC Lambda β†’ Server Services β†’ DB Model β†’ PostgreSQL

Note: Relationship to the Cloud Repo

This open-source repo is consumed by a separate, private cloud (SaaS) repo as a git submodule mounted at lobehub/. The cloud repo provides:

  • src/business/{client,server} and packages/business/* implementations that override the stubs shipped here.
  • Cloud-only routes (e.g. (cloud)/, embed/), cloud-only stores (e.g. subscription/), cloud-only TRPC routers (billing, budget, risk control, …), and Vercel cron routes under src/app/(backend)/cron/.
  • File-resolution order in cloud: @/store/x β†’ cloud src/store/x first, then lobehub/packages/store/src/x, then lobehub/src/store/x. Cloud override wins.

When working in this repo alone, ignore the cloud layer β€” the stubs in src/business/ and packages/business/ are the source of truth here.

More agent skills