├── FUNDING.yml ├── .gitattributes ├── upi_logo.png ├── scan_upi_id.jpg ├── steadfast.code-workspace ├── .gitignore ├── .gitmodules ├── readme.md ├── start-all.bat └── start-all.sh /FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [narenkram] 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /upi_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/narenkram/steadfast-monorepo/HEAD/upi_logo.png -------------------------------------------------------------------------------- /scan_upi_id.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/narenkram/steadfast-monorepo/HEAD/scan_upi_id.jpg -------------------------------------------------------------------------------- /steadfast.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "settings": {} 8 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows 2 | Thumbs.db 3 | ehthumbs.db 4 | Desktop.ini 5 | $RECYCLE.BIN/ 6 | 7 | # Ignore specific directories in the monorepo 8 | /steadfast-app/node_modules/ 9 | /steadfast-api/node_modules/ 10 | /steadfast-websocket/__pycache__/ 11 | 12 | # Ignore nested .git directories 13 | # **/.git 14 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "steadfast-app"] 2 | path = steadfast-app 3 | url = https://github.com/narenkram/steadfast-app.git 4 | [submodule "steadfast-api"] 5 | path = steadfast-api 6 | url = https://github.com/narenkram/steadfast-api.git 7 | [submodule "steadfast-websocket"] 8 | path = steadfast-websocket 9 | url = https://github.com/narenkram/steadfast-websocket.git -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | #### There are two different versions for this project. 2 | ### ⚠️ Important Notice for `Open Source Version` - free for personal use only 3 | **This repository contains experimental, AI-generated code - USE WITH CAUTION** 4 | - This codebase is intended primarily for learning and experimental purposes 5 | - Contains potential bugs, security vulnerabilities, and implementation issues 6 | - Code quality is experimental-grade and not optimized for production 7 | - Can be used for real trading, but with extreme caution and at your own risk 8 | - May be unstable and prone to javascript runtime errors 9 | - Users should thoroughly test and understand the code before using with real funds 10 | 11 | ### 🚀 Looking for a web access with latest updates? 12 | ### Signup `Premium Version` at [https://www.steadfastapp.in](https://www.steadfastapp.in) 13 | #### A professionally developed SaaS application, built using `TypeScript` and highly optimized for lightning-fast trades. 14 | 15 | # Join Our Telegram Channel 16 | Stay updated by joining our [Telegram Channel](https://t.me/steadfastapp). 17 | 18 | # Project Overview 19 | This repository is a monorepo containing three main projects: 20 | 1. [**steadfast-app**](https://github.com/narenkram/steadfast-app): The frontend application. 21 | 2. [**steadfast-api**](https://github.com/narenkram/steadfast-api): The backend API server. 22 | 3. [**steadfast-websocket**](https://github.com/narenkram/steadfast-websocket): The WebSocket service. 23 | 24 | 25 | ### ⚡ Steps to run the app 26 | 27 | ### `Step 0`: Prerequisites 28 | 29 | Operating System: `Windows 11` 30 | 31 | 1. Ensure [Git](https://git-scm.com/download/win) is installed and accessible from the command line. 32 | 33 | ``` 34 | git --version 35 | ``` 36 | 37 | 2. Ensure [Node.js and npm](https://nodejs.org/en/download/prebuilt-installer) are installed and accessible from the command line. 38 | 39 | ``` 40 | node -v && npm -v 41 | ``` 42 | 43 | 3. Ensure [Python](https://www.python.org/downloads/) is installed and accessible from the command line. 44 | 45 | ``` 46 | python -V 47 | ``` 48 | 49 | ### `Step 1`: Clone the Steadfast Monorepo 50 | 51 | 1. Open your terminal or command prompt. 52 | 2. Run the following command: 53 | 54 | ```bash 55 | git clone https://github.com/narenkram/steadfast-monorepo 56 | ``` 57 | 58 | 3. This will create a new folder named "steadfast-monorepo" in your current directory. 59 | 4. Open/Navigate the monorepo folder in file explorer. 60 | 61 | ### `Step 2`: Start 62 | 63 | Double-click the `start-all.bat` file or run it from the command prompt. 64 | 65 | #### What it does: 66 | 67 | 1. **Install all (Recommended for first time setup):** Clones the repositories and installs dependencies. 68 | 2. **Update, install and run (Recommended when a update is available):** Updates all repositories, installs dependencies, and then runs the services. 69 | 3. **Run existing version:** Runs the existing version of the services without updating or installing anything. 70 | 4. **Exit:** Exits the script. 71 | 72 | #### What it does: 73 | 74 | 1. Starts the steadfast-app at `localhost: 5173` 75 | 2. Starts the steadfast-api server at `localhost: 3000` 76 | 3. Starts the flattrade-websocket server at `localhost: 8765` 77 | 4. Starts the shoonya-websocket server at `localhost: 8766` 78 | 79 | ### `Step 3`: Stop 80 | 81 | - To `Stop` simply close the opened command prompt windows. 82 | - Or Press any key to stop the app, api and websocket. 83 | 84 | -------------------------------------------------------------------------------- /start-all.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal enabledelayedexpansion 3 | 4 | :menu 5 | echo Choose an option: 6 | echo 1. Install all (Recommended for first time setup) 7 | echo 2. Update and install dependencies (For updating existing setup) 8 | echo 3. Run existing version 9 | echo 4. Exit 10 | set /p choice="Enter your choice (1, 2, 3, or 4): " 11 | 12 | if "%choice%"=="1" goto install 13 | if "%choice%"=="2" goto update_and_run 14 | if "%choice%"=="3" goto run 15 | if "%choice%"=="4" goto end 16 | echo Invalid choice. Please try again. 17 | goto menu 18 | 19 | :install 20 | REM Clone all repositories first 21 | echo Cloning repositories... 22 | 23 | echo Checking app repository... 24 | if not exist "steadfast-app\.git" ( 25 | echo Cloning app... 26 | git clone https://github.com/narenkram/steadfast-app.git 27 | ) else ( 28 | echo App repository already exists, skipping clone... 29 | ) 30 | 31 | echo Checking API repository... 32 | if not exist "steadfast-api\.git" ( 33 | echo Cloning API... 34 | git clone https://github.com/narenkram/steadfast-api.git 35 | ) else ( 36 | echo API repository already exists, skipping clone... 37 | ) 38 | 39 | echo Checking WebSocket repository... 40 | if not exist "steadfast-websocket\.git" ( 41 | echo Cloning WebSocket... 42 | git clone https://github.com/narenkram/steadfast-websocket.git 43 | ) else ( 44 | echo WebSocket repository already exists, skipping clone... 45 | ) 46 | 47 | REM Now install dependencies for each repository 48 | echo Installing dependencies for all repositories... 49 | 50 | echo Installing app dependencies... 51 | cd steadfast-app 52 | call npm install 53 | if !errorlevel! neq 0 ( 54 | echo Error occurred while installing app dependencies. 55 | goto :error 56 | ) 57 | cd .. 58 | 59 | echo Installing API dependencies... 60 | cd steadfast-api 61 | call npm install 62 | if !errorlevel! neq 0 ( 63 | echo Error occurred while installing API dependencies. 64 | goto :error 65 | ) 66 | cd .. 67 | 68 | echo Installing WebSocket dependencies... 69 | cd steadfast-websocket 70 | pip install -r requirements.txt 71 | if !errorlevel! neq 0 ( 72 | echo Error occurred while installing WebSocket dependencies. 73 | goto :error 74 | ) 75 | 76 | REM Install NorenRestApi without dependencies 77 | echo Installing NorenRestApi... 78 | pip install --no-deps NorenRestApi 79 | if !errorlevel! neq 0 ( 80 | echo Error occurred while installing NorenRestApi. 81 | goto :error 82 | ) 83 | cd .. 84 | 85 | echo Repositories cloned and dependencies installed successfully. 86 | goto menu 87 | 88 | :update_and_run 89 | REM Update the entire monorepo 90 | echo Updating steadfast-monorepo... 91 | git pull https://github.com/narenkram/steadfast-monorepo main 92 | if !errorlevel! neq 0 ( 93 | echo Error updating steadfast-monorepo. 94 | goto :error 95 | ) 96 | 97 | REM Update steadfast-app 98 | echo Updating steadfast-app... 99 | cd steadfast-app 100 | git pull https://github.com/narenkram/steadfast-app main 101 | if !errorlevel! neq 0 ( 102 | echo Error updating steadfast-app. 103 | goto :error 104 | ) 105 | echo Installing app dependencies... 106 | call npm install 107 | call npm audit fix 108 | cd .. 109 | 110 | REM Update steadfast-api 111 | echo Updating steadfast-api... 112 | cd steadfast-api 113 | git pull https://github.com/narenkram/steadfast-api main 114 | if !errorlevel! neq 0 ( 115 | echo Error updating steadfast-api. 116 | goto :error 117 | ) 118 | echo Installing api dependencies... 119 | call npm install 120 | call npm audit fix 121 | cd .. 122 | 123 | REM Update steadfast-websocket 124 | echo Updating steadfast-websocket... 125 | cd steadfast-websocket 126 | git pull https://github.com/narenkram/steadfast-websocket main 127 | if !errorlevel! neq 0 ( 128 | echo Error updating steadfast-websocket. 129 | goto :error 130 | ) 131 | cd .. 132 | 133 | echo Update complete. 134 | goto menu 135 | 136 | :run 137 | REM Start the API in a new command prompt window 138 | echo Starting API... 139 | start /min cmd /c "cd steadfast-api && node server.js" 140 | 141 | REM Start the app in a new command prompt window 142 | echo Starting app... 143 | start /min cmd /c "cd steadfast-app && npm run dev" 144 | 145 | REM Start the WebSocket server in a new command prompt window 146 | echo Starting WebSocket server... 147 | start /min cmd /c "cd steadfast-websocket && python main.py" 148 | 149 | REM Wait for a few seconds to allow the app to start 150 | timeout /t 5 151 | 152 | REM Open the default browser to the API's URL 153 | echo Opening browser to API's URL... 154 | start http://localhost:3000 155 | 156 | REM Open the default browser to the app's URL 157 | echo Opening browser to app's URL... 158 | start http://localhost:5173 159 | 160 | echo Services started and browsers opened. Close this window to stop all services. 161 | echo Press any key to stop all services... 162 | pause > nul 163 | 164 | REM Kill all node processes 165 | taskkill /F /IM node.exe > nul 2>&1 166 | 167 | REM Kill all python processes 168 | taskkill /F /IM python.exe > nul 2>&1 169 | 170 | echo All services stopped. 171 | goto menu 172 | 173 | :end 174 | endlocal 175 | -------------------------------------------------------------------------------- /start-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Enable error handling 4 | set -e 5 | 6 | # Function to display the menu 7 | menu() { 8 | echo "Choose an option:" 9 | echo "1. Install all (Recommended for first time setup)" 10 | echo "2. Update and install dependencies (For updating existing setup)" 11 | echo "3. Run existing version" 12 | echo "4. Exit" 13 | read -p "Enter your choice (1, 2, 3, or 4): " choice 14 | 15 | case $choice in 16 | 1) install ;; 17 | 2) update_and_run ;; 18 | 3) run ;; 19 | 4) exit 0 ;; 20 | *) echo "Invalid choice. Please try again." 21 | menu ;; 22 | esac 23 | } 24 | 25 | # Function to install all repositories and dependencies 26 | install() { 27 | echo "Cloning repositories..." 28 | 29 | echo "Checking app repository..." 30 | if [ ! -d "steadfast-app/.git" ]; then 31 | echo "Cloning app..." 32 | git clone https://github.com/narenkram/steadfast-app.git 33 | else 34 | echo "App repository already exists, skipping clone..." 35 | fi 36 | 37 | echo "Checking API repository..." 38 | if [ ! -d "steadfast-api/.git" ]; then 39 | echo "Cloning API..." 40 | git clone https://github.com/narenkram/steadfast-api.git 41 | else 42 | echo "API repository already exists, skipping clone..." 43 | fi 44 | 45 | echo "Checking WebSocket repository..." 46 | if [ ! -d "steadfast-websocket/.git" ]; then 47 | echo "Cloning WebSocket..." 48 | git clone https://github.com/narenkram/steadfast-websocket.git 49 | else 50 | echo "WebSocket repository already exists, skipping clone..." 51 | fi 52 | 53 | echo "Installing dependencies for all repositories..." 54 | 55 | echo "Installing app dependencies..." 56 | cd steadfast-app 57 | npm install || { echo "Error occurred while installing app dependencies."; exit 1; } 58 | cd .. 59 | 60 | echo "Installing API dependencies..." 61 | cd steadfast-api 62 | npm install || { echo "Error occurred while installing API dependencies."; exit 1; } 63 | cd .. 64 | 65 | echo "Installing WebSocket dependencies..." 66 | cd steadfast-websocket 67 | 68 | # Create and activate virtual environment 69 | python -m venv venv 70 | source venv/bin/activate 71 | 72 | # Install dependencies within virtual environment 73 | pip install -r requirements.txt || { echo "Error occurred while installing WebSocket dependencies."; exit 1; } 74 | 75 | cd .. 76 | 77 | echo "Installing NorenRestApi..." 78 | pip install --no-deps NorenRestApi || { echo "Error occurred while installing NorenRestApi."; exit 1; } 79 | deactivate 80 | 81 | echo "Repositories cloned and dependencies installed successfully." 82 | menu 83 | } 84 | 85 | # Function to update repositories and install dependencies 86 | update_and_run() { 87 | echo "Updating steadfast-monorepo..." 88 | git pull https://github.com/narenkram/steadfast-monorepo main || { echo "Error updating steadfast-monorepo."; exit 1; } 89 | 90 | echo "Updating steadfast-app..." 91 | cd steadfast-app 92 | git pull https://github.com/narenkram/steadfast-app main || { echo "Error updating steadfast-app."; exit 1; } 93 | echo "Installing app dependencies..." 94 | npm install 95 | npm audit fix 96 | cd .. 97 | 98 | echo "Updating steadfast-api..." 99 | cd steadfast-api 100 | git pull https://github.com/narenkram/steadfast-api main || { echo "Error updating steadfast-api."; exit 1; } 101 | echo "Installing API dependencies..." 102 | npm install 103 | npm audit fix 104 | cd .. 105 | 106 | echo "Updating steadfast-websocket..." 107 | cd steadfast-websocket 108 | git pull https://github.com/narenkram/steadfast-websocket main || { echo "Error updating steadfast-websocket."; exit 1; } 109 | 110 | # Activate virtual environment and install dependencies 111 | source venv/bin/activate 112 | pip install -r requirements.txt || { echo "Error occurred while installing WebSocket dependencies."; exit 1; } 113 | deactivate 114 | cd .. 115 | 116 | echo "Update complete." 117 | menu 118 | } 119 | 120 | # Function to run the existing version 121 | run() { 122 | echo "Starting API..." 123 | bash -c "cd steadfast-api && node server.js & " 124 | 125 | echo "Starting app..." 126 | bash -c "cd steadfast-app && npm run dev & " 127 | 128 | echo "Starting WebSocket server..." 129 | bash -c "cd steadfast-websocket && source venv/bin/activate && python main.py & " 130 | 131 | sleep 5 132 | 133 | echo "Opening browser to API's URL..." 134 | xdg-open http://localhost:3000 135 | 136 | echo "Opening browser to app's URL..." 137 | xdg-open http://localhost:5173 138 | 139 | echo "Services started and browsers opened. Close this window to stop all services." 140 | read -p "Press any key to stop all services..." -n1 -s 141 | 142 | echo "Stopping all services..." 143 | pkill -f node 144 | pkill -f python 145 | 146 | echo "All services stopped." 147 | menu 148 | } 149 | 150 | # Start the menu 151 | menu --------------------------------------------------------------------------------