Skip to main content

Documentation 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.

AVL Tree Car Backend is the server-side engine powering the ATC car simulation project. It exposes a REST API and a real-time Socket.IO interface to create, manage, and traverse an AVL self-balancing binary search tree whose nodes represent road obstacles — giving the frontend everything it needs to animate a car dodging hazards along a track.

Quickstart

Clone, install dependencies, and have the server running in under five minutes.

Project Structure

Understand how routers, controllers, models, sockets, and utilities fit together.

AVL Tree Concepts

Learn how the AVL tree is implemented — rotations, balance factors, and traversals.

API Reference

Full documentation for every REST endpoint and Socket.IO event.

What It Does

The backend manages a single shared AVLTree instance whose nodes store Obstacle objects (position x, y, and type). Every insert and delete automatically rebalances the tree using LL, RR, LR, and RL rotations so that lookups stay O(log n) regardless of insertion order.

REST API

Add or remove obstacles and bulk-load simulation configs over HTTP.

Socket.IO

Subscribe to live tree updates and stream traversal results in real time.

Traversals

Inorder, preorder, and posorder walks emitted node-by-node to the frontend.

Getting Started

1

Clone the repository

git clone https://github.com/tutosrive/avl_tree_car.git
cd avl_tree_car
2

Install Python dependencies

pip install -r requirements.txt
3

Start the server

python run.py
The server listens on http://localhost:4500.
4

Connect your frontend

Point the ATC Frontend at http://localhost:4500 and start the simulation.
This repository is the backend only. The frontend lives at avl_tree_car_front and must be set up separately.

Build docs developers (and LLMs) love