#!/usr/bin/env python3 """ Smeta Railway — unified web server. Serves: - /api/wizard/* — xlsx aggregation wizard - /api/chat/* — GESN search, questions, NR/SP lookup - /api/gen/* — estimate generation pipeline - /* — static files (index.html with tabs) Usage: python scripts/wizard_server.py # Open http://localhost:8102 """ import sys from pathlib import Path # Ensure src/ is on path sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "src")) from fastapi import FastAPI from fastapi.staticfiles import StaticFiles from smeta_railway.web.wizard_api import router as wizard_router from smeta_railway.web.chat_api import router as chat_router from smeta_railway.web.generator_api import router as gen_router app = FastAPI(title="Smeta Railway") # API routers app.include_router(wizard_router, prefix="/api/wizard") app.include_router(chat_router, prefix="/api/chat") app.include_router(gen_router, prefix="/api/gen") # Serve static files (index.html, wizard.html) static_dir = Path(__file__).resolve().parent.parent / "static" app.mount("/", StaticFiles(directory=str(static_dir), html=True), name="static") if __name__ == "__main__": import uvicorn uvicorn.run(app, host="0.0.0.0", port=8102)