dify/web
Joel 35132d6892
chore: reopen the education application flow (#40760)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-14 07:16:21 +00:00
..
__mocks__ chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +00:00
__tests__ chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +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 chore: reopen the education application flow (#40760) 2026-08-14 07:16:21 +00: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): remove deprecated deployments pages (#40593) 2026-08-12 08:49:51 +00:00
docker chore: add Docker configuration for the Turnstile site key (#40569) 2026-08-12 05:54:21 +00:00
docs docs(web): consolidate maintainer guidance (#40758) 2026-08-14 03:40:05 +00:00
features chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +00:00
hooks chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +00:00
i18n chore: reopen the education application flow (#40760) 2026-08-14 07:16:21 +00:00
i18n-config chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +00:00
models chore: improve current workspace summary (#40121) 2026-08-07 03:08:55 +00:00
next fix: add semantic document titles across pages (#40396) 2026-08-14 03:29:16 +00:00
plugins chore: migrate linting to vp lint with ESLint fallback (#38834) 2026-07-13 06:41:53 +00:00
public chore(web): remove obsolete PWA assets (#40082) 2026-08-06 07:41:01 +00:00
scripts chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +00:00
service chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +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 feat: app deployment v2 (#39829) 2026-08-12 01:55:36 +00:00
utils chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +00:00
.env.example docs(web): consolidate maintainer guidance (#40758) 2026-08-14 03:40:05 +00:00
.gitignore chore(web): remove obsolete PWA assets (#40082) 2026-08-06 07:41:01 +00:00
AGENTS.md docs(web): consolidate maintainer guidance (#40758) 2026-08-14 03:40:05 +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(chat): modernize speech-to-text pipeline (#38653) 2026-07-13 04:21:29 +00:00
instrumentation-client.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
next.config.ts refactor(web): move education verification to dedicated routes (#40493) 2026-08-11 09:56:11 +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 chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +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 docs(web): consolidate maintainer guidance (#40758) 2026-08-14 03:40:05 +00:00
tsconfig.json chore: migrate static checks to vp check (#38850) 2026-07-13 08:00:39 +00:00
tsslint.config.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
vite.config.ts chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +00:00
vitest.browser.config.ts refactor(web): migrate app icon commands (#40646) 2026-08-13 06:44:00 +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 web/docs/test.md 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 npx vp test instead of npx vitest.

Run test:

cd web
vp test run

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.