dify/web
2026-08-28 19:26:51 +08:00
..
__mocks__ feat: add skill enable feature switch (#41246) 2026-08-25 08:42:15 +00:00
__tests__ refactor(web): simplify pricing components (#41416) 2026-08-28 01:37:01 +00:00
.storybook chore: migrate static checks to vp check (#38850) 2026-07-13 08:00:39 +00:00
.vscode chore: migrate formatting to vp fmt (#38705) 2026-07-12 14:59:00 +00:00
app Merge branch 'access_point' into deploy/dev 2026-08-28 17:19:34 +08:00
assets
bin style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
config chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +00:00
constants
context refactor(web): simplify pricing components (#41416) 2026-08-28 01:37:01 +00:00
docker chore: add Docker configuration for the Turnstile site key (#40569) 2026-08-12 05:54:21 +00:00
docs docs(dify-ui): establish documentation hierarchy (#41044) 2026-08-21 02:29:41 +00:00
features feat: hide skill_entry when use has no skill.view permission 2026-08-28 12:01:09 +08:00
hooks chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +00:00
i18n fix: protect workspace owners in resource access (#41423) 2026-08-28 03:03:40 +00:00
i18n-config feat: support agent skill (#39675) 2026-08-24 05:29:14 +00:00
models fix: protect workspace owners in resource access (#41423) 2026-08-28 03:03:40 +00:00
next fix: separate WebApp analytics from console page tracking (#41251) 2026-08-26 03:02:38 +00:00
plugins chore: inline custom ESLint rules (#41008) 2026-08-20 07:32:13 +00:00
public chore(web): remove obsolete PWA assets (#40082) 2026-08-06 07:41:01 +00:00
scripts fix(web): route Agent V2 documentation links correctly (#41353) 2026-08-27 06:20:03 +00:00
service fix: protect workspace owners in resource access (#41423) 2026-08-28 03:03:40 +00:00
test chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +00:00
themes style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
types fix(web): route Agent V2 documentation links correctly (#41353) 2026-08-27 06:20:03 +00:00
utils chore: update permission key name 2026-08-28 19:25:52 +08:00
.env.example revert(web): restore Agentation devtool (#41387) 2026-08-27 09:09:44 +00:00
.gitignore chore(web): remove obsolete PWA assets (#40082) 2026-08-06 07:41:01 +00:00
AGENTS.md docs(dify-ui): establish documentation hierarchy (#41044) 2026-08-21 02:29:41 +00:00
CLAUDE.md
dev-proxy.config.ts feat: add WebSocket support to dev proxy with cookie rewriting (#39370) 2026-07-22 01:14:27 +00:00
Dockerfile fix(web): skip lifecycle scripts in Docker install (#40763) 2026-08-14 05:12:14 +00:00
Dockerfile.dockerignore
env.ts feat: add trunstile (#40494) 2026-08-12 03:08:19 +00:00
global.d.ts refactor(web): remove legacy embedded API docs (#40929) 2026-08-18 09:53:55 +00:00
instrumentation-client.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
next.config.ts refactor(web): remove legacy embedded API docs (#40929) 2026-08-18 09:53:55 +00:00
oxlint.unused.config.json chore: migrate linting to vp lint with ESLint fallback (#38834) 2026-07-13 06:41:53 +00:00
package.json revert(web): restore Agentation devtool (#41387) 2026-08-27 09:09:44 +00:00
postcss.config.mjs chore(web): upgrade Next.js to 16.3 (#39962) 2026-08-04 04:46:44 +00:00
proxy.ts feat: add trunstile (#40494) 2026-08-12 03:08:19 +00:00
README.md refactor: consolidate frontend browser test infrastructure (#40997) 2026-08-20 06:13:30 +00:00
tsconfig.json chore(deps): upgrade pnpm workspace dependencies (#41138) 2026-08-24 07:07:47 +00:00
tsslint.config.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
vite.config.ts refactor: consolidate frontend browser test infrastructure (#40997) 2026-08-20 06:13:30 +00:00
vitest.browser.setup.ts chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +00:00
vitest.setup.ts chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +00:00

Dify Frontend

This is a Next.js application with vinext as the default local development server.

Getting Started

Run by source code

The required Node.js and pnpm versions are pinned by the repository root .nvmrc and packageManager field. Vite+ is also available for repository checks and tests; use its official documentation as the installation reference.

Run the following commands from the repository root.

First, install the dependencies:

pnpm install

Note

JavaScript dependencies are managed by the workspace files at the repository root: package.json, pnpm-lock.yaml, pnpm-workspace.yaml, and .nvmrc. Install dependencies and run the commands below from the repository root.

Then, configure the environment variables. Create web/.env.local and copy the contents from web/.env.example. Modify the values of these environment variables according to your requirements:

cp web/.env.example web/.env.local

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, start the default development stack from the repository root. This runs vinext and the local API proxy together:

pnpm dev

Use pnpm -C web dev only when you specifically need the Next.js development server without the default vinext process. Proxy environment variables are documented in web/.env.example; route ownership remains in web/dev-proxy.config.ts.

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

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

Deploy

Deploy on server

First, build the app for production:

pnpm -C web run build

Then, start the server:

pnpm -C web run start

If you build the Docker image manually, use the repository root as the build context:

docker build -f web/Dockerfile -t dify-web .

If you want to customize the host and port:

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

Storybook

This project uses Storybook for UI component development.

To start the storybook server, run:

pnpm -C web storybook

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

Lint Code

If your IDE is VSCode, rename .vscode/settings.example.json to .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.

📖 Frontend Testing Guide: See the Frontend Testing Guide for the canonical testing policy and workflow.

Important

As we are using Vite+, the vitest command is not available. Please make sure to run tests with vp commands. For example, use vp test instead of vitest.

Run test:

cd web
vp test run --project unit

The standard unit command runs in happy-dom. Browser Mode is reserved for behavior that depends on a real browser; see the Frontend Testing Guide for its admission criteria and commands. Always select a project explicitly: bare vp test runs every registered project, including Browser Mode.

If a test fails only in CI, inspect the failing job and reproduce it locally when possible. A rerun can help identify a flaky test, but it does not replace diagnosing or reporting the failure.

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.