2025-11-15 13:37:33 -05:00
|
|
|
"""
|
|
|
|
|
Atomizer Dashboard Launcher
|
|
|
|
|
|
|
|
|
|
Simple script to start the dashboard server and open the browser.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
import webbrowser
|
|
|
|
|
import time
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
|
dashboard_dir = Path(__file__).parent
|
|
|
|
|
api_script = dashboard_dir / 'api' / 'app.py'
|
|
|
|
|
|
|
|
|
|
print("="*60)
|
|
|
|
|
print("ATOMIZER DASHBOARD LAUNCHER")
|
|
|
|
|
print("="*60)
|
|
|
|
|
print(f"\nStarting dashboard server...")
|
2025-11-15 13:41:21 -05:00
|
|
|
print(f"Dashboard will open at: http://localhost:8080")
|
2025-11-15 13:37:33 -05:00
|
|
|
print("\nPress Ctrl+C to stop the server")
|
|
|
|
|
print("="*60)
|
|
|
|
|
|
|
|
|
|
# Give user a moment to read
|
|
|
|
|
time.sleep(2)
|
|
|
|
|
|
|
|
|
|
# Open browser after a short delay
|
|
|
|
|
def open_browser():
|
|
|
|
|
time.sleep(3) # Wait for server to start
|
2025-11-15 13:41:21 -05:00
|
|
|
webbrowser.open('http://localhost:8080')
|
2025-11-15 13:37:33 -05:00
|
|
|
|
|
|
|
|
import threading
|
|
|
|
|
browser_thread = threading.Thread(target=open_browser, daemon=True)
|
|
|
|
|
browser_thread.start()
|
|
|
|
|
|
|
|
|
|
# Start the Flask server
|
|
|
|
|
try:
|
|
|
|
|
subprocess.run([sys.executable, str(api_script)], cwd=str(dashboard_dir))
|
|
|
|
|
except KeyboardInterrupt:
|
|
|
|
|
print("\n\nShutting down dashboard server...")
|
|
|
|
|
print("Goodbye!")
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
main()
|