Methodologydesign

project-overview

Complete project architecture and structure guide. Use when exploring the codebase, understanding project organization, finding files, or needing comprehensive architectural context. Triggers on architecture questions, directory navigation, or project overview needs.

lobehub/lobehub
View source

Install

npx skills add https://github.com/lobehub/lobehub --skill project-overview

Use with your agent

ClaudeCursorOpenAIGemini

Install the project-overview skill, then use it as build context. Run: npx skills add https://github.com/lobehub/lobehub --skill project-overview. Then read the installed skill.md and follow its guidance to build or refactor my project.

LobeHub Project Overview

Project Description

Open-source, modern-design AI Agent Workspace: LobeHub (previously LobeChat).

Supported platforms:

  • Web desktop/mobile
  • Desktop (Electron)
  • Mobile app (React Native) - coming soon

Logo emoji: 🀯

Complete Tech Stack

CategoryTechnology
FrameworkNext.js 16 + React 19
RoutingSPA inside Next.js with react-router-dom
LanguageTypeScript
UI Components@lobehub/ui, antd
CSS-in-JSantd-style
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

Complete Project Structure

Monorepo using @lobechat/ namespace for workspace packages.

lobehub/
β”œβ”€β”€ apps/
β”‚   └── desktop/                 # Electron desktop app
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ changelog/
β”‚   β”œβ”€β”€ development/
β”‚   β”œβ”€β”€ self-hosting/
β”‚   └── usage/
β”œβ”€β”€ locales/
β”‚   β”œβ”€β”€ en-US/
β”‚   └── zh-CN/
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ agent-runtime/           # Agent runtime
β”‚   β”œβ”€β”€ builtin-agents/
β”‚   β”œβ”€β”€ builtin-tool-*/          # Builtin tool packages
β”‚   β”œβ”€β”€ business/                # Cloud-only business logic
β”‚   β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”œβ”€β”€ const/
β”‚   β”‚   └── model-runtime/
β”‚   β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ const/
β”‚   β”œβ”€β”€ context-engine/
β”‚   β”œβ”€β”€ conversation-flow/
β”‚   β”œβ”€β”€ database/
β”‚   β”‚   └── src/
β”‚   β”‚       β”œβ”€β”€ models/
β”‚   β”‚       β”œβ”€β”€ schemas/
β”‚   β”‚       └── repositories/
β”‚   β”œβ”€β”€ desktop-bridge/
β”‚   β”œβ”€β”€ edge-config/
β”‚   β”œβ”€β”€ editor-runtime/
β”‚   β”œβ”€β”€ electron-client-ipc/
β”‚   β”œβ”€β”€ electron-server-ipc/
β”‚   β”œβ”€β”€ fetch-sse/
β”‚   β”œβ”€β”€ file-loaders/
β”‚   β”œβ”€β”€ memory-user-memory/
β”‚   β”œβ”€β”€ model-bank/
β”‚   β”œβ”€β”€ model-runtime/
β”‚   β”‚   └── src/
β”‚   β”‚       β”œβ”€β”€ core/
β”‚   β”‚       └── providers/
β”‚   β”œβ”€β”€ observability-otel/
β”‚   β”œβ”€β”€ prompts/
β”‚   β”œβ”€β”€ python-interpreter/
β”‚   β”œβ”€β”€ ssrf-safe-fetch/
β”‚   β”œβ”€β”€ types/
β”‚   β”œβ”€β”€ utils/
β”‚   └── web-crawler/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ (backend)/
β”‚   β”‚   β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”‚   β”œβ”€β”€ f/
β”‚   β”‚   β”‚   β”œβ”€β”€ market/
β”‚   β”‚   β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   β”‚   β”œβ”€β”€ oidc/
β”‚   β”‚   β”‚   β”œβ”€β”€ trpc/
β”‚   β”‚   β”‚   └── webapi/
β”‚   β”‚   β”œβ”€β”€ spa/                  # SPA HTML template service
β”‚   β”‚   └── [variants]/
β”‚   β”‚       └── (auth)/           # Auth pages (SSR required)
β”‚   β”œβ”€β”€ routes/                  # SPA page components (Vite)
β”‚   β”‚   β”œβ”€β”€ (main)/
β”‚   β”‚   β”œβ”€β”€ (mobile)/
β”‚   β”‚   β”œβ”€β”€ (desktop)/
β”‚   β”‚   β”œβ”€β”€ onboarding/
β”‚   β”‚   └── share/
β”‚   β”œβ”€β”€ spa/                     # SPA entry points and router config
β”‚   β”‚   β”œβ”€β”€ entry.web.tsx
β”‚   β”‚   β”œβ”€β”€ entry.mobile.tsx
β”‚   β”‚   β”œβ”€β”€ entry.desktop.tsx
β”‚   β”‚   └── router/
β”‚   β”œβ”€β”€ business/                # Cloud-only (client/server)
β”‚   β”‚   β”œβ”€β”€ client/
β”‚   β”‚   β”œβ”€β”€ locales/
β”‚   β”‚   └── server/
β”‚   β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ const/
β”‚   β”œβ”€β”€ envs/
β”‚   β”œβ”€β”€ features/
β”‚   β”œβ”€β”€ helpers/
β”‚   β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ layout/
β”‚   β”‚   β”œβ”€β”€ AuthProvider/
β”‚   β”‚   └── GlobalProvider/
β”‚   β”œβ”€β”€ libs/
β”‚   β”‚   β”œβ”€β”€ better-auth/
β”‚   β”‚   β”œβ”€β”€ oidc-provider/
β”‚   β”‚   └── trpc/
β”‚   β”œβ”€β”€ locales/
β”‚   β”‚   └── default/
β”‚   β”œβ”€β”€ server/
β”‚   β”‚   β”œβ”€β”€ featureFlags/
β”‚   β”‚   β”œβ”€β”€ globalConfig/
β”‚   β”‚   β”œβ”€β”€ modules/
β”‚   β”‚   β”œβ”€β”€ routers/
β”‚   β”‚   β”‚   β”œβ”€β”€ async/
β”‚   β”‚   β”‚   β”œβ”€β”€ lambda/
β”‚   β”‚   β”‚   β”œβ”€β”€ mobile/
β”‚   β”‚   β”‚   └── tools/
β”‚   β”‚   └── services/
β”‚   β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ store/
β”‚   β”‚   β”œβ”€β”€ agent/
β”‚   β”‚   β”œβ”€β”€ chat/
β”‚   β”‚   └── user/
β”‚   β”œβ”€β”€ styles/
β”‚   β”œβ”€β”€ tools/
β”‚   β”œβ”€β”€ types/
β”‚   └── utils/
└── e2e/                         # E2E tests (Cucumber + Playwright)

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 Routerssrc/server/routers/{async|lambda|mobile|tools}
Server Servicessrc/server/services (can access DB)
Server Modulessrc/server/modules (no DB access)
Feature Flagssrc/server/featureFlags
Global Configsrc/server/globalConfig
DB Schemapackages/database/src/schemas
DB Modelpackages/database/src/models
DB Repositorypackages/database/src/repositories
Third-partysrc/libs (analytics, oidc, etc.)
Builtin Toolssrc/tools, packages/builtin-tool-*
Cloud-onlysrc/business/*, packages/business/*

Data Flow

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