from fastapi import FastAPI from fastapi.responses import HTMLResponse app = FastAPI() HTML_CONTENT = r""" SQL Debugger & Optimizer

SQL Debugger & Optimizer

RL Environment · OpenEnv Protocol
v1.0.0
Paste your broken SQL below
Fix Explanation (boosts score)
🏆 Hackathon Score Meter
Cumulative Score 0.00
0ParticipantGoodFinalist🏉 Winner
Last Reward
0
Total Score
0
Runs
Best Reward
0%
Win Rate
Broken SQL (from challenge)
Fixed SQL Output
-- Fixed SQL will appear here after running ⚡
Score Progress
Reward History
Difficulty Breakdown
Session Log
🟢 Ready — select difficulty and click RUN FIX & SCORE
Detected Issues
""" @app.get("/", response_class=HTMLResponse) async def root(): return HTMLResponse(content=HTML_CONTENT) @app.post("/reset") async def reset(): """Called by frontend Reset button to acknowledge session wipe.""" return {"status": "reset", "message": "Session reset successfully"} @app.get("/health") async def health(): return {"status": "ok"} def main(): import uvicorn uvicorn.run("server.app:app", host="0.0.0.0", port=7860) if __name__ == "__main__": main()