Skip to content

Latest commit

 

History

History
112 lines (76 loc) · 3.93 KB

CONTRIBUTING.md

File metadata and controls

112 lines (76 loc) · 3.93 KB

Contributing

Setup | Coding Style | Commit Style | Stacks | Packages

Any forms of contribution are welcome. Include but not limited to:

  1. Submit an issue to report bugs or request features.
  2. Open a PR to fix bugs or implement features.
  3. Check whether issues are still valid in current version.
  4. Answer questions from our community on Discussions and Discord.

Currently, the following are the most important tasks:

If you need to any help from maintainers and the community, you can join our Discord server.

Setting Up the Environment

Please make sure you have installed Docker on your machine.

We will create a docker container as the development environment:

┌───────────────────────────────────┐
│                                   │
│  Your Machine (Host)              │
│                                   │
│    `docker compose exec dev bash` │
│       ↓                           │
│  ┌───┤ ├────────────────┐         │
│  │                      │         │
│  │  Container (Dev Env) │         │
│  │                      │         │
│  └──────────────────────┘         │
│                                   │
└───────────────────────────────────┘

In the Dev Env, all the tools you need are already installed, such as pnpm, prisma, tsx, unicourse, etc.

First Time Setup

Clone the repository:

# at Host
git clone https://github.com/UniCourse-TW/Backend.git
cd Backend

Run Setup Script:

# at Host
./scripts/fast-setup.sh

This should take a few minutes and only needs to be done once. After the script finishes, you will be inside the Dev Env.

Start the Development Environment

You may need to start the Dev Env if you have exited it:

# at Host
docker compose up -d dev

Enter the Development Environment

Please ensure that you have started the Dev Env.

# at Host
docker compose exec dev bash

Coding Style

We use a loose rule set, however, we encourage you to follow the similar style as the existing code. You can use pnpm lint to check if your code violates any rules.

We recommend you to use VSCode as your editor which supports ESLint well.

Commit Style

We recommend you to use Conventional Commits with Angular convention. If you do not follow this convention, we may squash your commits into one commit with a conventional commit message.

Stacks

The following are the tools we use:

  • TypeScript as the main dev programming language.
  • Prisma as the ORM and database management tool.
  • Koa as the web server framework.
  • Zod as the user input validator.
  • Pnpm as the package manager.

Our underlying database is PostgreSQL.

Packages

This is a monorepo, which means that we have multiple packages in the same repository.

Most of them are located in the packages directory, except for the main unicourse server which is located in the root directory.

You can find the README of each package in the README.md file in the package directory.