-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcheck_services.py
More file actions
67 lines (58 loc) · 2.03 KB
/
Copy pathcheck_services.py
File metadata and controls
67 lines (58 loc) · 2.03 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env python3
"""Quick service status check for all FRA services"""
import requests
from colorama import init, Fore, Style
init(autoreset=True)
services = [
{
"name": "🤖 AI Service",
"url": "http://localhost:8000/health",
"port": 8000
},
{
"name": "🔗 Blockchain Service",
"url": "http://localhost:8001/health",
"port": 8001
},
{
"name": "🐍 Backend API",
"url": "http://127.0.0.1:3001/health",
"port": 3001
},
{
"name": "⚛️ Frontend",
"url": "http://localhost:3000",
"port": 3000
}
]
print(f"\n{Fore.CYAN}{'='*60}")
print(f"{Fore.CYAN} FRA ATLAS - SERVICE STATUS CHECK")
print(f"{Fore.CYAN}{'='*60}\n")
all_online = True
for service in services:
try:
response = requests.get(service['url'], timeout=5)
if response.status_code == 200:
print(f"{Fore.GREEN}✅ {service['name']} - ONLINE (Port {service['port']})")
else:
print(f"{Fore.YELLOW}⚠️ {service['name']} - RUNNING but returned {response.status_code}")
all_online = False
except requests.exceptions.ConnectionError:
print(f"{Fore.RED}❌ {service['name']} - OFFLINE (Port {service['port']})")
all_online = False
except Exception as e:
print(f"{Fore.RED}❌ {service['name']} - ERROR: {str(e)}")
all_online = False
print(f"\n{Fore.CYAN}{'='*60}")
if all_online:
print(f"{Fore.GREEN}✨ ALL SERVICES ARE ONLINE AND READY!")
print(f"\n{Fore.WHITE}🌐 Access Points:")
print(f" - Frontend: {Fore.CYAN}http://localhost:3000")
print(f" - AI Service API: {Fore.CYAN}http://localhost:8000")
print(f" - Backend API: {Fore.CYAN}http://127.0.0.1:3001")
print(f" - Blockchain: {Fore.CYAN}http://localhost:8001")
else:
print(f"{Fore.YELLOW}⚠️ SOME SERVICES ARE NOT RUNNING")
print(f"\n{Fore.WHITE}💡 To start all services, run:")
print(f" {Fore.CYAN}.\\START_FIXED_SERVICES.ps1")
print(f"{Fore.CYAN}{'='*60}\n")