Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

vor 2 Jahren
vor 2 Jahren
vor 2 Jahren
vor 2 Jahren
vor 2 Jahren
vor 2 Jahren
vor 2 Jahren
vor 2 Jahren
vor 2 Jahren
vor 2 Jahren
vor 2 Jahren
vor 2 Jahren
vor 2 Jahren
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # Dify Frontend
  2. This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
  3. ## Getting Started
  4. ### Run by source code
  5. To start the web frontend service, you will need [Node.js v18.x (LTS)](https://nodejs.org/en) and [NPM version 8.x.x](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com/).
  6. First, install the dependencies:
  7. ```bash
  8. npm install
  9. # or
  10. yarn
  11. ```
  12. 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:
  13. ```
  14. # For production release, change this to PRODUCTION
  15. NEXT_PUBLIC_DEPLOY_ENV=DEVELOPMENT
  16. # The deployment edition, SELF_HOSTED or CLOUD
  17. NEXT_PUBLIC_EDITION=SELF_HOSTED
  18. # The base URL of console application, refers to the Console base URL of WEB service if console domain is
  19. # different from api or web app domain.
  20. # example: http://cloud.dify.ai/console/api
  21. NEXT_PUBLIC_API_PREFIX=http://localhost:5001/console/api
  22. # The URL for Web APP, refers to the Web App base URL of WEB service if web app domain is different from
  23. # console or api domain.
  24. # example: http://udify.app/api
  25. NEXT_PUBLIC_PUBLIC_API_PREFIX=http://localhost:5001/api
  26. # SENTRY
  27. NEXT_PUBLIC_SENTRY_DSN=
  28. ```
  29. Finally, run the development server:
  30. ```bash
  31. npm run dev
  32. # or
  33. yarn dev
  34. ```
  35. Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
  36. You can start editing the file under folder `app`. The page auto-updates as you edit the file.
  37. ### Run by Docker
  38. First, Build the frontend image:
  39. ```bash
  40. docker build . -t dify-web
  41. ```
  42. Then, configure the environment variables.Use the same method mentioned in run by source code.
  43. Finally, run the frontend service:
  44. ```bash
  45. docker run -it -p 3000:3000 -e EDITION=SELF_HOSTED -e CONSOLE_URL=http://127.0.0.1:3000 -e APP_URL=http://127.0.0.1:3000 dify-web
  46. ```
  47. When the console api domain and web app api domain are different, you can set the CONSOLE_URL and APP_URL separately.
  48. Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
  49. ## Deploy
  50. ### Deploy on server
  51. First, build the app for production:
  52. ```bash
  53. npm run build
  54. ```
  55. Then, move the static files to standalone folder:
  56. ```bash
  57. mv .next/static .next/standalone/.next
  58. cp -r ./public .next/standalone/.next/
  59. ```
  60. Finally, start the app:
  61. ```bash
  62. node .next/standalone/server.js
  63. ```
  64. If your project needs alternative port or hostname for listening, you can define PORT and HOSTNAME environment variables, before running server.js. For example, `PORT=3000 HOSTNAME=localhost node .next/standalone/server.js`.
  65. ## Lint Code
  66. If your IDE is VSCode, rename `web/.vscode/settings.example.json` to `web/.vscode/settings.json` for lint code setting.
  67. ## Documentation
  68. Visit https://docs.dify.ai/getting-started/readme to view the full documentation.
  69. ## Community
  70. The Dify community can be found on [Discord community](https://discord.com/invite/FngNHpbcY7), where you can ask questions, voice ideas, and share your projects.