Setup | Coding Style | Commit Style | Stacks | Packages
Any forms of contribution are welcome. Include but not limited to:
- Submit an issue to report bugs or request features.
- Open a PR to fix bugs or implement features.
- Check whether issues are still valid in current version.
- 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.
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.
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.
You may need to start the Dev Env if you have exited it:
# at Host
docker compose up -d dev
Please ensure that you have started the Dev Env.
# at Host
docker compose exec dev bash
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.
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.
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.
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.