Connect backend and frontend for Social Golfers Problem#1
Connect backend and frontend for Social Golfers Problem#1
Conversation
- Create `src/core/server.py` to serve the frontend and expose `/api/solve`. - Update `src/wwwroot/js/showOutput.js` to fetch results from the API. - Add instructions to `README.md`. - Add `tests/verify_frontend.py` for verification. Co-authored-by: Roiqk7 <112021405+Roiqk7@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Create `src/core/server.py` using FastAPI to serve the frontend and expose `/api/solve`. - Update `src/wwwroot/js/showOutput.js` to communicate with the API. - Add `Dockerfile` to build the environment, compile the solver, and run the app. - Add `docker-compose.yml` to orchestrate the container on port 4200. - Update `README.md` with Docker usage instructions. - Add `tests/verify_frontend.py` for verification. - Configure `.gitignore` to exclude runtime data and binary artifacts. Co-authored-by: Roiqk7 <112021405+Roiqk7@users.noreply.github.com>
- Create `src/core/server.py` using FastAPI to serve the frontend and expose `/api/solve`. - Update `src/wwwroot/js/showOutput.js` to communicate with the API. - Add `Dockerfile` to build the environment, patch and compile the solver, and run the app. - Add `docker-compose.yml` to orchestrate the container on port 4200. - Update `README.md` with Docker usage instructions. - Add `tests/verify_frontend.py` for verification. - Configure `.gitignore` to exclude runtime data and binary artifacts. Co-authored-by: Roiqk7 <112021405+Roiqk7@users.noreply.github.com>
This PR connects the existing Python SAT solver backend to the HTML/JS frontend using a FastAPI server.
Changes:
src/core/server.py): Implements a FastAPI application that serves static files fromsrc/wwwrootand provides a POST endpoint/api/solve. The endpoint wraps the existingProblemInstance,SolverHandler, andEncapsulatorlogic, using a global lock to ensure safe serial execution due to file-based dependencies.src/wwwroot/js/showOutput.js): Modifies the event listener to send user input to the/api/solveendpoint and display the returned schedule or error message.README.md): Adds instructions for installing dependencies and running the web server.tests/verify_frontend.py): Adds a Playwright script to verify the end-to-end functionality.Dependencies added:
fastapi,uvicorn. The glucose solver must be compiled as per existing instructions.PR created automatically by Jules for task 1418628949968445824 started by @Roiqk7