Contributors
Let's democratize algorithmic trading, together!
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
Frontend Development
Documentation
Best Practices
Getting Help
Technology Stack
OpenAlgo uses a Python Flask backend with a React 19 single-page application frontend.
Backend Technologies
Python 3.12+ - Core programming language
uv - Fast Python package manager (replaces pip/venv)
Flask 3.1+ - Lightweight web framework
Flask-RESTX - RESTful API with auto-generated Swagger documentation
SQLAlchemy 2.0+ - Database ORM for data persistence
Flask-SocketIO 5.6+ - Real-time WebSocket connections for live updates
Flask-Login - User session management and authentication
Flask-WTF - Form validation and CSRF protection
Ruff - Fast Python linter and formatter
Frontend Technologies
React 19 - Component-based UI library
TypeScript 5.9+ - Type-safe JavaScript
Vite 7+ - Fast build tool and dev server
TailwindCSS 4 - Utility-first CSS framework
shadcn/ui (Radix UI) - Accessible component primitives
TanStack Query 5 - Server state management
Zustand 5 - Client state management
React Router 7 - Client-side routing
Plotly.js / Lightweight Charts - Data visualization
Socket.IO Client - Real-time communication
Biome.js - Fast linter and formatter
Vitest - Unit testing framework
Playwright - End-to-end testing
Trading & Data Libraries
pandas 2.3+ - Data manipulation and analysis
numpy 2.0+ - Numerical computing
DuckDB - Historical market data storage
httpx - Modern HTTP client with HTTP/2 support
websockets 15.0+ - WebSocket client and server
pyzmq - ZeroMQ for high-performance message queue
APScheduler - Background task scheduling
scipy / py_vollib / numba - Options analytics and Greeks
Security & Performance
argon2-cffi - Secure password hashing
cryptography - Token encryption
Flask-Limiter - Rate limiting
Flask-CORS - CORS protection
[!IMPORTANT] You will need Python 3.12+, Node.js 20/22/24, and the uv package manager.
Development Setup
Prerequisites
Before you begin, make sure you have the following installed:
Python 3.12+ - Download Python
Node.js 20, 22, or 24 - Download Node.js
Git - Download Git
Code Editor - VS Code recommended with extensions:
Python
Pylance
Biome
Tailwind CSS IntelliSense
Basic Knowledge of Flask and React
Install Dependencies
[!IMPORTANT] Always use
uv runto run Python commands. Never use global Python or manually manage virtual environments. Theuvtool automatically creates and manages a.venvfor the project.
Configure Environment
[!NOTE] Static IP whitelisting: Many Indian brokers require you to whitelist a static IP address when generating API keys and secrets. If you are developing locally, you may need to whitelist your public IP. For cloud/VPS deployments, use the server's static IP. Check your broker's API documentation for specific requirements.
Local Development
Run the Application
Development Workflow with Multiple Terminals
For the best development experience when working on the frontend, use two terminals:
Terminal 1 - React Dev Server (hot reload):
Terminal 2 - Flask Backend:
Note: The React dev server proxies API requests to the Flask backend. For production testing, build the frontend with
npm run buildand access everything through Flask at port 5000.
Production Mode (Linux only)
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 and set up your broker
Access Points
Main app: http://127.0.0.1:5000
React frontend: http://127.0.0.1:5000/react
Swagger API docs: http://127.0.0.1:5000/api/docs
API Analyzer: http://127.0.0.1:5000/analyzer
Project Structure
Understanding the codebase structure will help you contribute effectively:
Key Directories
frontend/: React 19 SPA with TypeScript, built with Vite and served by Flask viablueprints/react_app.pybroker/: Each subdirectory contains a complete broker integration withapi/,database/,mapping/,streaming/, andplugin.jsonrestx_api/: RESTful API endpoints with automatic Swagger documentation at/api/docsblueprints/: Flask route handlers for UI pages and webhooksservices/: Business logic separated from route handlerswebsocket_proxy/: Real-time market data streaming via unified WebSocket proxydatabase/: 5 separate databases for isolation (main, logs, latency, sandbox, historify)
Development Workflow
1. Fork and Clone
Important: Disable GitHub Actions on Your Fork
After forking, go to your fork's Settings → Actions → General (
https://github.com/YOUR_USERNAME/openalgo/settings/actions) and select "Disable actions" under Actions permissions. This prevents CI workflows (frontend builds, Docker pushes) from running on your fork unnecessarily — those workflows are only meant to run on the upstream repository.
2. Frontend Build Assets (Auto-Built by CI)
The /frontend/dist directory is gitignored and not tracked in the repository. CI automatically builds the frontend when changes are merged to main.
How it works:
PRs are tested with a fresh frontend build (but not committed)
When merged to main, CI automatically:
Builds the frontend (
cd frontend && npm run build)Pushes Docker image to Docker Hub
For Contributors:
Build locally for development:
cd frontend && npm install && npm run buildDo NOT commit
frontend/dist/— it is gitignoredFocus on source code changes — CI handles production builds
3. Create a Feature Branch
4. Make Your Changes
Follow these guidelines while developing:
Python Code Style
Follow PEP 8 style guide
Use 4 spaces for indentation
Maximum 100 characters line length (configured in Ruff)
Imports: Standard library → Third-party → Local
Use Google-style docstrings
Run the linter:
React/TypeScript Code Style
Follow Biome.js rules (configured in
frontend/biome.json)Use functional components with hooks
Component files use PascalCase:
MyComponent.tsxUse TanStack Query for server state, Zustand for client state
Run the linter:
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:
5. Test Your Changes
Testing Checklist
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
Contributing Guidelines
Contribution Policy: One Feature or One Fix at a Time
OpenAlgo follows a strict incremental contribution standard. We require all contributions to be submitted as:
One feature per pull request, OR
One fix per pull request
Why this matters:
OpenAlgo supports a growing list of brokers, and every change must be validated across this broad surface area. Large integrations submitted in a single PR require extensive manual testing and verification that is not practical for the maintainers to review all at once.
Additionally, many contributions today are developed with AI assistance, which can accelerate development substantially but also increases the need for careful human review, testing, and incremental verification before acceptance into a shared upstream project.
What this means in practice:
Break large features into small, self-contained pull requests
Each PR should be independently reviewable and testable
Submit them sequentially — wait for one to be reviewed before sending the next
Large monolithic PRs or full-project integrations will not be accepted in their current form
Exception — New broker integrations may be submitted as a single PR since they are self-contained within their own
broker/directory and don't modify core platform code
If you have a large integration or project built on OpenAlgo:
We appreciate and encourage projects built on top of OpenAlgo (it's why we're open-source!). However, we cannot merge large codebases as a single contribution. Instead, extract individual improvements, fixes, or self-contained features and submit them separately. This gives each contribution a much better chance of being reviewed and accepted.
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
Bug Fixes
Fix minor bugs and edge cases
Improve error messages
UI Improvements
Enhance React components
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
React Frontend Features
Build new pages or components
Add data visualizations with Plotly/Lightweight Charts
Improve real-time updates via Socket.IO
Performance Optimization
Optimize database queries
Improve caching strategies
Reduce API latency
WebSocket Features
Add new streaming capabilities
Improve real-time performance
Add broker WebSocket adapters
Testing
Write Vitest unit tests for React components
Write Playwright end-to-end tests
Write pytest tests for backend services
Improve test coverage
Security Enhancements
Audit security vulnerabilities
Improve authentication
Enhance encryption
Testing
Python Backend Tests
React Frontend Tests
Writing Python Tests
Writing React Tests
Writing E2E Tests
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 in
.envTest authentication flow
Test each API endpoint via Swagger UI at
/api/docsTest WebSocket streaming (if supported)
Validate error handling
4. Reference Implementations
Study existing broker implementations:
/broker/zerodha/- Most complete implementation/broker/dhan/- Modern API design/broker/angel/- WebSocket streaming
Frontend Development
React + shadcn/ui Architecture
The frontend is a React 19 SPA located in /frontend/. It is built with Vite and served by Flask in production via blueprints/react_app.py.
Development Server
Component Library
OpenAlgo uses shadcn/ui built on Radix UI primitives with Tailwind CSS:
Server State with TanStack Query
Client State with Zustand
Styling with Tailwind CSS 4
Use Tailwind utility classes directly. Always use responsive and theme-aware patterns:
Linting and Formatting
Documentation
Code Documentation
Python Docstrings - Use Google-style:
TypeScript - Use JSDoc where types alone aren't sufficient:
API Documentation - Use Flask-RESTX decorators:
Best Practices
Security
Never commit sensitive data
Validate all inputs at system boundaries
Use parameterized queries (SQLAlchemy ORM)
Follow OWASP guidelines
Enable CSRF protection (already configured)
Use HTTPS in production
Rate limiting is configured per endpoint
Sanitize user inputs
Performance
Optimize database queries
Use caching
Minimize API calls — use batch endpoints
Code Quality
Write self-documenting code
Keep functions small and focused
Return consistent JSON responses from API endpoints
Troubleshooting
Common Issues
Frontend Build Errors
Python Dependency Issues
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, Node 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)Node.js version (
node --version)OpenAlgo version
Broker being used
Code Review Process
After submitting your pull request:
Automated Checks
CI will build the frontend and run linting
Ensure all checks pass 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
Approval & Merge
Once approved, maintainers will merge
CI will automatically build the frontend for production
Be Patient
Reviews may take a few days
Maintainers are volunteers
Ping politely if no response after a week
Recognition & Community
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
Community Guidelines
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