Files
YuTengjing 191f3fe776 📝 docs: fix outdated content across the docs site (#16964)
* 📝 docs: fix outdated content across the docs site

Audited docs/ against the current codebase and fixed stale content that
drifted after major refactors (Clerk/NextAuth → Better Auth, src/server →
apps/server, src/{config,envs,locales} → packages/*, model-bank updates).

- self-hosting/auth: mark removed NextAuth/Clerk pages with deprecation
  warnings; fix microsoft/zitadel alias claims and the Logto callback path
- environment-variables & advanced: correct wrong defaults (S3_SET_ACL,
  AI_IMAGE_DEFAULT_IMAGE_NUM, index/proxy URLs), drop non-existent env vars
  and fictional feature flags, fix OIDC config guidance
- development: update refactored paths, Better Auth, .mjs configs, remove
  the MSW section (msw is not a dependency)
- providers & model examples: replace retired model ids with in-bank ones;
  fix comfyui frontmatter corruption
- usage: rename Moderator→Orchestrator, GTD→Task, correct shortcut keys,
  channel capability tables, Feishu/Lark WebSocket mode
- platform/migration: fix dead links, docker service name, npx/npm → bun

EN and zh-CN pairs updated together.

* 📝 docs: fix Logto callback path and AUTH_SECRET deprecation guidance

- Revert Logto/Sealos callback URLs to /api/auth/callback/logto to match
  the runtime SSO redirectURI override
- Narrow legacy auth Callout: AUTH_SECRET remains required for Better Auth;
  mark NEXT_AUTH_SECRET as deprecated in zh-CN

* 📝 docs: refresh agent skills for locales, env, auth, and agentRun paths

Align OSS agent guidance with post-refactor layout:
- packages/locales/src/default + bun run i18n
- packages/env/src for env schemas (@/envs alias)
- spa-auth shell + src/routes/auth segments
- chat agentRun/transports/hetero instead of aiChat

* 📝 docs: document APP_URL as required for Better Auth base URL

Self-hosted auth uses appEnv.APP_URL as baseURL, not request-header
auto-detection. NEXT_PUBLIC_AUTH_URL remains deprecated.

* 📝 docs: note self-host search provider setup for web search

Built-in lobe-web-browsing needs no client plugin, but self-hosted
servers still require SEARCH_PROVIDERS / SEARXNG_URL (default SearXNG).

* 📝 docs: point feature guide welcome UI at AgentHome

Opening message/questions on the agent chat page live in
src/features/AgentHome, not Onboarding WelcomeMessage.
2026-07-10 17:50:03 +08:00

118 lines
7.7 KiB
Plaintext

---
title: Technical Development Getting Started Guide
description: >-
Explore the LobeHub development setup, technology stack, and contribution
guidelines.
tags:
- LobeHub
- Next.js
- Development Guide
- Internationalization
- Open Source
---
# Technical Development Getting Started Guide
Welcome to the LobeHub Technical Development Getting Started Guide. LobeHub is an AI conversation application built on the Next.js framework, incorporating a range of technology stacks to achieve diverse functionalities and features. This guide will detail the main technical components of LobeHub and how to configure and use these technologies in your development environment.
## Basic Technology Stack
The core technology stack of LobeHub is as follows:
- **Framework**: [Next.js](https://nextjs.org/) 16 + [React](https://react.dev/) 19, providing server-side rendering, Router Handler, and other key features.
- **Component Library**: [Ant Design (antd)](https://ant.design/) as the base component library, [@lobehub/ui](https://github.com/lobehub/lobe-ui) as the business component library.
- **State Management**: [zustand](https://github.com/pmndrs/zustand), a lightweight and easy-to-use state management library.
- **Data Fetching**: [SWR](https://swr.vercel.app/) for client-side data fetching.
- **Routing**: Hybrid routing architecture — [Next.js App Router](https://nextjs.org/) for static pages (e.g., auth pages), [React Router DOM](https://reactrouter.com/) for the main SPA.
- **API**: [tRPC](https://trpc.io/) for end-to-end type-safe API communication.
- **Database**: [Drizzle ORM](https://orm.drizzle.team/) + PostgreSQL.
- **Internationalization**: [react-i18next](https://react.i18next.com/) for multilingual support.
- **Styling**: [antd-style](https://github.com/ant-design/antd-style), a CSS-in-JS library that complements Ant Design.
- **Unit Testing**: [Vitest](https://github.com/vitest-dev/vitest) for unit testing.
## Folder Directory Structure
LobeHub uses a Monorepo architecture
(`@lobechat/` namespace).
The top-level directory structure is as follows:
```bash
lobehub/
├── apps/
│ ├── cli/ # LobeHub CLI
│ ├── desktop/ # Electron desktop app
│ └── server/ # Standalone server (tRPC routers, services, modules)
├── packages/ # Shared packages (@lobechat/*)
│ ├── database/ # Database schemas, models, repositories
│ ├── agent-runtime/ # Agent runtime
│ ├── model-runtime/ # Model runtime
│ ├── app-config/ # App configuration, client and server env vars
│ ├── env/ # Env var definitions and validation (analytics, auth, LLM, etc.)
│ ├── locales/ # Internationalization default language files
│ ├── builtin-tools/ # Built-in tools registry (inspectors, interventions, etc.)
│ └── ... # More shared packages
├── src/ # Main application source code
│ ├── app/ # Next.js App Router: backend API routes + SPA/auth HTML shell serving
│ ├── components/ # Reusable UI components
│ ├── const/ # Application constants and enums
│ ├── features/ # Business feature modules (Agent settings, plugin dev, etc.)
│ ├── helpers/ # Utility helper functions
│ ├── hooks/ # Reusable custom Hooks
│ ├── layout/ # Layout components (AuthProvider, GlobalProvider, etc.)
│ ├── libs/ # Third-party integrations (better-auth, OIDC, tRPC, etc.)
│ ├── routes/ # SPA page segments, grouped by platform ((main)/(mobile)/(desktop)/(popup))
│ ├── server/ # Remaining server-side modules not yet moved to apps/server
│ ├── services/ # Client-side service interfaces
│ ├── spa/ # SPA entry points and React Router config
│ ├── store/ # Zustand state management
│ ├── styles/ # Global styles and CSS-in-JS configurations
│ ├── types/ # TypeScript type definitions
│ └── utils/ # General utility functions
├── locales/ # i18n translation files (zh-CN, en-US, etc.)
└── e2e/ # E2E tests (Cucumber + Playwright)
```
For a detailed introduction to the directory structure, see: [Folder Directory Structure](/docs/development/basic/folder-structure)
## Local Development Environment Setup
Please refer to the
[Environment Setup Guide](/docs/development/basic/setup-development)
for the complete setup process,
including software installation, project configuration,
Docker service startup, and database migrations.
## Code Style and Contribution Guide
In the LobeHub project, we place great emphasis on the quality and consistency of the code. For this reason, we have established a series of code style standards and contribution processes to ensure that every developer can smoothly participate in the project. Here are the code style and contribution guidelines you need to follow as a developer.
- **Code Style**: We use `@lobehub/lint` to unify the code style, including ESLint, Prettier, remarklint, and stylelint configurations. Please adhere to our code standards to maintain code consistency and readability.
- **Contribution Process**: We use gitmoji and semantic release for code submission and release processes. Please use gitmoji to annotate your commit messages and ensure compliance with the semantic release standards so that our automation systems can correctly handle version control and releases.
All contributions will undergo code review. Maintainers may suggest modifications or requirements. Please respond actively to review comments and make timely adjustments. We look forward to your participation and contribution.
For detailed code style and contribution guidelines, please refer to [Code Style and Contribution Guide](/docs/development/basic/contributing-guidelines).
## Internationalization Implementation Guide
LobeHub uses `react-i18next` for multilingual support,
ensuring a global user experience.
Default language files are located in `packages/locales/src/default/`
(English). Translation files are in the `locales/` directory.
During development, you only need to edit keys in
`packages/locales/src/default/` — CI automatically generates
translation files for other languages.
If you want to add a new language, follow specific steps detailed in [New Language Addition Guide](/docs/development/internationalization/add-new-locale). We encourage you to participate in our internationalization efforts to provide better services to global users.
For a detailed guide on internationalization implementation, please refer to [Internationalization Implementation Guide](/docs/development/internationalization/internationalization-implementation).
## Appendix: Resources and References
To support developers in better understanding and using the technology stack of LobeHub, we provide a comprehensive list of resources and references — [LobeHub Resources and References](/docs/development/basic/resources) - Visit our maintained list of resources, including tutorials, articles, and other useful links.
We encourage developers to utilize these resources to deepen their learning and enhance their skills, join community discussions through [LobeHub GitHub Discussions](https://github.com/lobehub/lobehub/discussions) or [Discord](https://discord.com/invite/AYFPHvv2jT), ask questions, or share your experiences.
If you have any questions or need further assistance, please do not hesitate to contact us through the above channels.