First of all, thank you for your interest on contributing to Socketless. Don't worry, I'll keep this explanation simple and straight-forward.
Everyone that participates inside this project is under the CODE_OF_CONDUCT.md. Any violation of this code will result in consequences. Report any violation to [email protected] directly.
Socketless is distributed under a dual licensing model (LICENSE.md). The licenses applicable to different parts of the project are as follows:
-
Apache License, Version 2.0: Most files are under this license. You won't need to worry about anything when contributing to parts of the repo under this license.
-
Server Side Public License (SSPL): Files and folders under the directories
/apps/connect
and/apps/master
are licensed under the Server Side Public License (SSPL). You must agree to the Contributor License Agreement (CLA) before contributing to these parts.
The project is a Turbo monorepo. It's divided into four parts:
-
Tooling: Contains the tools used to build and test the project. It's under tooling/.
-
Internal Packages: Contains the packages that are used internally by the project. It's under internal-packages/.
-
Apps: Contains the apps that are part of the project. It's under apps/.
-
Packages: Contains public packages that are available in the npm registry. It's under packages/.
For little changes you won't need this, but if you're planning to make a big change, you'll need to set up the project locally. Here's how you can do it:
-
Node.js (version specified on .nvmrc)
-
PNPM (version specified on package.json under
packageManager
) -
Docker Engine 1.23 or higher
-
Clone the repository:
git clone https://github.com/wosherco/socketless.git
-
Install the dependencies:
pnpm install
-
Start necessary services for development, such as postgres and dragonfly (redis):
docker compose -f docker-comopse.db.yaml up
-
Start the project:
pnpm dev
- Dashboard (localhost:3000)
- Landing (localhost:3001)
- Docs (localhost:3002)
- Connect (localhost:3100)
- Master (localhost:3101)
To run the tests, you can use the following command:
pnpm test
Note: Test coverage is low to non-existent. Don't worry about it for now.
To run the typecheck, you can use the following command:
pnpm typecheck
To run the linting, you can use the following command:
pnpm lint
Note: Linting is required for all contributions.
To run the formatting, you can use the following command:
pnpm format
Note: Formatting is required for all contributions.
Build with the following command:
pnpm build
# or for documentation
pnpm -F docs build:cf
Build with the following command:
docker compose build
When contributing to this repository, please first discuss the change you wish to make via issue or discussions. If it's a small change, you can open a pull request directly.
Automatic checks will be performed on your pull request. If any of the checks fail, you'll need to fix them before your pull request can be merged. The checks are:
-
Typecheck: Ensures that the code is type-safe.
-
Linting: Ensures that the code follows the project's style guide.
-
Formatting: Ensures that the code is formatted correctly.
-
Tests: Ensures that the code is working as expected.