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 â
runlsagainst 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
| Category | Technology |
|---|---|
| Framework | Next.js 16 + React 19 |
| Routing | SPA inside Next.js with react-router-dom |
| Language | TypeScript |
| UI Components | @lobehub/ui |
| CSS-in-JS | @lobehub/ui createStaticStyles |
| Icons | lucide-react, @ant-design/icons |
| i18n | react-i18next |
| State | zustand |
| URL Params | nuqs |
| Data Fetching | SWR |
| React Hooks | aHooks |
| Date/Time | dayjs |
| Utilities | es-toolkit |
| API | TRPC (type-safe) |
| Database | Neon PostgreSQL + Drizzle ORM |
| Testing | Vitest |
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
| Layer | Location |
|---|---|
| UI Components | src/components, src/features |
| SPA Pages | src/routes/ |
| React Router | src/spa/router/ |
| Global Providers | src/layout |
| Zustand Stores | src/store |
| Client Services | src/services/ |
| REST API | src/app/(backend)/webapi |
| tRPC Routers | `apps/server/src/routers/{async |
| Server Services | apps/server/src/services (can access DB) |
| Server Modules | apps/server/src/modules (no DB access) |
| Feature Flags | apps/server/src/featureFlags |
| Global Config | apps/server/src/globalConfig |
| DB Schema | packages/database/src/schemas |
| DB Model | packages/database/src/models |
| DB Repository | packages/database/src/repositories |
| Third-party | src/libs (analytics, oidc, etc.) |
| Builtin Tools | packages/builtin-tool-*, packages/builtin-tools |
| Open-source stub | src/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}andpackages/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 undersrc/app/(backend)/cron/. - File-resolution order in cloud:
@/store/xâ cloudsrc/store/xfirst, thenlobehub/packages/store/src/x, thenlobehub/src/store/x. Cloud override wins.
When working in this repo alone, ignore the cloud layer â the stubs insrc/business/ and packages/business/ are the source of truth here.
Installs: 4.4K | GitHub stars: 86.2K | First seen: Jan 24, 2026


