Thank you for your interest in contributing to the Predictive Crowd Intelligence platform! This document provides guidelines and information for contributors.
We welcome contributions in many forms:
- 🐛 Bug reports and fixes
- 🚀 New features and enhancements
- 📚 Documentation improvements
- 🧪 Test coverage improvements
- 🌍 Translations and localization
- 💡 Ideas and feature suggestions
- Backend: Python 3.9+ with FastAPI knowledge
- Frontend: Node.js 18+ with React/TypeScript experience
- Tools: Git, Docker (optional)
- APIs: Basic understanding of REST APIs and computer vision concepts
-
Clone the repository
git clone https://github.com/your-org/predictive-crowd-intelligence cd predictive-crowd-intelligence -
Backend Setup
cd backend python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate pip install -r requirements.txt uvicorn app.main:app --reload --port 8000
-
Frontend Setup
cd frontend npm install npm run dev -
Environment Variables
# Create .env file in backend directory GOOGLE_MAPS_API_KEY=your_key_here AMADEUS_API_KEY=your_key_here AMADEUS_API_SECRET=your_secret_here
When reporting bugs, please include:
- Clear description of the issue
- Steps to reproduce the problem
- Expected vs actual behavior
- Screenshots if applicable
- Environment details (OS, browser, versions)
- Error messages or console output
Use our bug report template:
## Bug Description
Brief description of the bug
## Steps to Reproduce
1. Go to '...'
2. Click on '...'
3. Scroll down to '...'
4. See error
## Expected Behavior
What you expected to happen
## Actual Behavior
What actually happened
## Environment
- OS: [e.g., Windows 11, macOS 12.0]
- Browser: [e.g., Chrome 91, Firefox 89]
- Version: [e.g., v1.2.3]For new features:
- Search existing issues to avoid duplicates
- Describe the problem you're trying to solve
- Explain your proposed solution
- Consider alternatives you've thought about
- Provide mockups/examples if helpful
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Follow coding standards (see below)
- Add tests for new functionality
- Update documentation as needed
- Test thoroughly on multiple platforms
- Clear title summarizing the change
- Detailed description of what and why
- Link related issues using keywords (fixes #123)
- Include screenshots for UI changes
- Request review from maintainers
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
## Testing
- [ ] Tests pass locally
- [ ] New tests added for new functionality
- [ ] Manual testing completed
## Screenshots
Include screenshots for UI changes
## Checklist
- [ ] Code follows project style guidelines
- [ ] Self-review completed
- [ ] Comments added for complex code
- [ ] Documentation updated
- [ ] No new warnings introduced# Use descriptive variable names
def get_mobile_congestion_data(location_id: str, radius_km: float) -> MobileCongestionData:
"""
Fetch mobile network congestion data for a specific location.
Args:
location_id: Unique identifier for the location
radius_km: Search radius in kilometers
Returns:
MobileCongestionData: Congestion analysis results
"""
pass
# Follow PEP 8 style guide
# Use type hints
# Add docstrings for all functions
# Keep functions focused and small// Use descriptive component names
interface MobileDataProps {
locationId: string;
onDataUpdate: (data: MobileCongestionData) => void;
}
const MobileAnalysisCard: React.FC<MobileDataProps> = ({ locationId, onDataUpdate }) => {
// Use meaningful variable names
const [congestionData, setCongestionData] = useState<MobileCongestionData | null>(null);
// Add JSDoc comments for complex functions
/**
* Fetches and processes mobile congestion data
*/
const fetchData = useCallback(async () => {
// Implementation
}, [locationId]);
return (
// Implementation
);
};- Clear, descriptive names for variables, functions, and classes
- Consistent formatting using provided linters
- Comprehensive comments for complex logic
- Error handling for all external API calls
- Input validation for all user inputs
- Security best practices (no hardcoded secrets, input sanitization)
# Run all tests
pytest
# Run with coverage
pytest --cov=app tests/
# Run specific test file
pytest tests/test_mobile_congestion.py# Run tests
npm test
# Run with coverage
npm run test:coverage
# Run E2E tests
npm run test:e2e- Unit tests for all new functions
- Integration tests for API endpoints
- Component tests for React components
- E2E tests for critical user journeys
- Minimum 80% code coverage for new features
- Docstrings for all Python functions
- JSDoc comments for TypeScript functions
- README updates for new features
- API documentation for new endpoints
- Architecture docs for significant changes
def analyze_satellite_imagery(
image_data: bytes,
location: Tuple[float, float],
confidence_threshold: float = 0.8
) -> CrowdAnalysisResult:
"""
Analyze satellite imagery for crowd density estimation.
Uses YOLO v8 and CrowdNet models to detect and count people
in satellite imagery with confidence scoring.
Args:
image_data: Raw satellite image bytes
location: (latitude, longitude) tuple for the image
confidence_threshold: Minimum confidence for detection (0.0-1.0)
Returns:
CrowdAnalysisResult: Analysis results with crowd density,
confidence score, and detection metadata
Raises:
ValueError: If image_data is invalid or location is out of bounds
APIError: If external services are unavailable
Examples:
>>> result = analyze_satellite_imagery(
... image_data=satellite_bytes,
... location=(48.8566, 2.3522), # Paris coordinates
... confidence_threshold=0.9
... )
>>> print(f"Crowd level: {result.crowd_level}")
"""app/
├── api/ # API endpoints
├── core/ # Configuration and security
├── models/ # Data models and schemas
├── services/ # Business logic
├── utils/ # Utility functions
└── tests/ # Test files
src/
├── components/ # Reusable UI components
├── services/ # API and external services
├── hooks/ # Custom React hooks
├── utils/ # Utility functions
├── types/ # TypeScript type definitions
└── tests/ # Test files
- Single Responsibility: Each function/class has one clear purpose
- Dependency Injection: Use FastAPI's dependency system
- Separation of Concerns: Keep UI, business logic, and data separate
- Error Boundaries: Handle errors gracefully at appropriate levels
We welcome translations! To add a new language:
- Create language file:
frontend/src/i18n/locales/{language}.json - Add translations: Copy from
en.jsonand translate values - Update i18n config: Add language to supported list
- Test thoroughly: Ensure UI handles text length variations
- Async operations for all I/O
- Caching for expensive computations
- Database indexing for query optimization
- Rate limiting for API endpoints
- Monitoring for performance metrics
- Lazy loading for components and routes
- Memoization for expensive calculations
- Virtual scrolling for large lists
- Image optimization for satellite imagery
- Bundle splitting for faster loading
- Input validation on all user inputs
- SQL injection prevention using parameterized queries
- XSS protection with proper escaping
- API rate limiting to prevent abuse
- Secure headers for all responses
- Environment variables for all secrets
- Regular dependency updates for security patches
- Be constructive and suggest improvements
- Focus on code quality, security, and maintainability
- Test the changes locally if possible
- Check documentation and test coverage
- Approve promptly once issues are resolved
- Respond to feedback promptly and professionally
- Make requested changes or explain why you disagree
- Keep discussions focused on the code
- Be patient during the review process
Contributors will be recognized in:
- CONTRIBUTORS.md file
- Release notes for significant contributions
- Project documentation for major features
- Community showcases for exceptional work
- GitHub Discussions: For questions and general discussion
- Issues: For bugs and feature requests
- Discord/Slack: Real-time chat (link in README)
- Email: maintainers@predictive-crowd-intelligence.org
New contributors can request mentoring for:
- First contributions: Getting started with the codebase
- Complex features: Architecture and design guidance
- Best practices: Code quality and testing approaches
By contributing to this project, you agree that:
- Your contributions will be licensed under the Apache 2.0 License
- You have the right to submit your contributions
- You understand this is an open-source project
- Your contributions may be used in derivative works
Check our project roadmap for:
- Planned features and their timelines
- Areas needing help and skill requirements
- Long-term vision and architecture evolution
- Community priorities and voting
This project adheres to a code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to maintainers@predictive-crowd-intelligence.org.
Thank you for contributing to Predictive Crowd Intelligence! Together, we're building the future of intelligent tourism technology. 🚀