By the end of this guide you’ll have the AVL Tree Car Backend running onDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/tutosrive/avl_tree_car/llms.txt
Use this file to discover all available pages before exploring further.
localhost:4500, have confirmed the root endpoint responds correctly, and have inserted your first obstacle node into the AVL tree — everything the ATC Frontend needs to connect and render a live simulation.
Prerequisites
- Python 3 installed and available on your
PATH(python --versionorpy --versionon Windows) pipavailable for installing packagesgitfor cloning the repository
Setup
Create a virtual environment (optional but recommended)
Isolating dependencies in a virtual environment prevents version conflicts with other Python projects on your machine.Your prompt will change to show
(.venv) when the environment is active.Install dependencies
Install the four required packages from This installs Flask 3.1.2, flask-cors 6.0.1, Flask-SocketIO 5.5.1, and chromologger 0.1.9.post2.
requirements.txt.Start the server
Run the entry-point script to start the Flask + Socket.IO server.The server starts on
localhost:4500. You should see Socket.IO and Flask startup output in your terminal confirming the server is ready to accept connections.The server runs with
debug=True by default (set in run.py). This enables Flask’s auto-reloader and detailed tracebacks. Do not expose this server publicly or use debug=True in any production-like environment.Your first API call
With the server running, insert an obstacle node into the AVL tree by posting toPOST /avl/node/add. The request body requires the obstacle’s road position (x), height (y), and a numeric type identifier (type_id 1–10).
data:
x position, the AVL tree rejects it with ok: false and a 400 status — duplicate x coordinates are not allowed because the tree is keyed on road position.
Bulk-loading with configs.json
Next steps
- Review the full HTTP and Socket.IO endpoint reference in the API Overview.
- Understand how modules are wired together in Project Structure.
- Connect the ATC Frontend to this backend and watch the obstacle simulation run in the browser.