mirror of
https://github.com/BigBodyCobain/Shadowbroker.git
synced 2026-05-16 04:59:05 +02:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 982a335d3f | |||
| 362a6e2ceb |
@@ -138,7 +138,24 @@ Built with **Next.js**, **MapLibre GL**, **FastAPI**, and **Python**, it's desig
|
||||
|
||||
## 🚀 Getting Started
|
||||
|
||||
### Prerequisites
|
||||
### 📦 Quick Start (No Code Required)
|
||||
|
||||
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_v0.1.zip` file.
|
||||
3. Extract the folder to your computer.
|
||||
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!
|
||||
|
||||
---
|
||||
|
||||
### 💻 Developer Setup
|
||||
|
||||
If you want to modify the code or run from source:
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
- **Node.js** 18+ and **npm**
|
||||
- **Python** 3.10+ with `pip`
|
||||
@@ -275,8 +292,8 @@ AISSTREAM_API_KEY=your_aisstream_key # Maritime vessel tracking
|
||||
N2YO_API_KEY=your_n2yo_key # Satellite position data
|
||||
|
||||
# Optional (enhances data quality)
|
||||
OPENSKY_USERNAME=your_opensky_user # Higher rate limits for flight data
|
||||
OPENSKY_PASSWORD=your_opensky_pass
|
||||
OPENSKY_CLIENT_ID=your_opensky_client_id # Higher rate limits for flight data
|
||||
OPENSKY_CLIENT_SECRET=your_opensky_secret
|
||||
LTA_ACCOUNT_KEY=your_lta_key # Singapore CCTV cameras
|
||||
```
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
ba57965389036194d6dd60e6de33d2e1e1bbf20b
|
||||
@@ -1 +1 @@
|
||||
83ba61e7af89c1dc7b4d9b972e08d3edf3493966
|
||||
5d33551b09405e7e252c6a11f080a6c9eca50f6b
|
||||
@@ -73,7 +73,7 @@ class OpenSkyClient:
|
||||
# User provided credentials
|
||||
opensky_client = OpenSkyClient(
|
||||
client_id=os.environ.get("OPENSKY_CLIENT_ID", "vancecook-api-client"),
|
||||
client_secret=os.environ.get("OPENSKY_CLIENT_SECRET", "0hWKkj1lpZItUMo2usi4YUjqu8I8YOoD")
|
||||
client_secret=os.environ.get("OPENSKY_CLIENT_SECRET", "YOUR_OPENSKY_SECRET")
|
||||
)
|
||||
|
||||
# Throttling and caching for OpenSky to observe the 400 req/day limit
|
||||
|
||||
@@ -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}")
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -95,14 +95,7 @@ export default function CesiumViewer({ data, activeLayers, activeFilters, effect
|
||||
viewerRef.current.camera.setView({
|
||||
destination: Cesium.Cartesian3.fromDegrees(-95.0, 39.0, 20000000.0)
|
||||
});
|
||||
// Add TomTom Traffic Flow Layer (Raster)
|
||||
const trafficProvider = new Cesium.UrlTemplateImageryProvider({
|
||||
url: "https://api.tomtom.com/traffic/map/4/tile/flow/relative/{z}/{x}/{y}.png?key=uLndz1KvLDpwetYRwoiw8wKwk9i23sWG",
|
||||
credit: ""
|
||||
});
|
||||
viewerRef.current.trafficLayer = viewerRef.current.imageryLayers.addImageryProvider(trafficProvider);
|
||||
viewerRef.current.trafficLayer.show = false; // default off
|
||||
|
||||
// Add Google Photorealistic 3D Tiles if available, otherwise fallback to base
|
||||
// ── Primitive Collections for Fast Rendering ──
|
||||
const Cesium2 = (window as any).Cesium;
|
||||
|
||||
|
||||
@@ -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
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import os
|
||||
import zipfile
|
||||
|
||||
def create_clean_zip():
|
||||
zip_name = 'ShadowBroker_v0.1.zip'
|
||||
exclude_dirs = {'.git', 'node_modules', 'venv', '.next', '__pycache__'}
|
||||
exclude_files = {zip_name, 'zip_repo.py', '.env', '.env.local'}
|
||||
|
||||
with zipfile.ZipFile(zip_name, 'w', zipfile.ZIP_DEFLATED) as zipf:
|
||||
for root, dirs, files in os.walk('.'):
|
||||
dirs[:] = [d for d in dirs if d not in exclude_dirs]
|
||||
for file in files:
|
||||
if file in exclude_files:
|
||||
continue
|
||||
file_path = os.path.join(root, file)
|
||||
arcname = os.path.relpath(file_path, '.')
|
||||
zipf.write(file_path, arcname)
|
||||
print(f"Created {zip_name} successfully!")
|
||||
|
||||
if __name__ == '__main__':
|
||||
create_clean_zip()
|
||||
Reference in New Issue
Block a user