Thanks for taking interest in contribution! We welcome anyone who wants to contribute.
If you have an idea for a bigger feature or a change then we are happy to discuss it before you start working on it.
It is usually a good idea to make sure it aligns with the project and is a good fit.
Open an issue or post in #dev-general on Discord.
This document is a guide to help you through the process of contributing to autobrr.
- Code: new features, bug fixes, improvements
- Report bugs
- Documentation: The docs repo can be found here: github.com/autobrr/autobrr.com
This guide helps you get started developing autobrr.
Make sure you have the following dependencies installed before setting up your developer environment:
- Git
- Go (see go.mod for minimum required version)
- Node.js (we usually use the latest Node LTS version - for further information see
@types/nodemajor version in package.json) - pnpm
- Fork and Clone: Fork the autobrr repository and clone it to start working on your changes.
- Branching: Create a new branch for your changes. Use a descriptive name for easy understanding.
- Checkout a new branch for your fix or feature
git checkout -b fix/filters-issue
- Checkout a new branch for your fix or feature
- Coding: Ensure your code is well-commented for clarity. With go use
go fmt - Commit Guidelines: We appreciate the use of Conventional Commit Guidelines when writing your commits.
- Examples:
fix(indexers): Mock improve parsing,feat(notifications): add NewService - There is no need for force pushing or rebasing. We squash commits on merge to keep the history clean and manageable.
- Examples:
- Pull Requests: Submit a pull request from your Fork with a clear description of your changes. Reference any related issues.
- Mark it as Draft if it's still in progress.
- Code Review: Be open to feedback during the code review process.
The backend is written in Go and the frontend is written in TypeScript using React.
You need to have the Go toolchain installed and Node.js with pnpm as the package manager.
Clone the project and change dir:
git clone github.com/YOURNAME/autobrr && cd autobrrFirst install the web dependencies:
cd web && pnpm installRun the project:
pnpm devThis should make the frontend available at http://localhost:3000. It's setup to communicate with the API at http://localhost:7474.
In order to build binaries of the full application you need to first build the frontend.
To build the frontend, run:
pnpm --dir web run buildInstall Go dependencies:
go mod tidyRun the project:
go run cmd/autobrr/main.goThis uses the default config.toml and runs the API on http://localhost:7474.
To build the backend, run:
make build/appThis will output a binary in ./bin/autobrr
You can also build the frontend and the backend at once with:
make buildYou can optionally build it with GoReleaser which makes it easy to build cross-platform binaries.
Install it with go install or check the docs for alternatives:
go install github.com/goreleaser/goreleaser/v2@latestThen to build binaries, run:
goreleaser build --snapshot --cleanThe test suite consists of only backend tests at this point. All tests run per commit with GitHub Actions.
We have a mix of unit and integration tests.
Run all non-integration tests:
go test -v ./...The integration tests runs against an in memory SQLite database and currently requires Docker for the Postgres tests.
If you have docker setup then run the test_postgres container with:
docker compose up -d test_postgresThen run all tests:
go test ./... -tags=integrationNote
If you have issues with tests not passing, it might be related to timezones. The test_postgres container runs in timezone UTC. If your host is not configured in timezone UTC, then the tests will fail. To configure an Ubuntu host, execute:
sudo timedatectl set-timezone Etc/UTCOr to change the timezone for just the test run, do:
TZ=UTC go test ./... -tags=integration
To build a Docker image, run:
make build/dockerThe image will be tagged as autobrr:dev
To build a cross platform Docker image (for instance if you're running on arm64 or Apple ARM):
make build/dockerxWe have a mock indexer you can run locally that features:
- Built in IRC server that can send announces
- Mock indexer for downloads
- RSS feed mock
- Webhook mock for External Filters
See the documentation here. Add the customDefinitions to the config.toml and then run it with:
go run test/mockindexer/main.go- Restart the backend API for it to load the new mock.yaml definition
- Then add it via Settings -> Indexers -> Add, and select Mock Indexer in the list
- Go to Settings -> IRC and toggle the IRC network
Mock Indexer - Add a new Filter or add the indexer to an existing filter
- Open a new tab and navigate to http://localhost:3999 and put the example announce in the input then hit enter