diff --git a/README.md b/README.md index 6bb27cb..3eb29e9 100644 --- a/README.md +++ b/README.md @@ -143,9 +143,11 @@ Built with **Next.js**, **MapLibre GL**, **FastAPI**, and **Python**, it's desig If you just want to run the dashboard without dealing with terminal commands: 1. Go to the **[Releases](../../releases)** tab on the right side of this GitHub page. -2. Download the `ShadowBroker_vX.X.zip` file. +2. Download the `ShadowBroker_v0.1.zip` file. 3. Extract the folder to your computer. -4. Double-click the **`start.bat`** file. It will automatically install everything and launch the dashboard! +4. **Windows:** Double-click `start.bat`. + **Mac/Linux:** Open terminal, type `chmod +x start.sh`, and run `./start.sh`. +5. It will automatically install everything and launch the dashboard! --- diff --git a/ShadowBroker_v0.1.zip.REMOVED.git-id b/ShadowBroker_v0.1.zip.REMOVED.git-id index fcc81f5..20def34 100644 --- a/ShadowBroker_v0.1.zip.REMOVED.git-id +++ b/ShadowBroker_v0.1.zip.REMOVED.git-id @@ -1 +1 @@ -26acc242a5d0a3af1c67ce51279ea66ddf4d9daf \ No newline at end of file +ba57965389036194d6dd60e6de33d2e1e1bbf20b \ No newline at end of file diff --git a/clean_zip.py b/clean_zip.py new file mode 100644 index 0000000..3cda542 --- /dev/null +++ b/clean_zip.py @@ -0,0 +1,37 @@ +import os +import zipfile + +zip_name = 'ShadowBroker_v0.1.zip' + +if os.path.exists(zip_name): + try: + os.remove(zip_name) + except Exception as e: + print(f"Failed to delete old zip: {e}") + +def add_dir(zipf, dir_path, excludes): + for root, dirs, files in os.walk(dir_path): + dirs[:] = [d for d in dirs if d not in excludes] + for f in files: + file_path = os.path.join(root, f) + zipf.write(file_path, arcname=file_path) + +try: + with zipfile.ZipFile(zip_name, 'w', zipfile.ZIP_DEFLATED) as zipf: + print("Zipping backend...") + add_dir(zipf, 'backend', {'venv', '__pycache__'}) + + print("Zipping frontend...") + add_dir(zipf, 'frontend', {'node_modules', '.next'}) + + print("Zipping root files...") + zipf.write('docker-compose.yml') + zipf.write('start.bat') + zipf.write('start.sh') + zipf.write('README.md') + + final_size = os.path.getsize(zip_name) / (1024 * 1024) + print(f"\nāœ… SUCCESS! Created {zip_name}. Final size: {final_size:.2f} MB") + +except Exception as e: + print(f"\nāŒ ERROR creating zip: {e}") diff --git a/frontend/package.json b/frontend/package.json index d5ef4e6..1bce943 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "concurrently --names \"NEXT,API\" --prefix-colors \"cyan,yellow\" \"next dev\" \"cd ../backend && venv\\Scripts\\python.exe main.py\"", + "dev": "concurrently \"npm run dev:frontend\" \"cd ../backend && python -m uvicorn main:app --reload\"", "dev:frontend": "next dev", "dev:backend": "cd ../backend && venv\\Scripts\\python.exe main.py", "build": "next build", @@ -37,4 +37,4 @@ "tailwindcss": "^4", "typescript": "^5" } -} +} \ No newline at end of file diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..2684942 --- /dev/null +++ b/start.sh @@ -0,0 +1,52 @@ +#!/bin/bash +echo "=======================================================" +echo " S H A D O W B R O K E R - macOS / Linux Start " +echo "=======================================================" +echo "" + +# Check for Node.js +if ! command -v npm &> /dev/null; then + echo "[!] ERROR: npm is not installed. Please install Node.js (https://nodejs.org/)" + exit 1 +fi + +# Check for Python +if ! command -v python3 &> /dev/null; then + echo "[!] ERROR: python3 is not installed. Please install Python 3.10+ (https://python.org/)" + exit 1 +fi + +echo "[*] Setting up Backend Environment..." +cd backend +if [ ! -d "venv" ]; then + echo "[*] Creating Python Virtual Environment..." + python3 -m venv venv +fi + +echo "[*] Installing Backend dependencies..." +if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then + # In case someone runs this in Git Bash on Windows + source venv/Scripts/activate +else + source venv/bin/activate +fi +pip install -r requirements.txt +cd .. + +echo "[*] Setting up Frontend Environment..." +cd frontend +if [ ! -d "node_modules" ]; then + echo "[*] Installing Frontend dependencies..." + npm install +fi + +echo "" +echo "=======================================================" +echo " šŸš€ Starting Services... " +echo " Dashboard will be available at: http://localhost:3000" +echo " Keep this window open! Note: Initial load takes ~10s " +echo "=======================================================" +echo "" + +# Start both services (npm run dev automatically calls the python backend on Mac/Linux if scripts are configured cross-platform) +npm run dev