dify/web
github-actions[bot] e98c1adfbf
chore(i18n): sync translations with en-US (#31630)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
2026-01-28 17:49:10 +08:00
..
__mocks__ test(web): add global zustand mock for tests (#31149) 2026-01-17 17:29:13 +08:00
__tests__ refactor(web): setup status caching (#30798) 2026-01-13 16:59:49 +08:00
.husky chore: update TypeScript type-check command and add native-preview dependency for faster performance (#29179) 2025-12-05 14:42:37 +08:00
.storybook chore: update to story book nextjs-vite (#31536) 2026-01-26 17:07:20 +08:00
.vscode chore: init tsslint (#31209) 2026-01-20 11:08:50 +08:00
app feat: summary index (#31523) 2026-01-28 11:09:34 +08:00
assets feat: introduce trigger functionality (#27644) 2025-11-12 17:59:37 +08:00
bin refactor(web): migrate to Vitest and esm (#29974) 2025-12-22 16:35:22 +08:00
config fix: remove hardcoded 48-character limit from text inputs (#30156) 2026-01-15 17:43:00 +08:00
constants fix: check and update doc links (#30849) 2026-01-21 16:31:48 +08:00
context feat: frontend part of support try apps (#31287) 2026-01-22 18:16:37 +08:00
contract feat: frontend part of support try apps (#31287) 2026-01-22 18:16:37 +08:00
docker fix: Login secret text transmission (#29659) 2025-12-16 16:55:51 +08:00
eslint-rules chore: lint custom tag in i18n (#31301) 2026-01-21 12:21:30 +08:00
hooks fix: check and update doc links (#30849) 2026-01-21 16:31:48 +08:00
i18n chore(i18n): sync translations with en-US (#31630) 2026-01-28 17:49:10 +08:00
i18n-config fix: check and update doc links (#30849) 2026-01-21 16:31:48 +08:00
models feat: summary index (#31523) 2026-01-28 11:09:34 +08:00
public feat(web): migrate PWA to Serwist (#30808) 2026-01-10 17:16:18 +09:00
scripts fix: check and update doc links (#30849) 2026-01-21 16:31:48 +08:00
service feat: summary index (#31523) 2026-01-28 11:09:34 +08:00
test test: unify i18next mocks into centralized helpers (#30376) 2025-12-31 16:53:33 +09:00
testing test: unify i18next mocks into centralized helpers (#30376) 2025-12-31 16:53:33 +09:00
themes feat: enhance ProgressBar and UsageInfo for storage mode (#31273) 2026-01-21 14:04:33 +08:00
types feat: enhance quota panel to support additional model providers and integrate trial models feature (#31443) 2026-01-26 14:04:12 +08:00
utils feat: chatflow support multimodal (#31293) 2026-01-27 00:24:48 +08:00
.dockerignore chore: update dockerignore (#30460) 2026-01-05 10:55:14 +08:00
.env.example fix: entrypoint.sh overrides NEXT_PUBLIC_TEXT_GENERATION_TIMEOUT_MS when TEXT_GENERATION_TIMEOUT_MS is unset (#30864) (#30865) 2026-01-13 10:12:51 +08:00
.gitignore chore: no custom lint cache location (#31195) 2026-01-19 10:37:49 +08:00
.npmrc chore(web): remove version prefixes from package.json (#31286) 2026-01-20 21:14:50 +08:00
.nvmrc build: require node 24.13.0 (#30945) 2026-01-15 10:38:55 +08:00
AGENTS.md test: add comprehensive tests for CustomizeModal component (#29709) 2025-12-16 14:21:05 +08:00
CLAUDE.md test: add comprehensive tests for CustomizeModal component (#29709) 2025-12-16 14:21:05 +08:00
Dockerfile build: require node 24.13.0 (#30945) 2026-01-15 10:38:55 +08:00
eslint-suppressions.json test: add tests for dataset document detail (#31274) 2026-01-27 15:43:27 +08:00
eslint.config.mjs fix: check and update doc links (#30849) 2026-01-21 16:31:48 +08:00
global.d.ts feat: integrate Google Analytics event tracking and update CSP for script sources (#30365) 2025-12-30 18:06:47 +08:00
knip.config.ts feat(web): migrate PWA to Serwist (#30808) 2026-01-10 17:16:18 +09:00
next.config.ts chore(web): refactor next.config.js to next.config.ts (#31331) 2026-01-21 15:07:32 +08:00
package.json chore: update react and next version (#31593) 2026-01-27 14:06:09 +08:00
pnpm-lock.yaml chore: update react and next version (#31593) 2026-01-27 14:06:09 +08:00
postcss.config.js refactor(web): migrate to Vitest and esm (#29974) 2025-12-22 16:35:22 +08:00
proxy.ts build: bump NextJS from to 16 with turbopack enable for web production build boost (#27014) 2026-01-21 12:53:29 +08:00
README.md fix: check and update doc links (#30849) 2026-01-21 16:31:48 +08:00
tailwind-common-config.ts feat: enhance ProgressBar and UsageInfo for storage mode (#31273) 2026-01-21 14:04:33 +08:00
tailwind.config.js build: bump NextJS from to 16 with turbopack enable for web production build boost (#27014) 2026-01-21 12:53:29 +08:00
tsconfig.json feat: frontend part of support try apps (#31287) 2026-01-22 18:16:37 +08:00
tsslint.config.ts fix: enforce no-leaked-conditional-rendering as error and fix violations (#31262) 2026-01-20 23:08:59 +08:00
typography.js refactor(web): migrate to Vitest and esm (#29974) 2025-12-22 16:35:22 +08:00
vite.config.ts chore: follow-up fixes for storybook vite migration (#31545) 2026-01-26 20:20:14 +08:00
vitest.config.ts chore: follow-up fixes for storybook vite migration (#31545) 2026-01-26 20:20:14 +08:00
vitest.setup.ts test: add tests for dataset document detail (#31274) 2026-01-27 15:43:27 +08:00

Dify Frontend

This is a Next.js project bootstrapped with create-next-app.

Getting Started

Run by source code

Before starting the web frontend service, please make sure the following environment is ready.

Tip

It is recommended to install and enable Corepack to manage package manager versions automatically:

npm install -g corepack
corepack enable

Learn more: Corepack

First, install the dependencies:

pnpm install

Then, configure the environment variables. Create a file named .env.local in the current directory and copy the contents from .env.example. Modify the values of these environment variables according to your requirements:

cp .env.example .env.local
# For production release, change this to PRODUCTION
NEXT_PUBLIC_DEPLOY_ENV=DEVELOPMENT
# The deployment edition, SELF_HOSTED
NEXT_PUBLIC_EDITION=SELF_HOSTED
# The base URL of console application, refers to the Console base URL of WEB service if console domain is
# different from api or web app domain.
# example: http://cloud.dify.ai/console/api
NEXT_PUBLIC_API_PREFIX=http://localhost:5001/console/api
NEXT_PUBLIC_COOKIE_DOMAIN=
# The URL for Web APP, refers to the Web App base URL of WEB service if web app domain is different from
# console or api domain.
# example: http://udify.app/api
NEXT_PUBLIC_PUBLIC_API_PREFIX=http://localhost:5001/api

# SENTRY
NEXT_PUBLIC_SENTRY_DSN=

Important

  1. When the frontend and backend run on different subdomains, set NEXT_PUBLIC_COOKIE_DOMAIN=1. The frontend and backend must be under the same top-level domain in order to share authentication cookies.
  2. It's necessary to set NEXT_PUBLIC_API_PREFIX and NEXT_PUBLIC_PUBLIC_API_PREFIX to the correct backend API URL.

Finally, run the development server:

pnpm run dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the file under folder app. The page auto-updates as you edit the file.

Deploy

Deploy on server

First, build the app for production:

pnpm run build

Then, start the server:

pnpm run start

If you want to customize the host and port:

pnpm run start --port=3001 --host=0.0.0.0

If you want to customize the number of instances launched by PM2, you can configure PM2_INSTANCES in docker-compose.yaml or Dockerfile.

Storybook

This project uses Storybook for UI component development.

To start the storybook server, run:

pnpm storybook

Open http://localhost:6006 with your browser to see the result.

Lint Code

If your IDE is VSCode, rename web/.vscode/settings.example.json to web/.vscode/settings.json for lint code setting.

Test

We use Vitest and React Testing Library for Unit Testing.

📖 Complete Testing Guide: See web/testing/testing.md for detailed testing specifications, best practices, and examples.

Run test:

pnpm test

Example Code

If you are not familiar with writing tests, refer to:

Analyze Component Complexity

Before writing tests, use the script to analyze component complexity:

pnpm analyze-component app/components/your-component/index.tsx

This will help you determine the testing strategy. See web/testing/testing.md for details.

Documentation

Visit https://docs.dify.ai to view the full documentation.

Community

The Dify community can be found on Discord community, where you can ask questions, voice ideas, and share your projects.