Thank you for your interest in contributing to TimeTracker! This document provides guidelines and information for contributors.
- Code of Conduct
- How Can I Contribute?
- Development Setup
- Pull Request Process
- Coding Standards
- Testing
- Reporting Bugs
- Feature Requests
- Questions and Discussion
- Terminology
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
- Use the GitHub issue tracker
- Include a clear and descriptive title
- Describe the exact steps to reproduce the bug
- Provide specific examples to demonstrate the steps
- Describe the behavior you observed after following the steps
- Explain which behavior you expected to see instead and why
- Include details about your configuration and environment
- Use the GitHub issue tracker
- Provide a clear and descriptive title
- Describe the suggested enhancement in detail
- Explain why this enhancement would be useful
- List any similar features and applications
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Contributors who only want to fix wording can use the Translation improvement GitHub issue template, work in Crowdin (Drytrix TimeTracker), or follow CONTRIBUTING_TRANSLATIONS.md (spreadsheet option, maintainer workflow, crowdin.yml, Crowdin sync workflow). Developers adding new _('...') strings should run pybabel extract / update as described there.
- Python 3.11 or higher
- Docker and Docker Compose (for containerized development)
- Git
-
Clone the repository:
git clone https://github.com/drytrix/TimeTracker.git cd TimeTracker -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp env.example .env # Edit .env with your development settings -
Initialize the database:
flask db upgrade
-
Run the development server:
flask run
-
Build and start the containers:
docker-compose up --build
-
Access the application:
- Default (docker-compose.yml): https://localhost (self-signed cert; accept the browser warning).
- For http://localhost:8080 instead, use:
docker-compose -f docker-compose.example.yml up -dordocker-compose -f docker-compose.local-test.yml up -d(SQLite, no PostgreSQL).
- Fork and Clone: Fork the repository and clone your fork locally
- Create Branch: Create a feature branch from
main - Make Changes: Implement your changes following the coding standards
- Test: Ensure all tests pass and add new tests for new functionality
- Commit: Write clear, descriptive commit messages
- Push: Push your branch to your fork
- Submit PR: Create a pull request with a clear description
Use conventional commit format:
type(scope): description
[optional body]
[optional footer]
Types: feat, fix, docs, style, refactor, test, chore
Examples:
feat(timer): add automatic idle detectionfix(auth): resolve session timeout issuedocs(readme): update installation instructions
- Follow PEP 8 style guidelines
- Use type hints where appropriate
- Keep functions focused and single-purpose
- Write docstrings for all public functions and classes
- Maximum line length: 88 characters (use Black formatter)
- Use blueprints for route organization
- Keep route handlers thin, move business logic to models or services
- Use proper HTTP status codes
- Implement proper error handling
- New features for integrations (mobile, desktop, scripts, webhooks): implement under
/api/v1first, with scopes and updates to OpenAPI inapp/routes/api_docs.py. /api/*session JSON (app/routes/api.py): reserve for same-origin web UI needs (browser cookie auth). Reuse code fromapp/services/instead of duplicating v1 logic. If you add a session route that mirrors v1, document it and considerX-API-Deprecatedplus aLinksuccessor header (seeapp/utils/api_deprecation.pyanddocs/api/API_VERSIONING.md).- Global search (
GET /api/v1/searchandGET /api/search): shared implementation inapp/services/global_search_service.py(run_global_search). Change behavior there and keep REST_API.md in sync.
- Use SQLAlchemy ORM for database operations
- Write migrations for schema changes
- Use proper indexing for performance
- Follow naming conventions for tables and columns
- Use semantic HTML
- Follow accessibility guidelines
- Keep CSS organized and maintainable
- Use HTMX for dynamic interactions
# Run all tests
python -m pytest
# Run with coverage
python -m pytest --cov=app
# Run specific test file
python -m pytest tests/test_timer.py- Write tests for all new functionality
- Use descriptive test names
- Test both success and failure cases
- Mock external dependencies
- Use fixtures for common test data
tests/
βββ conftest.py # Shared fixtures
βββ test_models/ # Model tests
βββ test_routes/ # Route tests
βββ test_utils/ # Utility function tests
βββ integration/ # Integration tests
When reporting bugs, please include:
- Environment: OS, Python version, browser (if applicable)
- Steps to Reproduce: Clear, numbered steps
- Expected Behavior: What you expected to happen
- Actual Behavior: What actually happened
- Screenshots: If applicable
- Logs: Any error messages or logs
For feature requests:
- Explain the problem you're trying to solve
- Describe the proposed solution
- Provide use cases and examples
- Consider implementation complexity
- Discuss alternatives you've considered
- Use GitHub Discussions for general questions
- Use GitHub Issues for bugs and feature requests
- Be respectful and constructive
- Search existing issues before creating new ones
If you need help:
- Check the README.md for basic information
- Search existing issues and discussions
- Create a new issue or discussion
- Join our community channels (if available)
Use consistent terms in code, API, and user-facing copy: time entry / time entries, client, project, task, invoice. For full product and naming context, see the Product/UX Audit.
By contributing to TimeTracker, you agree that your contributions will be licensed under the same license as the project (GNU General Public License v3.0).
Contributors will be recognized in:
- The project's README.md
- Release notes
- Contributor statistics on GitHub
Thank you for contributing to TimeTracker! π