This is an automated email from the ASF dual-hosted git repository. fenbox pushed a commit to branch build-community in repository https://gitbox.apache.org/repos/asf/incubator-answer-website.git
commit 2012fd37a91cd79d4ba7f3f153b42a68f4c4f7b2 Author: fen <[email protected]> AuthorDate: Mon Nov 27 17:04:58 2023 +0800 docs: remove unused files --- community/contributing/backend.md | 174 --------------------------------- community/contributing/contributing.md | 9 -- community/contributing/frontend.md | 120 ----------------------- docs/guides/reputation.md | 6 +- 4 files changed, 3 insertions(+), 306 deletions(-) diff --git a/community/contributing/backend.md b/community/contributing/backend.md deleted file mode 100644 index e7141993..00000000 --- a/community/contributing/backend.md +++ /dev/null @@ -1,174 +0,0 @@ ---- -slug: /development/backend ---- - -# Backend Development -> Below is the guideline for Backend Development - -## How to set up a development environment -### Prerequisites -- [Golang](https://go.dev/) `>=1.18` -- Database Dependencies - - MySQL `(>=5.7)` - - PostgreSQL `(>=10)` - - SQLite3 -- [wire](https://github.com/google/wire) - -### Tools -#### wire -We use `wire` to generate dependencies. - -```shell -$ go get github.com/google/wire/cmd/wire@latest -$ go generate ./... -$ go mod tidy -``` - -Or you can use `make generate`. -#### swag -We use `swag` to generate swagger doc. - -```shell -$ swag init --generalInfo ./cmd/answer/main.go -``` - -Or you can use enter the script directory and use `./gen-api.sh` - -### Build -:::note -If this is your first time starting the Answer, it is best to compile the frontend project once to ensure that you can test it more easily. -Once you get comfortable with the answer, you can copy the configuration file directly to the corresponding directory without compiling the front-end and test it with swagger. -::: - -```shell -# Frontend compilation(Recommend). If you encounter problems, please refer to the frontend related documentation -$ make ui -# enter into dir -$ cd cmd/answer/ -# compile -$ go build . -``` - -### Run -#### Install -> If this is your first time starting the Answer, you need to follow the steps to install. If not, you can skip this step. - -```shell -# init environment -$ ./answer init -C ./answer-data/ -``` - -Heading to [http://localhost:80/install](http://localhost:80/install) to access installation page. - -Please refer to the [installation documentation](/docs/installation) for installation steps. - -#### Launch -```shell -$ ./answer run -C ./answer-data/ -``` - -Heading to [http://localhost:80/](http://localhost:80/) to use answer. - -### Debug -We use swagger to test api interface. Swagger documentation default is available. -Heading to [http://localhost:80/swagger/index.html](http://127.0.0.1:8080/swagger/index.html) to access swagger page. - -You can use swagger for more convenient debugging. - -## Project instructions -### Package -``` -. -├── cmd (main binary) -├── configs (default configuration) -├── docs (swagger documentation) -├── i18n (International translation) -├── internal - ├── 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) -``` - -### Dependencies between packages -For most api, the flow chart is very simple as follows. -``` -router -> middleware -> controller(use schema) -> service -> repo(use entity) -``` - -If you want to develop a new API, you can follow the steps below. -1. Adding a routing rule (GET/POST/PUT...) in router. -2. Adding a controller for handler requests. the request should be validated in the controller. -3. Adding a service to process business. -4. Adding a repo for saving or querying data from the database or cache. -5. Regenerate swagger documentation and test API. - -## Code specification -### Basic -We recommend that you follow [uber's Golang Guidelines](https://github.com/uber-go/guide) code style. - -### Lint -`golangci-lint` is a fast Go linters runner. We use [golangci-lint](https://github.com/golangci/golangci-lint) to lint our code. - -You can use the following command to check your code format. -```bash -$ go install github.com/golangci/golangci-lint/cmd/[email protected] -$ golangci-lint run -``` - -## What do we need you to contribute -### Fix Bug -If you find a bug, please don't hesitate to [submit an issue](https://github.com/apache/incubator-answer/issues) to us. -If you can fix it, please include a note with your issue submission. -If it is a bug definitely, you can submit your PR after we confirm it, which will ensure you don't do anything useless. - -### Code Review & Comment -In our development, some codes are not logical we know. If you find it, please don't hesitate to submit PR to us. -In the same way, some function has no comment. We would appreciate it if you could help us supplement it. - -### Unit Tests(Much-needed) -Our current unit test coverage is as follows. As you can see we have many more unit tests to add, so we would be happy for you to add them. - -<img -src={require('/img/repo-unit-test-coverage-rate.png').default} -alt="repo-unit-test-coverage-rate" -width="300" -/> - -## Notice -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. -2. Modifying any field needs to take into account the impact on the existing data. -3. Changes to database tables need to be tested for impact on different types of databases, and different SQL statements need to be given for different types of databases. For MySQL/PostgreSQL/sqlite3. - - -## Built with - -The Answer application's backend is built with the following components/libraries: - -- [pacman](https://github.com/segmentfault/pacman) - Yet Another Toolkit to Build Golang Application Quickly. -- [gin](https://github.com/gin-gonic/gin/) - Router. -- [validator](https://github.com/go-playground/validator/) - Validator. -- [xorm](https://xorm.io/) - ORM. -- [cobra](https://github.com/spf13/cobra) - CLI applications. -- [swag](https://github.com/swaggo/swag) - Swagger Documentation generate. diff --git a/community/contributing/contributing.md b/community/contributing/contributing.md index c990b091..5b922f5c 100644 --- a/community/contributing/contributing.md +++ b/community/contributing/contributing.md @@ -74,15 +74,6 @@ Anyone can contribute to Answer. In addition to contributing code, there are man - Got new ideas? All contributions are very welcome. - If you think you need help planning your contribution, please [reach us](/community/#others) and let us know you are looking for a bit of help. -<!-- There are many ways to contribute to Answer, and many of them do not involve writing any code. Here's a few ideas to get started: - -- Simply start using Answer. Go through the [Getting Started](/docs/installation) guide. Does everything work as expected? If not, we're always looking for improvements. Let us know by [opening an issue](/community/issues). -- Look through the [open issues](https://github.com/apache/incubator-answer/issues). Provide workarounds, ask for clarification, or suggest labels. Help [triage issues](#triaging-issues-and-pull-requests). -- If you find an issue you would like to fix, [open a pull request](/community/pull-request). Issues tagged as [Good first issue](https://github.com/apache/incubator-answer/labels/good%20first%20issue) are a good place to get started. -- Read through the [Answer docs](/docs). If you find anything that is confusing or can be improved, you can click "Edit this page" at the bottom of most docs, which takes you to the GitHub interface to make and propose changes. -- Take a look at the [features requested](https://github.com/apache/incubator-answer/labels/enhancement) by others in the community and consider opening a pull request if you see something you want to work on. --> - - ## Development process Answer uses [GitHub](https://github.com/apache/incubator-answer) as its source of truth. The core team will be working directly there. All changes will be public from the beginning. diff --git a/community/contributing/frontend.md b/community/contributing/frontend.md deleted file mode 100644 index 2f5b8537..00000000 --- a/community/contributing/frontend.md +++ /dev/null @@ -1,120 +0,0 @@ ---- -slug: /development/frontend ---- - -# Frontend Development - -## ⚙️ Prerequisites - -- [Node.js](https://nodejs.org/) `>=16.17` -- [pnpm](https://pnpm.io/) `>=7` - -pnpm is required by building the Answer project. To installing the pnpm tools with below commands: - -```bash -corepack enable -corepack prepare [email protected] --activate -``` - -With Node.js v16.17 or newer, you may install the latest version of pnpm by just specifying the tag: - -```bash -corepack prepare pnpm@latest --activate -``` - -## 🔨 Development - -clone the repo locally and run following command in your terminal: - -```shell -$ git clone [email protected]:apache/incubator-answer.git answer -$ cd answer/ui -$ pnpm install -$ pnpm start -``` - -now, your browser should already open automatically, and autoload `http://localhost:3000`. -you can also manually visit it. - -## 👷 Workflow - -when cloning repo, and run `pnpm install` to init dependencies. you can use project commands below: - -- `pnpm start` run Answer web locally. -- `pnpm build` build Answer for production -- `pnpm lint` lint and fix the code style - -## 🌍 I18n(Multi-language) -If you need to add or edit a language entry, just go to the `/i18n/en_US.yaml` file, -all front-end language entries are placed under the `ui` field. - -If you would like to help us with the i18n translation, please visit [Answer at Crowdin](https://crowdin.com/translate/answer) - -## 💡 Project instructions - -``` -. -├── cmd -├── configs -├── docs -├── i18n - ├── en_US.yaml (basic language file) - ├── i18n.yaml (language list) -├── 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) -``` - -## 🤝 Contributing - -#### Fix Bug -If you find a bug, please don't hesitate to [submit an issue](https://github.com/apache/incubator-answer/issues) to us. -If you can fix it, please include a note with your issue submission. -If it is a bug definitely, you can submit your PR after we confirm it, which will ensure you don't do anything useless. - -#### Code Review & Comment -In our development, some codes are not logical we know. If you find it, please don't hesitate to submit PR to us. -In the same way, some function has no comment. We would appreciate it if you could help us supplement it. - -#### 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. - -## 📱Environment Support - -| [<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/ [...] -|-------------|-------------|-------------|-------------| -| last 2 versions | last 2 versions | last 2 versions | last 2 versions | - -## ⭐ Built with -- [TypeScript](https://www.typescriptlang.org/) - Strongly typed JavaScript -- [React.js](https://reactjs.org/) - Our front end is a React.js app -- [React Router](https://reactrouter.com/en/main) - Router library -- [Bootstrap](https://getbootstrap.com/) - UI library. -- [React Bootstrap](https://react-bootstrap.github.io/) - UI Library(rebuilt for React) -- [axios](https://github.com/axios/axios) - Request library -- [SWR](https://swr.bootcss.com/) - Request library -- [react-i18next](https://react.i18next.com/) - International library -- [zustand](https://github.com/pmndrs/zustand) - State-management library - diff --git a/docs/guides/reputation.md b/docs/guides/reputation.md index 76c64303..34f3e133 100644 --- a/docs/guides/reputation.md +++ b/docs/guides/reputation.md @@ -21,9 +21,9 @@ Reputation used to automate the management of community ecology. ## Additional rules -- The initial reputation is 0, after activation the reputation becomes 1 +- The initial reputation is `0`, after activation the reputation becomes `1` - If there is an action that causes the user's reputation to be `< 1`, any subsequent actions that reduce the reputation will not reduce the user's reputation -- Maximum of 200 reputation per day +- Maximum of `200` reputation per day - If an action results in a user gaining `> 200` reputation for the day, any subsequent actions that increase reputation will not increase the user's reputation. -- The reputation gained from accepted answers is not limited by the 200 cap +- The reputation gained from accepted answers is not limited by the `200` cap - No reputation gained for accepting your own answer
