Contributing to EdgeBrain
March 30, 2026 · View on GitHub
Thanks for your interest in contributing! This guide will help you get started.
Getting Started
- Fork the repository
- Clone your fork locally
- Follow the Setup Guide to get the system running
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes
- Test thoroughly
- Open a Pull Request
Code Style
Python (Backend)
- Follow PEP 8
- Use type hints where practical
- Keep functions focused and small
- Add docstrings to public functions
- Use
loggingmodule, notprint()
JavaScript/React (Frontend)
- Use functional components with hooks
- Keep components small and focused
- Use descriptive variable names
- CSS: prefer single-file styles per component
Project Structure
backend/app/
├── api/ → REST endpoints, WebSocket handlers
├── core/ → Config, database, MQTT, events
├── ai/ → Decision engine, strategies, anomaly detection
├── agents/ → Multi-agent system
├── models/ → Database models
└── services/ → Business logic
Adding a New Decision Strategy
- Create a new file in
backend/app/ai/or add to existing - Implement the
DecisionStrategyinterface - Register it in
agents/multi_agent.py
from app.ai.rules import DecisionStrategy, Decision
class MyStrategy(DecisionStrategy):
@property
def name(self) -> str:
return "my_strategy"
def evaluate(self, device_id, device_type, value, history):
# Your logic here
return [] # list of Decision objects
Adding a New Device Type
- Add simulation logic in
device-simulator/simulator.py - Add rules in
backend/app/ai/rules.py(ThresholdStrategy) - Add anomaly detection thresholds in
backend/app/ai/anomaly.pyif needed
Adding a New API Endpoint
- Add route in
backend/app/api/routes.py - Keep it under
/api/v1/prefix - Use proper HTTP methods and status codes
Commit Messages
Use conventional commits format:
feat: add humidity sensor support
fix: resolve MQTT reconnection issue
docs: update architecture documentation
refactor: simplify decision engine pipeline
test: add unit tests for anomaly detector
Pull Request Process
- Keep PRs focused — one feature/fix per PR
- Include a clear description of what and why
- Test your changes before submitting
- Respond to review feedback promptly
Reporting Issues
Use the bug report or feature request templates.
Questions?
Open a discussion or ask in Issues.
Thank you for contributing to EdgeBrain! 🧠