diff --git a/smartassist/src/startservices.py b/smartassist/src/startservices.py new file mode 100644 index 0000000..76e94c0 --- /dev/null +++ b/smartassist/src/startservices.py @@ -0,0 +1,23 @@ +# Start all services +import subprocess +import threading + +from backend import run_flask + +def start_frontend(): + try: + # Start frontend (web server) as a separate process + subprocess.Popen(["python", "-m", "http.server", "8000"]) + except Exception as e: + print(f"Failed to start frontend: {e}") + +def start_backend(): + try: + # Start backend as a separate thread + threading.Thread(target=run_flask).start() + except Exception as e: + print(f"Failed to start backend: {e}") + +if __name__ == '__main__': + start_backend() + start_frontend()