npm run app:startThis starts both backend and frontend simultaneously and opens the dashboard in your browser.
Terminal 1 - Start Backend API:
python run_api.pyTerminal 2 - Start Frontend (Next.js):
cd frontend/as_lp
npm run devThen open: http://localhost:3000
Note: The dashboard now features the "Orbital Command" aesthetic with a deep space starfield, holographic glass panels, and a HUD-style interface.
- Dashboard: http://localhost:3000
- API Base: http://localhost:8000
- Interactive Docs: http://localhost:8000/docs (Swagger UI)
- Alternative Docs: http://localhost:8000/redoc
- Health Check: http://localhost:8000/health
- Metrics: http://localhost:9090/metrics (requires auth)
POST /api/v1/telemetry- Send single telemetry dataPOST /api/v1/telemetry/batch- Send batch telemetry data
GET /api/v1/status- Get system statusGET /api/v1/health- Health check
GET /api/v1/phase- Get current mission phasePOST /api/v1/phase- Update mission phase
GET /api/v1/history/anomalies- Get anomaly detection historyGET /api/v1/memory/stats- Get memory statistics
The frontend automatically connects to the backend using environment variables in .env.local:
NEXT_PUBLIC_API_URL=http://localhost:8000
NEXT_PUBLIC_API_TELEMETRY=/api/v1/telemetry
NEXT_PUBLIC_API_BATCH=/api/v1/telemetry/batch
NEXT_PUBLIC_API_STATUS=/api/v1/status
NEXT_PUBLIC_API_PHASE=/api/v1/phase
NEXT_PUBLIC_API_HISTORY=/api/v1/history/anomalies
NEXT_PUBLIC_API_MEMORY=/api/v1/memory/statsimport { apiClient } from "@/lib/api-client";
import { useSystemStatus, usePhase } from "@/lib/api-hooks";
// Using the client directly
async function checkStatus() {
const status = await apiClient.getStatus();
console.log(status);
}
// Using the hooks
function MyComponent() {
const { status, loading, error } = useSystemStatus();
const { phase } = usePhase();
return (
<div>
{loading ? <p>Loading...</p> : <p>Status: {JSON.stringify(status)}</p>}
</div>
);
}useSystemStatus()- Fetch system statususePhase()- Get current mission phaseuseAnomalyHistory(limit?)- Get anomaly detection historyuseMemoryStats()- Get memory statisticsuseHealthCheck()- Check backend health
- Ensure backend is running:
python run_api.py - Check if port 8000 is available:
netstat -an | findstr :8000 - Verify environment variables in
.env.local
- Check
.env.localfile exists infrontend/as_lp/ - Ensure
NEXT_PUBLIC_API_URL=http://localhost:8000 - Check browser console for CORS errors
- Verify backend is accessible:
curl http://localhost:8000/health
# Kill process on port 8000
netstat -ano | findstr :8000
taskkill /PID <PID> /F
# Kill process on port 3000
netstat -ano | findstr :3000
taskkill /PID <PID> /FAstraGuard-AI/
├── api/ # FastAPI backend service
│ ├── models.py # Request/response models
│ └── service.py # Main API service
├── backend/ # Backend services
│ ├── main.py # Entry point
│ └── recovery_orchestrator.py
├── frontend/
│ └── as_lp/ # Next.js application
│ ├── app/ # App pages and layouts (Next.js 13+)
│ ├── components/ # React components
│ ├── lib/
│ │ ├── api-client.ts # API client utility
│ │ └── api-hooks.ts # React hooks
│ ├── package.json
│ └── .env.local # Environment variables
├── run_api.py # API startup script
├── start-app.js # Complete stack startup
└── package.json # Root scripts
- Start the application:
npm run app:start - Open dashboard: http://localhost:3000
- Explore API: http://localhost:8000/docs
- Send telemetry: Use the frontend or API directly
- Monitor anomalies: View detection history in dashboard
- Backend runs on port 8000
- Frontend runs on port 3000
- Metrics server runs on port 9090
- First-time startup may take 15-20 seconds for dependencies
- CORS is configured to allow frontend requests
export METRICS_USER=your_username
export METRICS_PASSWORD=your_passwordOr add to .env:
METRICS_USER=your_username
METRICS_PASSWORD=your_secure_password