CONNECT JAVASCRIPT, PYTHON AND SQL

This is an actual local program. Unlike the step-by-step teaching diagram,
it makes a real HTTP request to a Python process on your own computer.
It never connects to an external service.

1. Extract the whole companion ZIP. Do not run a file inside the ZIP preview.
2. Open a terminal in visual_studio/examples/integrated_project.
   In an editor, open this folder and then use its terminal command.
3. Check Python is installed: python --version
   On Windows, py --version is an alternative.
4. Run: python server.py --third-enquiries 0
   Windows alternative: py server.py --third-enquiries 0
5. Keep that terminal open. Open http://127.0.0.1:8765 in your browser.
6. Click Load report. Expect EUR 34.44 per enquiry, with 620 cost and 18 enquiries.
7. Stop the server with Ctrl+C in its terminal.
8. Restart with: python server.py --third-enquiries 10
9. Reload the browser page and click Load report. Expect EUR 22.14, 620 and 28.

What each file does:
- index.html: creates the visible page and runs browser JavaScript.
- server.py: receives /api/report, asks SQLite for totals, calculates the rate,
  and returns JSON to JavaScript. The fictional database is recreated in memory
  for the calculation; there is no permanent database file to manage.

If the address fails to open, check that the terminal is still running the
server and that you used http, not https. If port 8765 is already in use,
stop the previous copy of this demonstration and try again.

If you double-click index.html instead, the request will not reach this server.
Open the exact local address above after starting Python.

This minimal learning server listens only on your own computer. It has no
login, production security configuration or persistence; do not publish it as
a production application. No account, key, payment or subscription is needed.
