Backend Unavailable
Unable to connect to the Personal Internet Cell backend. Please ensure the API server is running on port 3000.
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; import { useState, useEffect } from 'react'; import { Home, Users, Network, Shield, Mail, Calendar as CalendarIcon, FolderOpen, Activity, Wifi, Server, Key, Package2, Settings as SettingsIcon } from 'lucide-react'; import { healthAPI } from './services/api'; import Sidebar from './components/Sidebar'; import Dashboard from './pages/Dashboard'; import Peers from './pages/Peers'; import NetworkServices from './pages/NetworkServices'; import WireGuard from './pages/WireGuard'; import Email from './pages/Email'; import Calendar from './pages/Calendar'; import Files from './pages/Files'; import Routing from './pages/Routing'; import Logs from './pages/Logs'; import Settings from './pages/Settings'; import Vault from './pages/Vault'; import ContainerDashboard from './components/ContainerDashboard'; function App() { const [isOnline, setIsOnline] = useState(false); const [isLoading, setIsLoading] = useState(true); useEffect(() => { const checkHealth = async () => { try { await healthAPI.check(); setIsOnline(true); } catch (error) { console.error('Backend not available:', error); setIsOnline(false); } finally { setIsLoading(false); } }; checkHealth(); const interval = setInterval(checkHealth, 30000); // Check every 30 seconds return () => clearInterval(interval); }, []); const navigation = [ { name: 'Dashboard', href: '/', icon: Home }, { name: 'Peers', href: '/peers', icon: Users }, { name: 'Network Services', href: '/network', icon: Network }, { name: 'WireGuard', href: '/wireguard', icon: Shield }, { name: 'Email', href: '/email', icon: Mail }, { name: 'Calendar', href: '/calendar', icon: CalendarIcon }, { name: 'Files', href: '/files', icon: FolderOpen }, { name: 'Routing', href: '/routing', icon: Wifi }, { name: 'Vault', href: '/vault', icon: Key }, { name: 'Containers', href: '/containers', icon: Package2 }, { name: 'Logs', href: '/logs', icon: Activity }, { name: 'Settings', href: '/settings', icon: SettingsIcon }, ]; if (isLoading) { return (
Connecting to Personal Internet Cell...
Unable to connect to the Personal Internet Cell backend. Please ensure the API server is running on port 3000.