We welcome contributions to this project! To get started, please follow the instructions below.
Before making changes, please discuss your proposed changes via GitHub Issues or on the Discord server.
If you're working on an issue, please stay active with development and keep the communication open.
Please follow these naming conventions when working with git for pull requests, branches, and commits:
PR: [#ISSUE ID] Title of the PR
Branch: [ISSUE ID]-title-of-the-pr (shorter)
Commit: [[ISSUE ID]] [ACTION]: what was done
PR: #2 Add Docker container for Postgres
Branch: 2-add-container-postgres
Commit: [2] feat: add docker container for postgres
You will need to install Docker on your local machine.
If you encounter issues starting the database on a Mac M1, you may need to update your Docker configuration file at ~/.docker/config.json. Your file should look something like this:
{
"auths": {},
"currentContext": "desktop-linux"
}If you're encountering WSL errors when launching Docker, follow the Windows WSL installation steps.
Start by forking the repository to your own GitHub account.
Clone the forked repository to your local machine:
git clone https://github.com/<YOUR_GITHUB_ACCOUNT_NAME>/code-racer.gitcd code-racerCreate a .env file in the packages/app directory.
Then, copy the variables from packages/app/.env.example into the newly created .env file.
npm iIf you're using Docker, start the database with the following command:
docker-compose upAlternatively, you can start the database separately:
npm run dev:dbStart the development server for the app:
npm run dev:appStart the WebSocket server:
npm run dev:wssNow, open your browser and visit http://localhost:3000 to see the application running.
If you're new to GitHub or open-source contributions, check out the following video for a beginner-friendly guide:
How to make a pull request on an open source project
Additionally, there's a more specific guide for contributing to this project:
How to contribute to open-source projects
- Fork the repository.
- Clone your forked repository.
- Checkout a new branch for the feature you're working on.
- Do your work and make changes.
- Commit your changes.
- Push your branch to your fork.
- On GitHub, go to your fork and create a Pull Request (PR) from your branch to the upstream
main.
Before you start working on a new branch, make sure to pull in the latest changes from the main repository:
git checkout main
git pull upstream mainBefore submitting your PR, make sure to:
- Check your code with the linter and TypeScript to ensure it builds correctly:
npm run pr:precheck- Optional: Run End-to-End (E2E) tests to ensure the application works as expected:
npm run e2e -w @code-racer/appIf you're working on Windows and need to set up the development environment, follow these steps:
-
Install Docker Desktop:
- Download and install Docker Desktop for Windows.
- Make sure Docker is running correctly.
-
Install WSL (Windows Subsystem for Linux):
- Follow the instructions to install WSL and ensure Ubuntu or any other Linux distribution is set up.
-
Configure Docker to Use WSL:
- Open Docker Desktop, go to Settings → Resources → WSL Integration, and ensure your desired WSL distribution is selected.
-
Install Node.js and NPM:
- Download and install the latest version of Node.js.
-
Proceed with Installation Steps:
- Follow the instructions mentioned in the Installation section to set up your project.
If you encounter any issues, feel free to reach out in the Discord server.
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a friendly experience for everyone, regardless of any experience to give everyone an opportunity to contribute in this project.
The primary responsibility of contributors is to provide high-quality code contributions to the project. This involves writing, reviewing, and submitting code changes that improve the project's functionality, fix bugs, or implement new features.
Contributors should actively participate in project discussions and communicate effectively with other contributors, maintainers, and users. This includes joining discord server solely created for this project.
Contributors can play a role in the long-term maintenance of the project by actively monitoring the project's issue tracker, addressing bug reports and feature requests, and collaborating with other contributors to ensure the project remains healthy and sustainable.
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.