Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

CONTRIBUTING.md 9.4KB

před 2 roky
před 2 roky
před 2 roky
před 2 roky
před 2 roky
před 2 roky
před 2 roky
před 2 roky
před 2 roky
před 2 roky
před 2 roky
před 2 roky
před 2 roky
před 2 roky
před 2 roky
před 2 roky
před 2 roky
před 2 roky
před 2 roky
před 2 roky
před 2 roky
před 2 roky
před 2 roky
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. So you're looking to contribute to Dify - that's awesome, we can't wait to see what you do. As a startup with limited headcount and funding, we have grand ambitions to design the most intuitive workflow for building and managing LLM applications. Any help from the community counts, truly.
  2. We need to be nimble and ship fast given where we are, but we also want to make sure that contributors like you get as smooth an experience at contributing as possible. We've assembled this contribution guide for that purpose, aiming at getting you familiarized with the codebase & how we work with contributors, so you could quickly jump to the fun part.
  3. This guide, like Dify itself, is a constant work in progress. We highly appreciate your understanding if at times it lags behind the actual project, and welcome any feedback for us to improve.
  4. In terms of licensing, please take a minute to read our short [License and Contributor Agreement](./license). The community also adheres to the [code of conduct](https://github.com/langgenius/.github/blob/main/CODE_OF_CONDUCT.md).
  5. ## Before you jump in
  6. [Find](https://github.com/langgenius/dify/issues?q=is:issue+is:closed) an existing issue, or [open](https://github.com/langgenius/dify/issues/new/choose) a new one. We categorize issues into 2 types:
  7. ### Feature requests:
  8. * If you're opening a new feature request, we'd like you to explain what the proposed feature achieves, and include as much context as possible.
  9. * If you want to pick one up from the existing issues, simply drop a comment below it saying so.
  10. A team member working in the related direction will be looped in. If all looks good, they will give the go-ahead for you to start coding. We ask that you hold off working on the feature until then, so none of your work goes to waste should we propose changes.
  11. Depending on whichever area the proposed feature falls under, you might talk to different team members. Here's rundown of the areas each our team members are working on at the moment:
  12. | Member | Scope |
  13. | ------------------------------------------------------------ | ---------------------------------------------------- |
  14. | [@yeuoly](https://github.com/Yeuoly) | Architecting Agents |
  15. | [@jyong](https://github.com/JohnJyong) | RAG pipeline design |
  16. | [@GarfieldDai](https://github.com/GarfieldDai) | Building workflow orchestrations |
  17. | [@iamjoel](https://github.com/iamjoel) & [@zxhlyh](https://github.com/zxhlyh) | Making our frontend a breeze to use |
  18. | [@guchenhe](https://github.com/guchenhe) & [@crazywoola](https://github.com/crazywoola) | Developer experience, points of contact for anything |
  19. | [@takatost](https://github.com/takatost) | Overall product direction and architecture |
  20. How we prioritize:
  21. | Feature Type | Priority |
  22. | ------------------------------------------------------------ | --------------- |
  23. | High-Priority Features as being labeled by a team member | High Priority |
  24. | Popular feature requests from our [community feedback board](https://feedback.dify.ai/) | Medium Priority |
  25. | Non-core features and minor enhancements | Low Priority |
  26. | Valuable but not immediate | Future-Feature |
  27. ### Anything else (e.g. bug report, performance optimization, typo correction):
  28. * Start coding right away.
  29. How we prioritize:
  30. | Issue Type | Priority |
  31. | ------------------------------------------------------------ | --------------- |
  32. | Bugs in core functions (cannot login, applications not working, security loopholes) | Critical |
  33. | Non-critical bugs, performance boosts | Medium Priority |
  34. | Minor fixes (typos, confusing but working UI) | Low Priority |
  35. ## Installing
  36. Here are the steps to set up Dify for development:
  37. ### 1. Fork this repository
  38. ### 2. Clone the repo
  39. Clone the forked repository from your terminal:
  40. ```
  41. git clone git@github.com:<github_username>/dify.git
  42. ```
  43. ### 3. Verify dependencies
  44. Dify requires the following dependencies to build, make sure they're installed on your system:
  45. - [Docker](https://www.docker.com/)
  46. - [Docker Compose](https://docs.docker.com/compose/install/)
  47. - [Node.js v18.x (LTS)](http://nodejs.org)
  48. - [npm](https://www.npmjs.com/) version 8.x.x or [Yarn](https://yarnpkg.com/)
  49. - [Python](https://www.python.org/) version 3.10.x
  50. ### 4. Installations
  51. Dify is composed of a backend and a frontend. Navigate to the backend directory by `cd api/`, then follow the [Backend README](api/README.md) to install it. In a separate terminal, navigate to the frontend directory by `cd web/`, then follow the [Frontend README](web/README.md) to install.
  52. Check the [installation FAQ](https://docs.dify.ai/getting-started/faq/install-faq) for a list of common issues and steps to troubleshoot.
  53. ### 5. Visit dify in your browser
  54. To validate your set up, head over to [http://localhost:3000](http://localhost:3000) (the default, or your self-configured URL and port) in your browser. You should now see Dify up and running.
  55. ## Developing
  56. If you are adding a model provider, [this guide](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/README.md) is for you.
  57. To help you quickly navigate where your contribution fits, a brief, annotated outline of Dify's backend & frontend is as follows:
  58. ### Backend
  59. Dify’s backend is written in Python using [Flask](https://flask.palletsprojects.com/en/3.0.x/). It uses [SQLAlchemy](https://www.sqlalchemy.org/) for ORM and [Celery](https://docs.celeryq.dev/en/stable/getting-started/introduction.html) for task queueing. Authorization logic goes via Flask-login.
  60. ```
  61. [api/]
  62. ├── constants // Constant settings used throughout code base.
  63. ├── controllers // API route definitions and request handling logic.
  64. ├── core // Core application orchestration, model integrations, and tools.
  65. ├── docker // Docker & containerization related configurations.
  66. ├── events // Event handling and processing
  67. ├── extensions // Extensions with 3rd party frameworks/platforms.
  68. ├── fields // field definitions for serialization/marshalling.
  69. ├── libs // Reusable libraries and helpers.
  70. ├── migrations // Scripts for database migration.
  71. ├── models // Database models & schema definitions.
  72. ├── services // Specifies business logic.
  73. ├── storage // Private key storage.
  74. ├── tasks // Handling of async tasks and background jobs.
  75. └── tests
  76. ```
  77. ### Frontend
  78. The website is bootstrapped on [Next.js](https://nextjs.org/) boilerplate in Typescript and uses [Tailwind CSS](https://tailwindcss.com/) for styling. [React-i18next](https://react.i18next.com/) is used for internationalization.
  79. ```
  80. [web/]
  81. ├── app // layouts, pages, and components
  82. │ ├── (commonLayout) // common layout used throughout the app
  83. │ ├── (shareLayout) // layouts specifically shared across token-specific sessions
  84. │ ├── activate // activate page
  85. │ ├── components // shared by pages and layouts
  86. │ ├── install // install page
  87. │ ├── signin // signin page
  88. │ └── styles // globally shared styles
  89. ├── assets // Static assets
  90. ├── bin // scripts ran at build step
  91. ├── config // adjustable settings and options
  92. ├── context // shared contexts used by different portions of the app
  93. ├── dictionaries // Language-specific translate files
  94. ├── docker // container configurations
  95. ├── hooks // Reusable hooks
  96. ├── i18n // Internationalization configuration
  97. ├── models // describes data models & shapes of API responses
  98. ├── public // meta assets like favicon
  99. ├── service // specifies shapes of API actions
  100. ├── test
  101. ├── types // descriptions of function params and return values
  102. └── utils // Shared utility functions
  103. ```
  104. ## Submitting your PR
  105. At last, time to open a pull request (PR) to our repo. For major features, we first merge them into the `deploy/dev` branch for testing, before they go into the `main` branch. If you run into issues like merge conflicts or don't know how to open a pull request, check out [GitHub's pull request tutorial](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests).
  106. And that's it! Once your PR is merged, you will be featured as a contributor in our [README](https://github.com/langgenius/dify/blob/main/README.md).
  107. ## Getting Help
  108. If you ever get stuck or got a burning question while contributing, simply shoot your queries our way via the related GitHub issue, or hop onto our [Discord](https://discord.gg/AhzKf7dNgk) for a quick chat.