Thank you for your interest in contributing to SensorAPI! We welcome contributions from the community.
- Code of Conduct
- Getting Started
- How to Contribute
- Development Setup
- Testing
- Coding Standards
- Pull Request Process
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
- Fork the repository on GitHub
- Clone your fork locally
- Set up your development environment (see below)
- Create a branch for your changes
- Make your changes and test them
- Submit a pull request
Before creating bug reports, please check the existing issues to see if the problem has already been reported. When you are creating a bug report, please include as many details as possible:
- Use a clear and descriptive title
- Describe the exact steps which reproduce the problem
- 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 any relevant logs or error messages
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please include:
- Use a clear and descriptive title
- Provide a step-by-step description of the suggested enhancement
- Provide specific examples to demonstrate the steps
- Describe the current behavior and explain which behavior you expected to see instead
- Explain why this enhancement would be useful
Unsure where to begin contributing? You can start by looking through beginner and help-wanted issues:
- Beginner issues - issues which should only require a few lines of code, and a test or two
- Help wanted issues - issues which should be a bit more involved than beginner issues
- Python 3.9+
- Node.js 16+ (for frontend)
- PostgreSQL 12+
- Git
# Clone the repository
git clone https://github.com/yourusername/sensorapi.git
cd sensorapi
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Copy environment template
cp .env.example .env
# Edit .env with your database configuration
# Run database migrations
alembic upgrade head
# Start the development server
uvicorn main:app --reloadcd frontend
npm install
npm run dev- Create a PostgreSQL database
- Update your
.envfile with the database connection details - Run migrations:
alembic upgrade head
# Run all tests
python -m pytest
# Run with coverage
python -m pytest --cov=app --cov-report=html
# Run specific test file
python -m pytest tests/test_sensors.py
# Run integration tests
python run_tests.py- Write tests for any new functionality
- Ensure all existing tests pass
- Aim for good test coverage
- Use descriptive test names
- Follow the existing test patterns
- Follow PEP 8
- Use Black for code formatting:
black . - Use isort for import sorting:
isort . - Use type hints where appropriate
- Write docstrings for functions and classes
- Use clear, descriptive names for types and fields
- Include descriptions for types and fields
- Follow GraphQL best practices for schema design
- Follow TypeScript/React best practices
- Use ESLint and Prettier for code formatting
- Write component tests using React Testing Library
- Keep the README up to date
- Document new features and API changes
- Use clear, concise language
- Include code examples where helpful
-
Create a branch: Create a new branch from
mainfor your changesgit checkout -b feature/your-feature-name
-
Make changes: Implement your changes following the coding standards
-
Test your changes: Ensure all tests pass and add new tests if needed
-
Update documentation: Update relevant documentation
-
Commit your changes: Use clear commit messages
git commit -m "feat: add new sensor type validation" -
Push to your fork:
git push origin feature/your-feature-name
-
Submit a pull request: Create a pull request from your fork
- Use a clear title that describes the change
- Fill out the pull request template completely
- Link to any relevant issues
- Ensure all CI checks pass
- Keep changes focused and atomic
- Be responsive to feedback
- Maintainers will review your PR
- Address any requested changes
- Once approved, a maintainer will merge your PR
If you have questions, feel free to:
- Open an issue with the
questionlabel - Join our community discussions
- Reach out to maintainers
Thank you for contributing to SensorAPI! 🚀