dify/web
Joel 4b6f1861ef fix: view vars artifacts md not support scroll and loading not in the center 2026-02-14 11:00:52 +08:00
..
.husky
.storybook
.vscode
__mocks__ chore(web): pre-align HITL frontend from build/feat/hitl 2026-02-09 15:34:15 +08:00
__tests__ Merge remote-tracking branch 'origin/main' into feat/support-agent-sandbox 2026-02-13 15:17:52 +08:00
app fix: view vars artifacts md not support scroll and loading not in the center 2026-02-14 11:00:52 +08:00
assets
bin
config Merge remote-tracking branch 'origin/main' into feat/support-agent-sandbox 2026-02-10 18:12:41 +08:00
constants
context fix: use localized doc pathMap links for multilingual anchors 2026-02-13 11:30:36 +08:00
contract Merge remote-tracking branch 'origin/main' into feat/support-agent-sandbox 2026-02-04 21:12:53 +08:00
docker
docs chore: migrate to eslint-better-tailwind (#31969) 2026-02-05 18:36:08 +09:00
eslint-rules chore: introduce css icons (#32004) 2026-02-09 18:37:41 +08:00
hooks Merge remote-tracking branch 'origin/main' into feat/support-agent-sandbox 2026-02-11 12:44:05 +08:00
i18n refactor(web): remove sandbox provider literals from i18n 2026-02-13 19:04:51 +08:00
i18n-config feat: support nl-NL language (#32216) 2026-02-11 10:42:13 +08:00
models chore(web): pre-align HITL frontend from build/feat/hitl 2026-02-09 15:34:15 +08:00
public feat: Add Command and FileUpload workflow icons, fix SSH provider icon 2026-02-11 21:16:57 +08:00
scripts
service feat: add Creators Platform helper for DSL upload and OAuth redirect (Vibe Kanban) (#32232) 2026-02-11 21:10:48 +08:00
test test(web): add comprehensive unit and integration tests for plugins and tools modules (#32220) 2026-02-12 10:04:56 +08:00
themes style: update banner item styles and enhance dark/light theme variables (#32111) 2026-02-09 15:34:31 +08:00
types feat: add Creators Platform helper for DSL upload and OAuth redirect (Vibe Kanban) (#32232) 2026-02-11 21:10:48 +08:00
utils Merge remote-tracking branch 'origin/main' into feat/support-agent-sandbox 2026-02-11 12:44:05 +08:00
.dockerignore
.env.example chore: Add ENABLE_SOURCE_MAP env var with priority over legacy var 2026-02-06 17:37:16 +08:00
.gitignore
.npmrc
.nvmrc
AGENTS.md
CLAUDE.md
Dockerfile chore: Add ENABLE_SOURCE_MAP env var with priority over legacy var 2026-02-06 17:37:16 +08:00
README.md
env.ts Merge remote-tracking branch 'origin/main' into feat/support-agent-sandbox 2026-02-10 18:12:41 +08:00
eslint-suppressions.json Merge remote-tracking branch 'origin/main' into feat/support-agent-sandbox 2026-02-13 15:17:52 +08:00
eslint.config.mjs refactor: import component css in globals.css (#32180) 2026-02-10 15:36:40 +08:00
global.d.ts
knip.config.ts
next.config.ts Merge remote-tracking branch 'origin/main' into feat/support-agent-sandbox 2026-02-10 18:12:41 +08:00
package.json chore: update version to 1.14.0-rc1 2026-02-13 18:17:57 +08:00
pnpm-lock.yaml Merge remote-tracking branch 'origin/main' into feat/support-agent-sandbox 2026-02-13 15:17:52 +08:00
postcss.config.js
proxy.ts Merge remote-tracking branch 'origin/main' into feat/support-agent-sandbox 2026-02-10 18:12:41 +08:00
tailwind-common-config.ts refactor: import component css in globals.css (#32180) 2026-02-10 15:36:40 +08:00
tailwind-css-plugin.ts refactor: import component css in globals.css (#32180) 2026-02-10 15:36:40 +08:00
tailwind.config.js
tsconfig.json
tsslint.config.ts
typography.js
vite.config.ts
vitest.config.ts test: add unit and integration tests for share, develop, and goto-anything modules (#32246) 2026-02-12 10:05:43 +08:00
vitest.setup.ts

README.md

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=
# WebSocket server URL.
NEXT_PUBLIC_SOCKET_URL=ws://localhost:5001
# 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.

Then follow the Lint Documentation to lint the code.

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.