From 526c8ec005d03b17950e9f5e7fe74208b491dd68 Mon Sep 17 00:00:00 2001 From: kboz Date: Sun, 27 Sep 2026 22:36:36 +0200 Subject: feat(frontend): add guided setup flow for backend bootstrap Poll the backend /api/setup/status and show a Setup screen until data, auth, and backend readiness are confirmed. Remove the manual setup_auth.py and setup_eve_data.py scripts superseded by the automated setup endpoints. --- frontend/src/App.js | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'frontend/src/App.js') diff --git a/frontend/src/App.js b/frontend/src/App.js index 569ff74..af95c63 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -1,18 +1,52 @@ +import React, { useState, useEffect } from 'react'; import './App.css'; import Path from './Path'; import Log from './Log'; import Options from './Options'; import Info from './Info'; +import Setup from './Setup'; function App() { + const [setupStatus, setSetupStatus] = useState(null); + + useEffect(() => { + const checkStatus = async () => { + try { + const resp = await fetch('http://localhost:8000/api/setup/status'); + const rootResp = await fetch('http://localhost:8000/'); + if (resp.ok && rootResp.ok) { + const data = await resp.json(); + const rootData = await rootResp.json(); + data.backend_ready = rootData.ready; + setSetupStatus(data); + if (!rootData.ready) { + setTimeout(checkStatus, 2000); + } + } else { + setTimeout(checkStatus, 2000); + } + } catch (e) { + console.error("Could not reach backend API, retrying in 2s..."); + setTimeout(checkStatus, 2000); + } + }; + checkStatus(); + }, []); + + if (!setupStatus) { + return
Initializing Backend Connection...
; + } + + if (!setupStatus.data_ready || !setupStatus.auth_ready || !setupStatus.backend_ready) { + return window.location.reload()} />; + } + return (
- {/* Main component for Path */}
- {/* Sidebar for route info, controls, and log output */}
-- cgit v1.3