First off, thank you for considering contributing to GAIA.VN! 🎉 It's people like you that make GAIA.VN such a great tool for smart agriculture.
- Code of Conduct
- How Can I Contribute?
- Development Setup
- Pull Request Process
- Coding Standards
- Commit Message Guidelines
- Issue Guidelines
This project and everyone participating in it is governed by the GAIA.VN Code of Conduct. By participating, you are expected to uphold this code.
Before creating bug reports, please check the existing issues as you might find that you don't need to create one. When you are creating a bug report, please include as many details as possible:
- Use a clear and descriptive title
- Describe the exact steps to 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 screenshots and animated GIFs if possible
- Include your environment details (OS, Node.js version, Python version, etc.)
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 expected behavior
- Explain why this enhancement would be useful
- IoT Integration: New sensor support, data collection improvements
- AI/ML Models: Enhanced prediction algorithms, new crop recommendations
- Blockchain: Smart contract optimizations, new network support
- Frontend: UI/UX improvements, new dashboard features
- Backend: API optimizations, new endpoints
- Documentation: Code comments, README updates, tutorials
- Testing: Unit tests, integration tests, E2E tests
- Node.js >= 18.0.0
- Python >= 3.8
- PostgreSQL >= 13
- Git
# Fork the repository on GitHub
# Clone your fork locally
git clone https://github.com/YOUR-USERNAME/Pione_AIBlockchainIoT-WAGTeam.git
cd Pione_AIBlockchainIoT-WAGTeam
# Add upstream remote
git remote add upstream https://github.com/minhe51805/Pione_AIBlockchainIoT-WAGTeam.git# Create PostgreSQL database
createdb db_iot_sensor
# Import schema
psql -d db_iot_sensor < db.sql
# Run migrations
psql -d db_iot_sensor < migrations/008_add_users_table.sql
psql -d db_iot_sensor < migrations/009_add_pin_hash_column.sql
psql -d db_iot_sensor < migrations/010_fix_nullable_passkey.sql# Install root dependencies
pip install -r requirements.txt
npm install
# AI Service
cd ai/ai_service
pip install -r requirements.txt
cp config.env.example config.env
# Edit config.env with your settings
# DApp Backend
cd ../../Dapp/backend
npm install
cp .env.example .env
# Edit .env with your settings
# DApp Frontend
cd ../frontend
npm install
cp env.local.example .env.local
# Edit .env.local with your settings
# Blockchain
cd ../../blockchain
npm installCreate and configure these files with your local settings:
.env(root)ai/ai_service/config.envDapp/backend/.envDapp/frontend/.env.local
# Terminal 1: Flask API
python app_ingest.py
# Terminal 2: Blockchain Bridge
node server.js
# Terminal 3: AI Service
cd ai/ai_service
uvicorn main:app --reload --port 8000
# Terminal 4: Backend API
cd Dapp/backend
npm run dev
# Terminal 5: Frontend DApp
cd Dapp/frontend
npm run devgit checkout -b feature/your-feature-name
# or
git checkout -b fix/bug-description- Write clean, readable code
- Add comments for complex logic
- Include tests for new functionality
- Update documentation as needed
# Run Python tests
pytest tests/
# Run JavaScript tests
npm test
# Test manually with curl or Postman
curl -X POST http://localhost:5000/api/data \
-H "Content-Type: application/json" \
-d @test_data.jsonFollow our commit message guidelines
git add .
git commit -m "feat: add new sensor support for soil pH"git push origin feature/your-feature-nameThen create a Pull Request on GitHub with:
- Clear title and description
- Reference any related issues
- Include screenshots for UI changes
- List any breaking changes
- Address any feedback from reviewers
- Keep your branch up to date with main
- Ensure CI checks pass
# Update your branch
git fetch upstream
git rebase upstream/main- Follow PEP 8
- Use type hints where appropriate
- Maximum line length: 88 characters (Black formatter)
- Use docstrings for functions and classes
def process_sensor_data(temperature: float, humidity: float) -> dict:
"""
Process raw sensor data and return standardized format.
Args:
temperature: Soil temperature in Celsius
humidity: Soil moisture percentage
Returns:
Processed sensor data dictionary
"""
return {"temp": temperature, "humid": humidity}- Follow Airbnb JavaScript Style Guide
- Use ESLint and Prettier
- Prefer
constoverlet, avoidvar - Use meaningful variable names
interface SensorData {
temperature: number;
humidity: number;
timestamp: string;
}
const processSensorReading = async (data: SensorData): Promise<void> => {
// Implementation
};- Follow Solidity Style Guide
- Use explicit visibility modifiers
- Add comprehensive comments
- Use meaningful variable names
/**
* @dev Store sensor reading with validation
* @param _temperature Temperature in Celsius * 10
* @param _humidity Humidity percentage * 10
*/
function storeSensorReading(
uint256 _temperature,
uint256 _humidity
) external onlyAuthorized {
// Implementation
}We follow the Conventional Commits specification:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
- feat: New feature
- fix: Bug fix
- docs: Documentation changes
- style: Code style changes (formatting, etc.)
- refactor: Code refactoring
- perf: Performance improvements
- test: Adding or updating tests
- build: Build system changes
- ci: CI/CD changes
- chore: Other changes
feat(api): add endpoint for soil health analysis
fix(blockchain): resolve gas estimation issue
docs(readme): update installation instructions
test(ai): add unit tests for crop prediction model
Use the bug report template and include:
- Environment details (OS, versions)
- Steps to reproduce
- Expected vs actual behavior
- Screenshots/logs if applicable
- Possible solution (if known)
Use the feature request template and include:
- Clear description of the feature
- Use case and benefits
- Possible implementation approach
- Acceptance criteria
We use these labels to categorize issues:
bug: Something isn't workingenhancement: New feature or requestdocumentation: Improvements to docsgood first issue: Good for newcomershelp wanted: Extra attention is neededai/ml: Related to AI/ML componentsblockchain: Related to smart contractsfrontend: Related to UI/UXbackend: Related to server-side codeiot: Related to IoT integration
- 💬 Join our discussions on GitHub
- 📧 Email us at contact@gaia.vn
- 📖 Check the documentation
- 🐛 Browse existing issues
Contributors will be recognized in:
- README.md contributors section
- Release notes for significant contributions
- Annual contributor spotlight
Thank you for contributing to GAIA.VN! 🌱🚀