Gryt
About Gryt

Contributing

How to contribute to Gryt

Prerequisites

  • Node.js 22.13 or newer, and yarn. Not npm: packages/client and packages/server ship a yarn.lock, and npm install resolves a different tree and writes a competing lockfile.
  • Go 1.24 or newer for the SFU, 1.25 for the CLI
  • Docker, if you want to run anything in a container

Setup

git clone --recurse-submodules https://github.com/YOUR_USERNAME/gryt.git
cd gryt

Install dependencies and start everything with the dev script:

ops/start_dev.sh

The script installs dependencies for all packages and starts the client, server, and SFU in development mode.

Workflow

  1. Create a feature request or a bug report
  2. Fork the repo and create a branch
  3. Make changes and add tests
  4. Run lint and tests
  5. Submit a pull request

Before you open a pull request

Gryt is maintained by one person, so everything that merges gets read by one person, and these rules come from that.

  • Sign the CLA first. See License below.
  • Keep it under about 300 changed lines. Anything bigger needs an issue first, where we agree on the shape before any code. Lockfiles and generated files don't count toward the 300.
  • No new dependencies or vendored code without an issue. That covers npm packages, Go modules and code ported from other projects. Gryt builds what it reasonably can itself, so there are fewer outside projects that can break it, change their licence or go away. A new dependency needs a reason it can't be ours.
  • One change per pull request. A bug fix and a feature are two pull requests.
  • Drafts that sit for 14 days get closed. Reopen one whenever you pick it back up.

A pull request over the limit without an issue gets closed with a pointer back here. It says nothing about the code, only about how much one person can review properly.

Code style

TypeScript

  • Use strict mode
  • Follow ESLint and Prettier configs
  • Add JSDoc comments for public APIs
/**
 * Manages microphone input and audio processing.
 * @param shouldAccess - Whether to request microphone access
 */
const useMicrophone = (shouldAccess: boolean): MicrophoneState => {
  // ...
};

Go

  • Follow gofmt formatting
  • Add godoc comments for exported functions
  • Handle errors explicitly

Testing

# Server
cd packages/server && yarn test

# SFU
cd packages/sfu && go test ./...

# CLI
cd packages/cli && go test ./...

The client has no general test suite yet. What it has is yarn typecheck and yarn lint, and one targeted check, yarn test:updater-bridge. Run the first two before opening a pull request.

Blog and site content

The marketing site and blog live in packages/site — how it is built. Blog posts are MDX files in content/blog/, and Writing blog posts is the full guide.

Quick steps to add a blog post:

  1. Create packages/site/content/blog/my-post.mdx with frontmatter (title, author, date)
  2. Place images in packages/site/public/ and reference them as ![alt](/filename.png)
  3. Run npm run dev in packages/site to preview

AI-assisted contributions

You may use AI assistance anywhere in Gryt — but you have to say so. Tick the AI-assisted box in the pull request template if any part of your patch was AI-generated.

Some areas are audited more critically than others. The SFU, authentication and identity code, the client's key handling, the media worker and the data layer are read line by line before anything merges, whoever wrote them. Expect a slower review there, and questions about anything that changes behaviour. See the AI policy for the full list of paths and the reasoning.

Pull request checklist

  • Tests pass where they exist (yarn test in the server, go test ./... in the SFU and CLI)
  • Types check and the linter is clean (yarn typecheck, yarn lint, go fmt ./...)
  • Documentation is updated if needed
  • No breaking changes (or clearly marked)
  • AI-assisted code is disclosed (see the AI policy)

License

Gryt is licensed under the AGPL-3.0. Before your first pull request can merge, you sign the Contributor License Agreement. It lets the owner of Gryt use your contribution under any licence, including a different one later on. You keep your own copyright. To sign, comment I have read the CLA Document and I hereby sign the CLA on your pull request. A check on every pull request looks for it.

On this page