Thank you for your interest in contributing to Same-Same! 🎉 We welcome contributions from developers of all experience levels.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/same-same.git cd same-same - Set up your development environment:
make dev-setup cp .env.example .env # Edit .env with your API keys - Run tests to ensure everything works:
make test
# Install dependencies
go mod download
# Run locally
make run
# Run with Docker
make docker-run-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes following our coding standards
-
Add tests for new functionality
-
Run the test suite:
make test make test-coverage make lint -
Commit your changes with a clear commit message:
git commit -m "feat: add support for custom embedders"
We follow Conventional Commits:
feat:New featuresfix:Bug fixesdocs:Documentation changestest:Adding testsrefactor:Code refactoringperf:Performance improvementschore:Maintenance tasks
Found a bug? Please open an issue with:
- Clear description of the problem
- Steps to reproduce the issue
- Expected vs actual behavior
- Environment details (OS, Go version, etc.)
- Error messages or logs
Have an idea? We'd love to hear it! Please open an issue with:
- Problem description - What problem does this solve?
- Proposed solution - How should it work?
- Alternatives considered - What other approaches did you think about?
- Use case examples - When would this be used?
- Fix typos or unclear explanations
- Add examples for common use cases
- Improve API documentation
- Create tutorials or guides
- New Embedders: Add support for other embedding providers
- Storage Backends: Implement persistent storage options
- Performance: Optimize vector search algorithms
- Monitoring: Add metrics and observability
- Security: Improve authentication and authorization
- Testing: Increase test coverage
- Embedder Interface: All embedders must implement
embedders.Embedder - Storage Interface: Follow the storage contract in
internal/storage/ - Handler Pattern: HTTP handlers should be thin and delegate to services
- Error Handling: Use structured errors with appropriate HTTP status codes
- Logging: Use structured logging with appropriate levels
- Follow Effective Go
- Use
gofmtfor formatting - Run
golangci-lintfor linting - Add godoc comments for public functions
- Unit tests for all business logic
- Integration tests for API endpoints
- Table-driven tests for multiple test cases
- Mocks for external dependencies
- Target 80%+ code coverage
func TestVectorHandler_CreateVector(t *testing.T) {
tests := []struct {
name string
input models.Vector
expectedStatus int
expectedError string
}{
{
name: "valid vector",
input: models.Vector{
ID: "test1",
Embedding: []float64{0.1, 0.2, 0.3},
},
expectedStatus: http.StatusCreated,
},
// ... more test cases
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// Test implementation
})
}
}-
Create embedder directory:
internal/embedders/quotes/your_provider/ -
Implement the interface:
type YourEmbedder struct { apiKey string // ... other fields } func (e *YourEmbedder) Embed(text string) ([]float64, error) { // Implementation }
-
Add configuration in
internal/server/server.go -
Write tests with mocked HTTP responses
-
Update documentation with setup instructions
# Run all tests
make test
# Run with coverage
make test-coverage
# Test specific package
go test ./internal/handlers -v
# Integration tests
make api-test# Build and test in Docker
make docker-build
make docker-run
make health-check- Update OpenAPI specs in
docs/api.yaml - Include request/response examples
- Document error codes and messages
- Add godoc comments for public APIs
- Include usage examples in comments
- Document complex algorithms or business logic
- Submit PR with clear title and description
- Automated checks must pass (tests, linting, etc.)
- Code review by maintainers
- Address feedback if requested
- Merge once approved
- Tests pass locally
- New tests added for new functionality
- Documentation updated
- Commit messages follow convention
- No breaking changes (or clearly documented)
- Performance impact considered
Contributors will be:
- Listed in
CONTRIBUTORS.md - Mentioned in release notes
- Thanked in project documentation
- General questions: Open a discussion
- Bug reports: Open an issue
- Security issues: Email [email protected]
We follow the Contributor Covenant to ensure a welcoming environment for all contributors.
Happy Contributing!
Your contributions help make Same-Same better for everyone. Thank you for being part of our community!