-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_ui.py
More file actions
50 lines (44 loc) · 1.71 KB
/
start_ui.py
File metadata and controls
50 lines (44 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"""
Quick start script for EDITH Web UI
Launches the Flask API server
"""
import subprocess
import sys
import os
from pathlib import Path
print("""
╔══════════════════════════════════════════════════════════════╗
║ ║
║ 👓 EDITH - Even Disconnected, I'm The Helper ║
║ ║
║ Starting Web Interface... ║
║ ║
╚══════════════════════════════════════════════════════════════╝
""")
# Check if Flask is installed
try:
import flask
from flask_cors import CORS
print("✅ Flask dependencies found")
except ImportError:
print("❌ Missing Flask dependencies!")
print("\nInstalling required packages...")
subprocess.check_call([
sys.executable, "-m", "pip", "install",
"flask", "flask-cors"
])
print("✅ Installation complete!")
# Change to project root
project_root = Path(__file__).parent
os.chdir(project_root)
print("\n🚀 Launching EDITH API Server...")
print("📡 API: http://localhost:5000/api")
print("🌐 UI: http://localhost:5000")
print("\n💡 Press Ctrl+C to stop the server\n")
print("="*60 + "\n")
# Run the Flask app
try:
subprocess.run([sys.executable, "src/api/app.py"])
except KeyboardInterrupt:
print("\n\n👋 Shutting down EDITH...")
print("Goodbye!\n")