from fastapi import FastAPI
from fastapi.responses import HTMLResponse
app = FastAPI()
HTML_CONTENT = r"""
Paste your broken SQL below
🏆 Hackathon Score Meter
Cumulative Score
0.00
0ParticipantGoodFinalist🏉 Winner
Broken SQL (from challenge)
Fixed SQL Output
-- Fixed SQL will appear here after running ⚡
Session Log
🟢 Ready — select difficulty and click RUN FIX & SCORE
Detected Issues
- No issues detected yet — run a fix to analyse SQL.
"""
@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()