Contributing
We welcome contributions to Spotter! This guide will help you get started.
Development Setup
Prerequisites
- Go 1.24+
- Node.js & npm
- Make
- Git
Clone and Setup
git clone https://github.com/joestump/spotter.git
cd spotter
make deps
Running Locally
make dev
This starts:
- Go server with hot-reload (Air)
- Template watching (templ)
- CSS watching (Tailwind)
Code Style
Go
- Follow standard Go conventions
- Use
gofmtfor formatting - Run linters before committing:
make lint-go
Templates
- Use templ for all HTML templates
- Keep templates in
internal/views/ - Format with:
make lint-templ
CSS
- Use Tailwind utility classes
- Custom styles go in
static/css/input.css - DaisyUI for component patterns
Markdown
- Follow markdownlint rules
- Run linter:
make lint-md
Making Changes
1. Create a Branch
git checkout -b feature/your-feature-name
2. Make Your Changes
- Write clean, documented code
- Add tests for new functionality
- Update documentation if needed
3. Run Tests
make test
4. Run Linters
make lint
5. Commit
Follow conventional commit messages:
feat: add new feature
fix: resolve bug in playlist sync
docs: update API documentation
refactor: simplify enricher interface
6. Create Pull Request
- Push your branch
- Open a PR against
main - Fill out the PR template
- Wait for review
Project Structure
internal/
├── config/ # Configuration
├── handlers/ # HTTP handlers
├── providers/ # External service providers
├── enrichers/ # Metadata enrichers
├── services/ # Business logic
├── views/ # templ templates
└── middleware/ # HTTP middleware
Adding a Provider
- Create directory in
internal/providers/ - Implement the Provider interface
- Register in the provider registry
- Add configuration options
- Write tests
- Update documentation
Adding an Enricher
- Create directory in
internal/enrichers/ - Implement the Enricher interface
- Register in the enricher registry
- Add to default enricher order
- Write tests
- Update documentation
Database Changes
- Modify schema in
ent/schema/ - Generate ent code:
go generate ./ent
- Ent applies migrations automatically
Testing
Unit Tests
go test ./...
Integration Tests
go test -tags=integration ./...
Coverage
make test-coverage
Documentation
- Update relevant docs in
docs-site/docs/ - Run docs locally:
cd docs-site && npm start
Questions?
- Open a GitHub issue
- Start a discussion
- Check existing issues first