This is an automated email from the ASF dual-hosted git repository. fenbox pushed a commit to branch fix-roadmap in repository https://gitbox.apache.org/repos/asf/incubator-answer-website.git
commit 3347026ca14a357b56f723fcd27b9586081e6a26 Author: fen <[email protected]> AuthorDate: Fri Nov 10 15:35:19 2023 +0800 update roadmap link --- docs/development/contributing/backend.md | 2 +- docs/development/contributing/frontend.md | 2 +- docusaurus.config.js | 2 +- .../index.md | 2 +- .../index.md | 2 +- .../docusaurus-plugin-content-docs/current.json | 2 +- .../current/development/contributing/backend.md | 2 +- .../current/development/contributing/frontend.md | 239 ++++++++++++++------- sidebars.js | 2 +- 9 files changed, 172 insertions(+), 83 deletions(-) diff --git a/docs/development/contributing/backend.md b/docs/development/contributing/backend.md index 74870927..c986944c 100644 --- a/docs/development/contributing/backend.md +++ b/docs/development/contributing/backend.md @@ -160,7 +160,7 @@ All our translations are placed in the i18n directory. 2. If you want to submit a new language translation, please add your language to the `i18n.yaml` file. ### Features or Plugin -1. We developed the features for the plan based on the [roadmap](https://github.com/orgs/answerdev/projects/1). If you are suggestions for new functions, please confirm whether they have been planned. +1. We developed the features for the plan based on the [roadmap](https://github.com/orgs/apache/projects/301). If you are suggestions for new functions, please confirm whether they have been planned. 2. Plugins will be available in the future, so stay tuned. ## Notice diff --git a/docs/development/contributing/frontend.md b/docs/development/contributing/frontend.md index fea96a6f..b5f9761a 100644 --- a/docs/development/contributing/frontend.md +++ b/docs/development/contributing/frontend.md @@ -97,7 +97,7 @@ All our translations are placed in the i18n directory. 2. If you want to submit a new language translation, please add your language to the `i18n.yaml` file. #### Features or Plugin -1. We developed the features for the plan based on the [roadmap](https://github.com/orgs/answerdev/projects/1). If you are suggestions for new functions, please confirm whether they have been planned. +1. We developed the features for the plan based on the [roadmap](https://github.com/orgs/apache/projects/301). If you are suggestions for new functions, please confirm whether they have been planned. 2. Plugins will be available in the future, so stay tuned. ## 📱Environment Support diff --git a/docusaurus.config.js b/docusaurus.config.js index 259e2690..c343c510 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -96,7 +96,7 @@ const config = { }, { label: 'Roadmap', - to: 'https://github.com/orgs/answerdev/projects/1', + to: 'https://github.com/orgs/apache/projects/301', }, { label: 'Community', diff --git a/i18n/zh-CN/docusaurus-plugin-content-blog/2023-05-12-what-is-q-and-a-platform-and-how-to-use-it/index.md b/i18n/zh-CN/docusaurus-plugin-content-blog/2023-05-12-what-is-q-and-a-platform-and-how-to-use-it/index.md index 3556f3e1..694f7cbb 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-blog/2023-05-12-what-is-q-and-a-platform-and-how-to-use-it/index.md +++ b/i18n/zh-CN/docusaurus-plugin-content-blog/2023-05-12-what-is-q-and-a-platform-and-how-to-use-it/index.md @@ -100,7 +100,7 @@ No matter what your Q&A platform is about, it’s always great to collect valuab 💻 [GitHub Repo](https://github.com/apache/incubator-answer): Keep an eye on what we are up to lately on GitHub. 📄[Documents](https://answer.apache.org/docs/): Everything you need to build your Answer Community from zero to hero. 🐞 [Bug Report](https://github.com/apache/incubator-answer/issues): Hunt a bug? Simply report it for us to track efficiently. -🚩[Public Roadmap](https://github.com/orgs/answerdev/projects/1): Feel free to drop a comment here and be a part of our roadmap! +🚩[Public Roadmap](https://github.com/orgs/apache/projects/301): Feel free to drop a comment here and be a part of our roadmap! ## Conclusion diff --git a/i18n/zh-CN/docusaurus-plugin-content-blog/2023-09-27-celebrate-answer-first-anniversary-with-hacktoberfest-2023 copy/index.md b/i18n/zh-CN/docusaurus-plugin-content-blog/2023-09-27-celebrate-answer-first-anniversary-with-hacktoberfest-2023 copy/index.md index 7c8c2388..33f185d8 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-blog/2023-09-27-celebrate-answer-first-anniversary-with-hacktoberfest-2023 copy/index.md +++ b/i18n/zh-CN/docusaurus-plugin-content-blog/2023-09-27-celebrate-answer-first-anniversary-with-hacktoberfest-2023 copy/index.md @@ -43,7 +43,7 @@ Celebrate Answer’s first birthday with contributions, the more the better, no ### Vaunt Your Contribution -We are partnering with [Vaunt](https://github.com/VauntDev) during Hacktoberfest to reward contributions. Our team will have an initial review of the submitted issues, and tag it with **hacktoberfest-accepted** first. Then, we will have a closer look to see whether it shares the same goals or visions with our[roadmap](https://github.com/orgs/answerdev/projects/1). If it’s a yes, we will add **LGTM** tag to it, and congratulations you’ll get a digital badge from us! Here's a group photo o [...] +We are partnering with [Vaunt](https://github.com/VauntDev) during Hacktoberfest to reward contributions. Our team will have an initial review of the submitted issues, and tag it with **hacktoberfest-accepted** first. Then, we will have a closer look to see whether it shares the same goals or visions with our[roadmap](https://github.com/orgs/apache/projects/301). If it’s a yes, we will add **LGTM** tag to it, and congratulations you’ll get a digital badge from us! Here's a group photo of [...]  diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current.json b/i18n/zh-CN/docusaurus-plugin-content-docs/current.json index c96711cf..b35a0c40 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current.json +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current.json @@ -45,6 +45,6 @@ }, "sidebar.tutorialSidebar.link.Roadmap": { "message": "规划", - "description": "The label for link Roadmap in sidebar tutorialSidebar, linking to https://github.com/orgs/answerdev/projects/1" + "description": "The label for link Roadmap in sidebar tutorialSidebar, linking to https://github.com/orgs/apache/projects/301" } } diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/development/contributing/backend.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/development/contributing/backend.md index 4f6cb229..89db957f 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/development/contributing/backend.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/development/contributing/backend.md @@ -183,7 +183,7 @@ width="300" ### 新功能或插件 -1. 我们根据 [路线图](https://github.com/orgs/answerdev/projects/1) 开发计划开发功能。如果你有新功能的建议,请确认它们是否已经计划中。 +1. 我们根据 [路线图](https://github.com/orgs/apache/projects/301) 开发计划开发功能。如果你有新功能的建议,请确认它们是否已经计划中。 2. 插件将在未来发布,敬请期待。 ## 注意事项 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/development/contributing/frontend.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/development/contributing/frontend.md index 87e60e30..ffefe6bb 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/development/contributing/frontend.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/development/contributing/frontend.md @@ -1,119 +1,208 @@ --- --- -# 前端开发指南 +# 后端开发指南 +> +> 下面将说明如何配置环境来进行项目的后端开发工作 -## ⚙️ 先决条件 +## 如何设置开发环境 -- [Node.js](https://nodejs.org/) `>=16.17` -- [pnpm](https://pnpm.io/) `>=7` +### 先决条件 -在构建 Answer 项目时需要 pnpm。使用以下命令安装 pnpm 工具: +- [Golang](https://go.dev/) `>=1.18` +- 数据库依赖 + - MySQL `(>=5.7)` + - PostgreSQL `(>=10)` + - SQLite3 +- [wire](https://github.com/google/wire) -```bash -corepack enable -corepack prepare [email protected] --activate +### 工具 + +#### wire + +我们使用 `wire` 来生成依赖关系。 + +```shell +go get github.com/google/wire/cmd/wire@latest +go generate ./... +go mod tidy ``` -使用 Node.js v16.17 或更新版本,可以通过指定标签来安装最新版本的 pnpm: +或者你可以使用 `make generate`。 -```bash -corepack prepare pnpm@latest --activate +#### swag + +我们使用 `swag` 来生成 Swagger 文档。 + +```shell +swag init --generalInfo ./cmd/answer/main.go ``` -## 🔨 开发 +或者你可以进入 `script` 目录并使用 `./gen-api.sh`。 -在本地克隆仓库并在终端中运行以下命令: +### 构建 + +:::note +如果这是你第一次启动 Answer,请先编译前端项目,以确保你可以更轻松地测试它。 +一旦你熟悉了 Answer,也可以使用 Swagger 进行测试。 +::: ```shell -git clone [email protected]:answerdev/answer.git answer -cd answer/ui -pnpm install -pnpm start +# 前端编译(推荐)。如果遇到问题,请参考与前端相关的文档 +$ make ui +# 进入目录 +$ cd cmd/answer/ +# 编译 +$ go build . ``` -现在,你的浏览器应该自动打开并加载 `http://localhost:3000`。你也可以手动访问它。 +### 运行 -## 👷 工作流 +#### 安装 +> +> 如果这是你第一次启动 Answer,请按照以下步骤进行安装。如果不是,则可以跳过此步骤。 -克隆仓库并运行 pnpm install 初始化依赖项后,你可以使用以下项目命令: +```shell +# 初始化环境 +$ ./answer init -C ./answer-data/ +``` + +前往 <http://localhost:80/install> 访问安装页面。 + +请参考 [安装文档](../../installation) 进行安装步骤。 + +#### 启动 + +```shell +./answer run -C ./answer-data/ +``` + +前往 <http://localhost:80/> 使用 Answer。 -- `pnpm start` 在本地运行 Answer 网站。 -- `pnpm build` 为生产环境构建 Answer。 -- `pnpm lint` 检查和修复代码风格。 +### Debug -## 🌍 I18n(多语言) +我们使用 Swagger 测试 API 接口。Swagger 文档默认可用。前往 [http://localhost:80/swagger/index.html](http://127.0.0.1:8080/swagger/index.html) 访问 Swagger 页面。 -如果你需要添加或编辑语言条目,只需转到 `/i18n/en_US.yaml` 文件,所有前端语言条目都放在 `ui` 字段下。 +你可以使用 Swagger 进行更方便的调试。 -如果想帮助我们进行 i18n 翻译,请访问 [Answer at Crowdin](https://crowdin.com/translate/answer) 。 +## 项目说明 -## 💡 项目说明 +### 包结构 ``` . -├── cmd -├── configs -├── docs -├── i18n - ├── en_US.yaml (basic language file) - ├── i18n.yaml (language list) +├── cmd (main binary) +├── configs (default configuration) +├── docs (swagger documentation) +├── i18n (International translation) ├── internal -├── ... -└── ui (front-end project starts here) - ├── build (built results directory, usually without concern) - ├── public (html template for public) - ├── scripts (some scripting tools on front-end project) - ├── src (almost all front-end resources are here) - ├── assets (static resources) - ├── common (project information/data defined here) - ├── components (all components of the project) - ├── hooks (all hooks of the project) - ├── i18n (Initialize the front-end i18n) - ├── pages (all pages of the project) - ├── router (Project routing definition) - ├── services (all data api of the project) - ├── stores (all data stores of the project) - ├── utils (all utils of the project) - ├── plugins (UI Plugin Development & Debugging Directory) + ├── base (Basic component without service attributes) + ├── conf (Configuration) + ├── constant (constant) + ├── data (database/cache) + ├── handler (request/response handler) + ├── middleware (http middleware) + ├── pager (Pagination) + ├── reason (error reason key use to translator) + ├── server (http server) + ├── translator (translator for translate international) + └── validator (validator for validate request) + ├── cli (binary commands) + ├── controller (request handler controller for user) + ├── controller_backyard (request handler controller for admin) + ├── entity (all entity about database table) + ├── install (installation related) + ├── migrations (upgrade related) + ├── repo (database/cache operations) + ├── router (http router) + ├── schema (request/response schema) + └── service (business logic) +├── pkg (tools or third party) +└── ui (frontend) ``` -## 🤝 贡献 +### 包之间的依赖关系 -#### 修复 Bug +对于大多数 API,流程图非常简单,如下所示。 -如果你发现了一个 bug,请不要犹豫地 [提交 issue](https://github.com/apache/incubator-answer/issues)。如果你能修复它,请在提交 issue 时附上说明。如果它确实是一个 bug,你可以在我们确认后提交 PR,这将确保你不会做任何无用的工作。 +``` +router -> middleware -> controller(use schema) -> service -> repo(use entity) +``` -#### 代码审查 & 注释 +如果你想开发新的 API,可以按照以下步骤进行操作。 -在我们的开发中,有些代码不太合逻辑。如果你发现了它,请不要犹豫地向我们提交 PR。同样,一些函数没有注释。如果你能帮助我们补充它,我们将不胜感激。 +1. 在 router 中添加路由规则 (GET/POST/PUT...)。 +2. 添加用于处理程序请求的 controller。该请求应在 controller 中进行验证。 +3. 添加一个 service 来处理业务。 +4. 添加用于保存或查询数据库或缓存中的数据的 repo 操作。 +5. 重新生成 swagger 文档并测试 API。 -#### 翻译 +## 代码规范 -我们所有的翻译都放在 `i18n` 目录下。 +### 基本的 -1. 如果你发现你正在使用的语言中对应的键没有翻译,你可以提交你的翻译。 +我们使用 [uber 的 Golang](https://github.com/uber-go/guide) 来检查代码规范。 + +### 代码规范检查 + +`golangci-lint` 是一个快速的 Go 代码规范检查工具。我们使用 [golangci-lint](https://github.com/golangci/golangci-lint) 来检查代码规范。 + +你可以使用以下命令检查你的代码格式。 + +```bash +go install github.com/golangci/golangci-lint/cmd/[email protected] +golangci-lint run +``` + +## 我们需要你的贡献 + +### 修复 Bug + +如果你发现了 Bug,请不要犹豫 [提交 issue](https://github.com/apache/incubator-answer/issues) 给我们。如果你可以修复它,请在提交 issue 时附上说明。如果问题已被确认是 Bug,你可以提交 PR,这将确保你不会做无用的工作。 + +### 代码审查和注释 + +在我们的开发过程中,有些代码可能不是很合乎逻辑。如果你发现了这些问题,请不要犹豫,向我们提交 PR。同样,有些函数可能没有注释。如果你可以帮助我们补充注释,我们将不胜感激。 + +### 单元测试(非常需要) + +我们当前的单元测试覆盖率如下所示。显然,我们还需要添加更多的单元测试,因此我们非常欢迎你的贡献。 + +<img +src={require('/img/repo-unit-test-coverage-rate.png').default} +alt="repo-unit-test-coverage-rate" +width="300" +/> + +### 翻译 + +我们所有的翻译都放在 `i18n`目录中。 + +1. 如果你发现你正在使用的语言中对应的键没有翻译,请提交你的翻译。 2. 如果你想提交新的语言翻译,请将你的语言添加到 `i18n.yaml` 文件中。 -#### 功能或插件 +### 新功能或插件 + +1. 我们根据 [路线图](https://github.com/orgs/apache/projects/301) 开发计划开发功能。如果你有新功能的建议,请确认它们是否已经计划中。 +2. 插件将在未来发布,敬请期待。 + +## 注意事项 + +### 修改数据库表结构非常困难 -1. 我们根据 [roadmap](https://github.com/orgs/answerdev/projects/1) 制定计划开发功能。如果你有新功能的建议,请确认它们是否已经计划。 -2. 插件将来会推出,敬请期待。 +通常,我们不希望修改数据库表中已经存在的字段。如果需要更改,请遵循以下规则: -## 📱环境支持 +1. 添加字段比修改字段更好。 +2. 修改任何字段都需要考虑对现有数据的影响。 +3. 修改数据库表结构需要测试对不同类型的数据库的影响,并为不同类型的数据库提供不同的 `SQL` 语句。对于 `MySQL/PostgreSQL/sqlite3`。 -| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br />Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br />Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/ [...] -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- [...] -| 最近 2 个版本 | 最近 2 个版本 | 最近 2 个版本 [...] +## 构建工具 -## ⭐ 使用了以下工具 +Answer 应用的后端使用以下组件/库构建: -- [TypeScript](https://www.typescriptlang.org/) - 强类型 JavaScript。 -- [React.js](https://reactjs.org/) - 我们的前端是一个 React.js 应用程序。 -- [React Router](https://reactrouter.com/en/main) - 路由库。 -- [Bootstrap](https://getbootstrap.com/) - UI 库。 -- [React Bootstrap](https://react-bootstrap.github.io/) - UI 库(为 React 重新构建)。 -- [axios](https://github.com/axios/axios) - 请求库。 -- [SWR](https://swr.bootcss.com/) - 请求库。 -- [react-i18next](https://react.i18next.com/) - 国际化库。 -- [zustand](https://github.com/pmndrs/zustand) - 状态管理库。 +- [pacman](https://github.com/segmentfault/pacman) - 快速构建 Go 应用程序的工具包。 +- [gin](https://github.com/gin-gonic/gin/) - 路由器。 +- [validator](https://github.com/go-playground/validator/) - 验证。 +- [xorm](https://xorm.io/) - ORM. +- [cobra](https://github.com/spf13/cobra) - CLI 应用程序。 +- [swag](https://github.com/swaggo/swag) - 生成 Swagger 文档。 diff --git a/sidebars.js b/sidebars.js index de2b184c..ff8c1aa4 100644 --- a/sidebars.js +++ b/sidebars.js @@ -55,7 +55,7 @@ module.exports = { { type: 'link', label: 'Roadmap', - href: 'https://github.com/orgs/answerdev/projects/1', + href: 'https://github.com/orgs/apache/projects/301', }, ],
