Contributing
Thank you for contributing to Streaklet! This guide will help you get started.
Commit Message Format
This project uses Conventional Commits for automated releases.
Format
Types
| Type | Description | Version Bump |
|---|---|---|
feat |
New feature | Minor (1.0.0 → 1.1.0) |
fix |
Bug fix | Patch (1.0.0 → 1.0.1) |
feat! or BREAKING CHANGE: |
Breaking change | Major (1.0.0 → 2.0.0) |
docs |
Documentation only | None |
chore |
Maintenance tasks | None |
refactor |
Code restructuring | None |
test |
Test additions/changes | None |
ci |
CI/CD changes | None |
perf |
Performance improvement | Patch |
Examples
# Feature (minor bump)
feat: add dark mode toggle to settings
# Bug fix (patch bump)
fix: resolve timezone display issue in Fitbit page
# Breaking change (major bump)
feat!: redesign API authentication
BREAKING CHANGE: API now requires JWT tokens instead of API keys
# Documentation (no release)
docs: update installation instructions
# Maintenance (no release)
chore: update dependencies
Development Setup
Prerequisites
- Python 3.12+
- Docker and Docker Compose
- Git
Local Development
- Clone and setup:
git clone https://github.com/ptmetcalf/streaklet.git
cd streaklet
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
- Run locally:
# Start development server
./dev.sh run
# Or with uvicorn directly
uvicorn app.main:app --reload --host 0.0.0.0 --port 8080
- Run tests:
# All tests
./dev.sh test
# With coverage
./dev.sh test-cov
# Single test file
python -m pytest tests/test_profiles.py -v
- Lint code:
# Activate venv first
source .venv/bin/activate
# Check for errors
ruff check app/ tests/
# Auto-fix
ruff check app/ tests/ --fix
Docker Development
# Build and run
docker compose up --build
# Run tests in Docker
docker build -t streaklet:test .
docker run --rm --entrypoint "" --user appuser streaklet:test \
sh -c "PYTHONPATH=. python -m pytest tests/ -v"
Pull Request Process
- Create a feature branch:
- Make changes with conventional commits:
git add .
git commit -m "feat: add user export functionality"
git push origin feat/your-feature-name
- Open Pull Request:
- Target the
mainordevelopbranch - Use conventional commit format in PR title
- Describe changes clearly
-
Link related issues
-
CI must pass:
- Linting
- Unit tests
- Docker build
-
Integration tests
-
Review and merge:
- Maintainer reviews
- Merge when approved and CI passes
Release Process
Releases are automated via release-please:
- Merge PR to
mainwith conventional commits - release-please creates a Release PR automatically
- Maintainer reviews and merges Release PR
- GitHub Release created
- Docker images published
See Releases Documentation for details.
Code Style
- Follow PEP 8
- Use type hints
- Write docstrings for public functions
- Keep functions focused and small
- Write tests for new features
Testing Guidelines
- Write tests for all new features
- Maintain or improve code coverage
- Test edge cases
- Use pytest fixtures appropriately
Test Structure
def test_feature_description(test_db, sample_profiles):
"""Test that feature does X when Y happens."""
# Arrange
setup_data(test_db)
# Act
result = function_under_test()
# Assert
assert result == expected
Documentation
- Update docs/ for user-facing changes
- Update CLAUDE.md for architecture changes
- Add docstrings for code documentation
- Include examples where helpful
Security
- Run as non-root user (uid 1000)
- No hardcoded secrets
- Validate user input
- Use parameterized SQL queries
- Follow OWASP security practices
Questions?
- Open an issue for bugs or feature requests
- Discussion tab for questions
- Check existing issues first
Code of Conduct
Be respectful and constructive in all interactions.