Before installing OpenAlgo, ensure you have the following prerequisites installed:
- Visual Studio Code (VS Code) installed on Windows.
- Python version 3.10 or 3.11 installed.
- Git for cloning the repository (Download from https://git-scm.com/downloads).
- Node.js for CSS compilation (Download from https://nodejs.org/).
-
Install VS Code Extensions:
- Open VS Code
- Navigate to the Extensions section on the left tab
- Install the Python, Pylance, and Jupyter extensions
-
Clone the Repository: Open the VS Code Terminal and clone the OpenAlgo repository:
git clone https://github.com/marketcalls/openalgo
-
Install Python Dependencies:
For Windows users:
pip install -r requirements.txt
For Linux/Nginx users:
pip install -r requirements-nginx.txt
-
Install Node.js Dependencies:
cd openalgo npm install
-
Configure Environment Variables:
- Rename
.sample.env
to.env
in theopenalgo
folder - Update the
.env
file with your specific configurations
- Rename
The project uses TailwindCSS and DaisyUI for styling. The CSS needs to be compiled before running the application.
For development with auto-recompilation (watches for changes):
npm run dev
For production deployment:
npm run build
- Source file:
src/css/styles.css
- Compiled output:
static/css/main.css
When making style changes:
- Edit the source file at
src/css/styles.css
- Run the appropriate npm script to compile
- The compiled CSS will be automatically used by the templates
-
Start the Flask Application:
For development:
python app.py
For production with Nginx (using eventlet):
gunicorn --worker-class eventlet -w 1 app:app
Note: When using Gunicorn,
-w 1
specifies one worker process. This is important because WebSocket connections are persistent and stateful. -
Access the Application:
- Open your browser and navigate to http://127.0.0.1:5000
- Set up your account at http://127.0.0.1:5000/setup
- Log in with your credentials
If you encounter any issues during installation:
-
CSS not updating:
- Ensure Node.js is properly installed
- Run
npm install
again - Check if the CSS compilation script is running
- Clear your browser cache
-
Python dependencies:
- Use a virtual environment
- Ensure you're using Python 3.10 or 3.11
- Try upgrading pip:
pip install --upgrade pip
-
WebSocket issues:
- Ensure you're using only one worker with Gunicorn
- Check if your firewall allows WebSocket connections
- Verify Socket.IO client version matches server version
For more detailed configuration instructions, visit https://docs.openalgo.in