FastScalper is a lightweight, cross-platform desktop application built with Tauri and styled using custom CSS. It provides a streamlined interface for placing automated trading orders through the OpenAlgo API.
- Features
- Prerequisites
- Installation
- Configuration
- Usage
- Building the Application
- Contributing
- License
- Simple and intuitive UI for quick trading actions.
- Supports Long Entry (LE), Long Exit (LX), Short Entry (SE), and Short Exit (SX) operations.
- Customizable settings for API key, exchange, product type, and host URL.
- Voice alerts for trade actions (can be enabled/disabled in settings).
- Persistent settings using local storage.
- Cross-platform support (Windows, macOS, Linux).
Before you begin, ensure you have met the following requirements:
- Node.js (version 14 or later)
- npm (Node Package Manager)
- Rust and Cargo (Rust's package manager)
- Tauri CLI (Command Line Interface)
Install Rust and Cargo by running:
# On Unix/Linux/macOS
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# On Windows, use the MSI installer from:
# https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe
After installing Rust and Cargo, install the Tauri CLI:
cargo install tauri-cli
Follow these steps to set up the FastScalper application:
-
Clone the Repository
git clone https://github.com/marketcalls/fastscalper-tauri.git
-
Navigate to the Project Directory
cd fastscalper-tauri
-
Install Dependencies
npm install
Ensure that the OpenAlgo API is running and accessible. By default, the application is configured to send requests to http://127.0.0.1:5000/api/v1/placesmartorder
, but this can be changed in the settings.
The tauri.conf.json
file contains configuration settings for the Tauri application. Key settings include window size, title, and bundle identifiers.
Example tauri.conf.json
:
{
"build": {
"withGlobalTauri": true
},
"package": {
"productName": "FastScalper",
"version": "0.1.0"
},
"tauri": {
"allowlist": {
"all": false
},
"windows": [
{
"title": "FastScalper",
"width": 380,
"height": 300,
"resizable": false
}
],
"security": {
"csp": null
},
"bundle": {
"active": true,
"targets": "all",
"identifier": "com.fastscalper.app",
"icon": [
"icons/icon.icns",
"icons/icon.ico"
]
}
}
}
To start the application in development mode with hot-reloading:
npm run tauri dev
- Symbol: Enter the trading symbol (e.g., "BHEL").
- Quantity: Enter the quantity for the trade.
- LE (Long Entry): Place a buy order with the specified quantity.
- LX (Long Exit): Close a long position (sell order with zero quantity).
- SE (Short Entry): Place a sell order with the specified quantity.
- SX (Short Exit): Close a short position (buy order with zero quantity).
Click the Settings button to configure:
- API Key: Your OpenAlgo API key.
- Exchange: Select the exchange from the dropdown.
- Product: Select the product type (CNC, NRML, MIS).
- Host URL: Set the URL for the OpenAlgo API (default: http://127.0.0.1:5000).
- Voice Alerts: Enable or disable voice alerts for trade actions.
Settings are saved in local storage and persist between sessions.
- Enter the Symbol and Quantity.
- Click one of the trading buttons (LE, LX, SE, SX).
- The application will send a request to the OpenAlgo API at the configured host URL.
- An alert will display the response from the API.
- If voice alerts are enabled, you'll hear a voice announcement of the action.
FastScalper includes a voice alert feature that announces the trading action when a button is pressed. This feature can be enabled or disabled in the settings modal.
Voice alerts work across all supported platforms (Windows, macOS, and Linux) without any special configuration. The feature uses the Web Speech API, which is supported by modern web browsers and is compatible with Tauri's WebView component.
Voice alert messages:
- LE button: "Buy Order"
- LX button: "Buy Exit"
- SE button: "Short Order"
- SX button: "Short Exit"
Note: The quality and availability of voices may vary depending on the operating system and installed language packs. Most modern operating systems come with pre-installed voices, but users can add more voices through their system settings if desired.
To build the application for distribution:
npm run tauri build
The built application will be located in the src-tauri/target/release/bundle
directory, organized by platform.
src/
: Contains the frontend code (HTML, CSS, JavaScript).index.html
: The main HTML file.styles.css
: Custom CSS styles.main.js
: JavaScript logic for the application, including voice alerts and API interactions.
src-tauri/
: Contains the Rust backend code.src/main.rs
: Rust source code handling API calls.tauri.conf.json
: Tauri configuration file.Cargo.toml
: Rust dependencies configuration.
- Tauri API: Provides interaction between the frontend and backend.
- Web Speech API: Used for voice alerts (built into modern browsers).
- tauri: The core Tauri library.
- serde: For serialization and deserialization of data.
- serde_json: For handling JSON data.
- reqwest: For making HTTP requests.
- tokio: Asynchronous runtime for Rust.
Cargo.toml Dependencies:
[dependencies]
tauri = { version = "1", features = ["api-all"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
reqwest = { version = "0.11", features = ["json", "default-tls"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
Contributions are welcome! Please follow these steps:
-
Fork the Repository
Click on the "Fork" button in the top right corner of the repository page.
-
Create a Feature Branch
git checkout -b feature/YourFeatureName
-
Commit Your Changes
git commit -m "Add your feature"
-
Push to Your Fork
git push origin feature/YourFeatureName
-
Create a Pull Request
Go to the original repository and click on "Pull Requests" to submit your PR.
This project is licensed under the MIT License.
- Tauri for providing the framework to build cross-platform desktop applications.
- OpenAlgo for the trading API.
- All contributors and the open-source community.
For support or inquiries, please open an issue on the GitHub repository.
FastScalper can be built for Windows, macOS, and Linux. Follow these instructions to build for your target platform:
- Ensure you have Rust and Node.js installed on your development machine.
- Install platform-specific dependencies as needed (see below).
- Ensure you're on a macOS machine with Xcode installed.
- Run the build command:
npm run tauri build
This will produce a .dmg
file in src-tauri/target/release/bundle/dmg/
.
- On a Windows machine with Visual Studio build tools installed, run:
npm run tauri build
This will produce a .msi
installer in src-tauri/target/release/bundle/msi/
.
To build for Windows on a non-Windows machine, you'll need to set up cross-compilation tools. Refer to the Tauri documentation for detailed instructions.
- On a Linux machine, ensure you have the necessary dependencies installed. For Ubuntu/Debian:
sudo apt update
sudo apt install libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
- Run the build command:
npm run tauri build
This will produce an AppImage, a .deb file, and other formats in src-tauri/target/release/bundle/
.
To build for all platforms from a single machine, you'll need to set up cross-compilation environments. This is an advanced topic and requires additional setup. Refer to the Tauri documentation on Cross-Platform Compilation for detailed instructions.
The built applications will be located in the src-tauri/target/release/bundle
directory, organized by platform.