Contributors
We're thrilled that you're interested in contributing to OpenAlgo! This guide will help you get started, whether you're fixing a bug, adding a new broker, improving documentation, or building new features.
Below you'll find everything you need to set up OpenAlgo on your computer and start contributing.
Our Mission
OpenAlgo is built by traders, for traders. We believe in democratizing algorithmic trading by providing a broker-agnostic, open-source platform that puts control back in the hands of traders. Every contribution, no matter how small, helps us achieve this mission.
Table of Contents
Technology Stack
Development Setup
Local Development
Project Structure
Development Workflow
Contributing Guidelines
Testing
Adding a New Broker
UI Development
Documentation
Best Practices
Getting Help
Technology Stack
OpenAlgo is built using Python Flask for the backend and TailwindCSS + DaisyUI for the frontend.
Backend Technologies
Python 3.12+ - Core programming language (requires Python 3.10 or higher, 3.12+ recommended)
Flask 3.0+ - Lightweight web framework
Flask-RESTX - RESTful API with auto-generated Swagger documentation
SQLAlchemy 2.0+ - Database ORM for data persistence
Flask-SocketIO 5.3+ - Real-time WebSocket connections for live updates
Flask-Login - User session management and authentication
Flask-WTF - Form validation and CSRF protection
Frontend Technologies
Jinja2 - Server-side templating engine
TailwindCSS 4.1+ - Utility-first CSS framework
DaisyUI 5.1+ - Beautiful component library for Tailwind
PostCSS - CSS processing and compilation
Chart.js - Data visualization and charting
Trading & Data Libraries
pandas 2.2+ - Data manipulation and analysis
numpy 2.2+ - Numerical computing
httpx - Modern HTTP client with HTTP/2 support
websockets 15.0+ - WebSocket client and server
pyzmq 26.3+ - ZeroMQ for high-performance message queue
APScheduler - Background task scheduling
Security & Performance
argon2-cffi - Secure password hashing
cryptography - Token encryption
Flask-Limiter - Rate limiting
Flask-CORS - CORS protection
[!IMPORTANT] You will need Node.js v16+ and Python 3.12 or the latest Python version.
Development Setup
Prerequisites
Before you begin, make sure you have the following installed:
Python 3.10 or higher (3.12+ recommended) - Download Python
Node.js v16 or higher - Download Node.js
Git - Download Git
Code Editor - VS Code recommended with extensions:
Python
Pylance
Jupyter
Basic Knowledge of Flask and REST APIs
Install Dependencies
Configure Environment
Important Security Note: Generate secure random keys:
Local Development
Build Packages
OpenAlgo requires CSS compilation before running. You have two options:
Option 1: Manual Build
Option 2: Automated Development
Run the Application
Option 1: Flask Development Server
Option 2: Production with Gunicorn (Linux only)
Development Workflow with Multiple Terminals
For the best development experience, use two terminals:
Terminal 1 - CSS Watch Mode:
Terminal 2 - Flask Server:
First Time Setup
Access the application: Navigate to
http://127.0.0.1:5000Setup account: Go to
http://127.0.0.1:5000/setupCreate admin user: Fill in the setup form
Login: Use your credentials to access the dashboard
Configure broker: Navigate to Settings → Broker Setup
Project Structure
Understanding the codebase structure will help you contribute effectively:
Key Directories
broker/: Each subdirectory contains a complete broker integration with authentication, order APIs, data APIs, and symbol mappingrestx_api/: RESTful API endpoints with automatic Swagger documentation at/api/docsblueprints/: Web routes and views for the UItemplates/: HTML templates using Jinja2 and Tailwind/DaisyUI classeswebsocket_proxy/: Real-time market data streaming infrastructureservices/: Business logic separated from route handlersutils/: Shared utility functions used across the application
Development Workflow
1. Fork and Clone
2. Create a Feature Branch
3. Make Your Changes
Follow these guidelines while developing:
Code Style
Python: Follow PEP 8 style guide
Formatting: Use 4 spaces for indentation
Line Length: Maximum 100 characters recommended
Imports: Group by standard library, third-party, local
Docstrings: Use Google-style docstrings
Example:
Commit Messages
We follow Conventional Commits specification:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesstyle:- Code style changes (formatting, no logic change)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
Examples:
4. Test Your Changes
Testing Checklist
5. CSS Compilation (for UI changes)
If you modified any HTML templates or Tailwind classes:
6. Push to Your Fork
7. Create a Pull Request
Go to your fork on GitHub
Click "Compare & pull request"
Fill out the PR template:
Title: Clear, descriptive title
Description: What does this PR do?
Related Issues: Link related issues (e.g., "Closes #123")
Screenshots: For UI changes, include before/after screenshots
Testing: Describe how you tested the changes
Checklist: Complete the PR checklist
Example PR Description:
Contributing Guidelines
What Can You Contribute?
For First-Time Contributors 🌱
Great ways to get started:
Documentation
Fix typos in README or docs
Improve installation instructions
Add examples and tutorials
Translate documentation to other languages
Bug Fixes
Fix minor bugs and edge cases
Improve error messages
UI Improvements
Enhance styling with Tailwind/DaisyUI
Improve mobile responsiveness
Add loading states and animations
Fix layout issues
Examples
Add strategy examples in
/strategiesCreate tutorial notebooks
Document common use cases
For Experienced Contributors 🚀
More advanced contributions:
New Broker Integration
Add support for new brokers
Complete implementation guide in next section
Requires understanding of broker APIs
API Endpoints
Implement new trading features
Enhance existing endpoints
Add new data sources
Performance Optimization
Optimize database queries
Improve caching strategies
Reduce API latency
Profile and optimize bottlenecks
WebSocket Features
Add new streaming capabilities
Improve real-time performance
Add broker adapters
Testing Infrastructure
Write unit tests
Add integration tests
Set up CI/CD pipelines
Create test fixtures
Security Enhancements
Audit security vulnerabilities
Improve authentication
Enhance encryption
Add security features
Testing
Manual Testing
OpenAlgo primarily uses manual testing currently:
Application Testing
API Testing
Use the built-in Swagger UI at
http://127.0.0.1:5000/api/docsTest API endpoints with Postman or curl
Verify request/response formats
Cross-Browser Testing
Test in Chrome, Firefox, Safari, Edge
Verify mobile responsiveness
Check for console errors
Error Handling
Test with invalid inputs
Verify proper error messages
Ensure graceful degradation
Automated Testing
Some test files are available in the /test directory:
Writing Tests
When adding tests, follow this structure:
Adding a New Broker
One of the most valuable contributions is adding support for new brokers. Here's a comprehensive guide:
1. Broker Integration Structure
Create a new directory under /broker/your_broker_name/:
2. Implement Required Modules
2.1 Authentication API (api/auth_api.py)
2.2 Order API (api/order_api.py)
2.3 Data API (api/data.py)
2.4 Plugin Configuration (plugin.json)
3. Testing Your Broker Integration
Add broker to
VALID_BROKERSin.envConfigure broker credentials
Test authentication flow
Test each API endpoint via Swagger UI
Test WebSocket streaming (if supported)
Validate error handling
4. Documentation
Create a setup guide in /docs/broker_brokername.md:
5. Reference Implementation
Study existing broker implementations as reference:
/broker/zerodha/- Most complete implementation/broker/dhan/- Modern API design/broker/angel/- WebSocket streaming
UI Development
Working with Tailwind & DaisyUI
CSS Workflow
NEVER edit
/static/css/main.cssdirectly (it's auto-generated!)Edit source files:
Custom CSS:
/src/css/styles.cssTailwind classes: Directly in HTML templates (
/templates/)
Compile CSS:
Before committing: Always run production build
Using DaisyUI Components
OpenAlgo uses DaisyUI component library:
Theme System
OpenAlgo uses three themes:
Light - Default theme
Dark - Dark mode
Garden - Analyzer/testing mode
Use theme-aware classes:
Responsive Design
Always use responsive Tailwind classes:
Tailwind Configuration
The Tailwind config is in tailwind.config.mjs:
Documentation
Good documentation is crucial for open-source projects.
Code Documentation
Python Docstrings - Use Google-style:
Inline Comments - Explain complex logic:
Type Hints - Use for better IDE support:
User Documentation
README Updates - For new features, update main README.md
API Documentation - Use Flask-RESTX decorators:
Feature Guides - Create detailed guides in
/docs:/docs/websocket_usage.md/docs/broker_integration_guide.md/docs/security_best_practices.md
Best Practices
Security
Never commit sensitive data
Validate all inputs
Use parameterized queries
Follow OWASP guidelines
Enable CSRF protection (already configured)
Use HTTPS in production
Implement rate limiting (already configured)
Sanitize user inputs
Performance
Optimize database queries
Use caching
Minimize API calls
Code Quality
Write self-documenting code
Keep functions small and focused
Handle errors gracefully
Troubleshooting
Common Issues
CSS Not Updating
Python Dependencies
WebSocket Connection Issues
Database Locked Errors
Getting Help
Support Channels
Discord: Join our Discord server for real-time help
GitHub Discussions: Ask questions in GitHub Discussions
Documentation: Check docs.openalgo.in
GitHub Issues: Report bugs in Issues
Before Asking for Help
Search existing issues - Your question might already be answered
Check documentation - Review docs at docs.openalgo.in
Review error logs - Include error messages when asking for help
Provide context - Share your environment (OS, Python version, broker)
Asking Good Questions
When asking for help, include:
Clear description of the problem
Steps to reproduce the issue
Expected behavior vs actual behavior
Error messages (full stack trace)
Environment details:
OS and version
Python version (
python --version)OpenAlgo version
Broker being used
Example:
Code Review Process
After submitting your pull request:
Automated Checks
Ensure all checks pass
Fix any failing checks before requesting review
Review Feedback
Address reviewer comments promptly
Ask questions if feedback is unclear
Make requested changes in new commits
Updates
Push additional commits to your branch
No need to create a new PR
Use
git push origin feature/your-feature-name
Approval & Merge
Once approved, maintainers will merge
Your contribution will be in the next release!
Be Patient
Reviews may take a few days
Maintainers are volunteers
Ping politely if no response after a week
Recognition & Community
Contributors
We value all contributions! Contributors will be:
Listed in contributors section on GitHub
Mentioned in release notes for significant contributions
Part of the OpenAlgo community on Discord
Eligible for contributor benefits (coming soon)
Community Guidelines
Be respectful and follow these principles:
Be Respectful - Treat everyone with respect
Be Constructive - Provide helpful feedback
Be Patient - Remember everyone is learning
Be Inclusive - Welcome contributors of all skill levels
Be Professional - Keep discussions focused on code
Quick Reference Links
Repository: github.com/marketcalls/openalgo
Issue Tracker: github.com/marketcalls/openalgo/issues
Documentation: docs.openalgo.in
Discord: discord.com/invite/UPh7QPsNhP
PyPI Package: pypi.org/project/openalgo
YouTube: youtube.com/@openalgoHQ
Twitter/X: @openalgoHQ
License
OpenAlgo is released under the AGPL v3.0 License. See the LICENSE file for details.
By contributing to OpenAlgo, you agree that your contributions will be licensed under the AGPL v3.0 License.
Thank You!
Thank you for contributing to OpenAlgo! Your efforts help democratize algorithmic trading and empower traders worldwide. Every line of code, documentation improvement, and bug report makes a difference.
Happy coding, and welcome to the OpenAlgo community!
Built by traders, for traders - making algo trading accessible to everyone.
Last updated
Was this helpful?