Contributions are always welcome, no matter how large or small. Before contributing, please read the code of conduct.
Clone the repo and install dependencies:
git clone https://github.com/netlify/gotrue
cd gotrue
make depsThis installs the soda database migration tool, golangci-lint, and downloads Go modules.
GoTrue uses MySQL 5.7 (matching production). The easiest way to run it locally is with Docker:
hack/mysqld.shThis starts a MySQL 5.7 container (gotrue_mysql) on port 3306 with root access and no password. Data is persisted in a Docker volume (mysql_data).
On Apple Silicon (M1/M2/M3), the script uses --platform linux/amd64 to run the x86 image under Rosetta emulation, since MySQL 5.7 has no native ARM64 image.
If you already have MySQL running locally, it needs to be accessible as user root without a password on 127.0.0.1:3306.
For development:
make migrate_devFor testing:
make migrate_testThese commands drop and recreate the database, then apply all migrations from the migrations/ directory.
make buildThis produces a gotrue binary in the project root.
Run the full test suite:
make testTests run sequentially (-p 1) to avoid database conflicts. All tests use the hack/test.env configuration, which points to the gotrue_test database with table names prefixed by test_.
make lint # Run golangci-lint
make vet # Run go vetOr run everything (lint, vet, test, build):
make allGoTrue is configured via environment variables prefixed with GOTRUE_, or a .env file. See the README for all available configuration options.
For local development, hack/test.env provides a working configuration with dummy OAuth credentials and a test JWT secret.
- Fork the repo and create your branch from
master. - If you've added code that should be tested, add tests.
- If you've changed APIs, update the documentation.
- Ensure the test suite passes.
- Make sure your code lints.
By contributing to GoTrue, you agree that your contributions will be licensed under its MIT license.