slug: /development

Development Guide

This guide will help you get started with the development of the project.

Frontend

Installation

  1. Ensure you have node and pnpm installed.

  2. After cloning the repository, run the following command. This will install all dependencies as well as build all local packages.

    cd ./ui
    pnpm install
    // This command will help you create the tools you need for good front-end code validation to ensure that the code style
    pnpm setup-lint
    
  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 setup-lint, which will help you initialize your husky and pre-commit files, which will automatically help you check your commits during the commit phase. Or just 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 installed.

  2. After cloning the repository, run the following command for build.

    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.

    go run cmd/answer/main.go run -C ./answer-data
    

Code conventions

We recommend that you follow uber's Golang Guidelines code style.