诗浓 0189a8b0f6 fix: agent node help link error in zh (#16194) před 1 měsícem
..
.husky 69fb0a4a28 chore: use POSIX shell syntax in pre-commit script (#16025) před 1 měsícem
.storybook 403e2d58b9 Introduce Plugins (#13836) před 2 měsíci
.vscode 403e2d58b9 Introduce Plugins (#13836) před 2 měsíci
__mocks__ 57ec12eb6b feat: regenerate history switch navigation (#8749) před 6 měsíci
app 0189a8b0f6 fix: agent node help link error in zh (#16194) před 1 měsícem
assets bf3ee660e0 fix: missing files (#2291) před 1 rokem
bin fec607db81 Feat/embedding (#553) před 1 rokem
config 1d5ea80a2b feat: env MAX_TOOLS_NUM (#15431) před 1 měsícem
context 20376ca951 feat: upgrade knowledge metadata (#16063) před 1 měsícem
docker 252d2c425b feat(docker): add PM2_INSTANCES variable and update entrypoint script… (#14083) před 2 měsíci
hooks 20376ca951 feat: upgrade knowledge metadata (#16063) před 1 měsícem
i18n 411e332f1b feat: dark mode for knowledge (#15236) před 1 měsícem
models cefec44070 feat: add app_mode field to app import and model definitions (#15729) před 1 měsícem
public 972421efe2 Fix: update embed.min.js (#14772) před 1 měsícem
service 20376ca951 feat: upgrade knowledge metadata (#16063) před 1 měsícem
themes 411e332f1b feat: dark mode for knowledge (#15236) před 1 měsícem
types 3ca1373274 feat: version tag (#14949) před 1 měsícem
utils cefec44070 feat: add app_mode field to app import and model definitions (#15729) před 1 měsícem
.dockerignore 220f7c81e9 build: fix .dockerignore file (#800) před 1 rokem
.editorconfig db896255d6 Initial commit před 1 rokem
.env.example 5e52d4d6b3 feat: add Maximum number of Parallelism branches to env (#15964) před 1 měsícem
.gitignore 403e2d58b9 Introduce Plugins (#13836) před 2 měsíci
Dockerfile 252d2c425b feat(docker): add PM2_INSTANCES variable and update entrypoint script… (#14083) před 2 měsíci
README.md 252d2c425b feat(docker): add PM2_INSTANCES variable and update entrypoint script… (#14083) před 2 měsíci
eslint.config.mjs 403e2d58b9 Introduce Plugins (#13836) před 2 měsíci
global.d.ts 7bbe12b2bd feat: support assistant frontend (#2139) před 1 rokem
jest.config.ts 57ec12eb6b feat: regenerate history switch navigation (#8749) před 6 měsíci
middleware.ts 1206b1eb96 fix: add new domain to whitelist (#9265) před 6 měsíci
next.config.js 6ef401a9f0 feat:add tts-streaming config and future (#5492) před 9 měsíci
package.json ac80c04bd3 chore: bump version to 1.1.0 (#16128) před 1 měsícem
pnpm-lock.yaml d88b2dd198 fix: eslint extension not working in vscode (#14725) před 1 měsícem
postcss.config.js db896255d6 Initial commit před 1 rokem
tailwind-common-config.ts 411e332f1b feat: dark mode for knowledge (#15236) před 1 měsícem
tailwind.config.js 403e2d58b9 Introduce Plugins (#13836) před 2 měsíci
tsconfig.json db896255d6 Initial commit před 1 rokem
typography.js db896255d6 Initial commit před 1 rokem

README.md

Dify Frontend

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

Getting Started

Run by source code

To start the web frontend service, you will need Node.js v18.x (LTS) and pnpm version 9.12.2.

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
# 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=

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 start to use Jest and React Testing Library for Unit Testing.

You can create a test file with a suffix of .spec beside the file that to be tested. For example, if you want to test a file named util.ts. The test file name should be util.spec.ts.

Run test:

pnpm run test

If you are not familiar with writing tests, here is some code to refer to:

Documentation

Visit https://docs.dify.ai/getting-started/readme 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.