This is an automated email from the ASF dual-hosted git repository. linkinstar pushed a commit to branch build-community in repository https://gitbox.apache.org/repos/asf/incubator-answer-website.git
commit 54a2bff67615193f2d97050eb79c62281033f29e Author: LinkinStars <[email protected]> AuthorDate: Tue Nov 21 17:40:09 2023 +0800 docs(development): add backend development description --- community/contributing/backend.md | 11 ---------- community/contributing/development.md | 38 ++++++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/community/contributing/backend.md b/community/contributing/backend.md index fc10263d..e7141993 100644 --- a/community/contributing/backend.md +++ b/community/contributing/backend.md @@ -154,18 +154,7 @@ alt="repo-unit-test-coverage-rate" width="300" /> -### Translation -All our translations are placed in the i18n directory. - -1. If you find that the corresponding key in the language you are using does not have a translation, you can submit your translation. -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/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 -### Modify the database table structure is very hard Usually, we don't want to modify the field that already exists in the database table. If you need to change it, follow these rules. 1. Adding fields is better than modifying them. diff --git a/community/contributing/development.md b/community/contributing/development.md index ff0be18a..fc5c6a14 100644 --- a/community/contributing/development.md +++ b/community/contributing/development.md @@ -4,12 +4,6 @@ slug: /development # Development -## Backend - -### Installation - -### Code conventions - ## Frontend ### Installation @@ -18,15 +12,39 @@ slug: /development 2. After cloning the repository, run the following command. This will install all dependencies as well as build all local packages. ```shell - cd ./ui - pnpm install + $ cd ./ui + $ pnpm install ``` -1. To start a development server, run `pnpm start`. now, your browser should already open automatically, and autoload `http://localhost:3000`. you can also manually visit it. -2. To switch API, you can modify the `ui/.env.development` file and then re-run pnpm start. If you're just using it yourself, we recommend creating a `.env.development.local` file that defines the address of the api you're going to use. +3. To start a development server, run `pnpm start`. now, your browser should already open automatically, and autoload `http://localhost:3000`. you can also manually visit it. +4. To switch API, you can modify the `ui/.env.development` file and then re-run pnpm start. If you're just using it yourself, we recommend creating a `.env.development.local` file that defines the address of the api you're going to use. ### Code conventions - **Most important: Look around.** Match the style you see used in the rest of the project. This includes formatting, naming files, naming things in code, naming things in documentation, etc. - We do have Prettier (a formatter) and ESLint (a syntax linter) to catch most stylistic problems. If you are working locally, you can run `pnpm lint` and `pnpm prettier` to fix most code formatting. - **No runtime errors** Before submitting the code, please ensure that there will be no errors when running locally. This will greatly reduce the workload of review. + + +## Backend + +### Installation + +1. Ensure you have [golang](https://go.dev/doc/install) installed. +2. After cloning the repository, run the following command for build. + + ```shell + $ go mod download + $ go run cmd/answer/main.go init -C ./answer-data + ``` + +3. Visit `http://localhost/` to see the installation page and complete the installation. + +4. Run the following command to start the server. + ```shell + $ go run cmd/answer/main.go run -C ./answer-data + ``` + +### Code conventions + +We recommend that you follow [uber's Golang Guidelines](https://github.com/uber-go/guide) code style. \ No newline at end of file
