diff --git a/frontend/components/Toast.tsx b/frontend/components/Toast.tsx new file mode 100644 index 00000000..808ec8fe --- /dev/null +++ b/frontend/components/Toast.tsx @@ -0,0 +1,34 @@ +'use client'; + +import { useEffect } from 'react'; + +export interface ToastProps { + type: 'success' | 'error' | 'warning' | 'info'; + message: string; + onClose: () => void; + duration?: number; +} + +export function Toast({ type, message, onClose, duration = 3000 }: ToastProps) { + useEffect(() => { + const timer = setTimeout(onClose, duration); + return () => clearTimeout(timer); + }, [onClose, duration]); + + const bgColor = { + success: 'bg-green-500', + error: 'bg-red-500', + warning: 'bg-yellow-500', + info: 'bg-blue-500', + }[type]; + + return ( +
+ {message} +
+ ); +} diff --git a/start_servers.py b/start_servers.py index aaf0e4ba..bc812be2 100755 --- a/start_servers.py +++ b/start_servers.py @@ -120,27 +120,26 @@ class StandaloneServerManager: ) def start_backend(self): - """Start FastAPI backend server using uvicorn directly from project root""" + """Start FastAPI backend server using uvicorn from project root""" self.log(f"Starting backend on port {self.backend_port}...") backend_log = self.logs_dir / "backend.log" - backend_dir = self.root_dir / "backend" env = os.environ.copy() env['PATH'] = f"{self.python_exe.parent}:{env['PATH']}" - # Use uvicorn CLI from venv to run the app + # Use uvicorn CLI from project root with full module path (backend.main:app) with open(backend_log, 'w') as log_f: self.backend_process = subprocess.Popen( [ str(self.python_exe), "-m", "uvicorn", - "main:app", + "backend.main:app", "--host", "0.0.0.0", "--port", str(self.backend_port), "--log-level", self.log_level ], - cwd=str(backend_dir), + cwd=str(self.root_dir), stdout=log_f, stderr=subprocess.STDOUT, env=env,