kurokobo a86f1eca79 docs: add api docs for /v1/info (#11269) hai 4 meses
..
.husky 2721cb8dee feat: add format util unit and add pre-commit unit check (#8427) hai 7 meses
.storybook 5df1cb0566 feat: storybook (#9324) hai 6 meses
.vscode 4ae4895ebe feat: add frontend unit test framework (#6426) hai 9 meses
__mocks__ 57ec12eb6b feat: regenerate history switch navigation (#8749) hai 6 meses
app a86f1eca79 docs: add api docs for /v1/info (#11269) hai 4 meses
assets bf3ee660e0 fix: missing files (#2291) hai 1 ano
bin fec607db81 Feat/embedding (#553) hai 1 ano
config 0540995e5c fix: prompt-editor regex.lastIndex needed to reset (#9097) hai 6 meses
context 08ac36812b feat: support LLM process document file (#10966) hai 5 meses
docker f4ce08211d feat: support csp (#9111) hai 6 meses
hooks 302f4407f6 refactor the logic of refreshing access_token (#10068) hai 5 meses
i18n 1d8385f7ac Sync INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH between API and Web (#11230) hai 4 meses
models 1d8385f7ac Sync INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH between API and Web (#11230) hai 4 meses
public f42ef0624d fix: embedded chat on ios (#8718) hai 7 meses
service 5172f0bf39 feat: Check and compare the DSL version before import an app (#10969) hai 5 meses
themes e9c098d024 Fix regenerate themes (#11101) hai 4 meses
types 1f87676d52 Supports display license status (#10408) hai 5 meses
utils f1366e8e19 fix #11091 raise redirect issue (#11092) hai 4 meses
.dockerignore 220f7c81e9 build: fix .dockerignore file (#800) hai 1 ano
.editorconfig db896255d6 Initial commit hai 1 ano
.env.example f4ce08211d feat: support csp (#9111) hai 6 meses
.eslintignore 091beffae7 feat: add code style (#242) hai 1 ano
.eslintrc.json 5df1cb0566 feat: storybook (#9324) hai 6 meses
.gitignore 79d59c004b chore: update .gitignore to include mise.toml (#10778) hai 5 meses
Dockerfile 44f57ad9a8 chore: Bump Alpine Linux to 3.20 in web dockerfile (#10671) hai 5 meses
README.md 5df1cb0566 feat: storybook (#9324) hai 6 meses
global.d.ts 7bbe12b2bd feat: support assistant frontend (#2139) hai 1 ano
jest.config.ts 57ec12eb6b feat: regenerate history switch navigation (#8749) hai 6 meses
middleware.ts 1206b1eb96 fix: add new domain to whitelist (#9265) hai 6 meses
next.config.js 6ef401a9f0 feat:add tts-streaming config and future (#5492) hai 9 meses
package.json 18d3ffc194 Feat: new pagination (#11170) hai 4 meses
postcss.config.js db896255d6 Initial commit hai 1 ano
tailwind.config.js 7a1d6fe509 Feat/attachments (#9526) hai 6 meses
tsconfig.json db896255d6 Initial commit hai 1 ano
typography.js db896255d6 Initial commit hai 1 ano
yarn.lock 668c1c0792 chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /web (#11262) hai 4 meses

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 NPM version 8.x.x or Yarn.

First, install the dependencies:

npm install
# or
yarn install --frozen-lockfile

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:

npm run dev
# or
yarn 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:

npm run build

Then, start the server:

npm run start

If you want to customize the host and port:

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

Storybook

This project uses Storybook for UI component development.

To start the storybook server, run:

yarn 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:

npm 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.