This project is a browser-based implementation of the A* (A-Star) pathfinding algorithm using a grid-based interface. It allows users to visually set a starting point, an endpoint, and obstacles, and then computes the shortest path using the A* algorithm.
The application is built with a Flask backend in Python and a frontend developed using HTML, CSS, and JavaScript. Communication between the frontend and backend is handled through a REST API.
- Interactive 10×10 grid layout
- Click-to-set interface for:
- Start node (green)
- End node (red)
- Obstacles (black)
- Visual display of the shortest path (yellow)
- Backend implemented in Python using Flask
- Cross-Origin Resource Sharing (CORS) enabled for seamless local development
- Easily extendable and modular architecture
- Python 3.x
- A modern web browser (e.g., Chrome, Firefox, Edge)
-
Navigate to the backend directory:
cd backend -
Create and activate a virtual environment:
Windows:
python -m venv venv venv\Scripts\activate
macOS/Linux:
python3 -m venv venv source venv/bin/activate -
Install the required dependencies:
pip install flask flask-cors
-
Start the Flask server:
python model.py
The server will run at:
http://127.0.0.1:5000
-
Navigate to the
frontend/directory:cd ../frontend -
Open the
index.htmlfile in your browser by:- Double-clicking the file, or
- Using the Live Server extension in VS Code
- Click once to place the start node (green).
- Click again to place the end node (red).
- Continue clicking to place obstacles (black cells).
- Click "Find Path" to visualize the computed shortest path.
- Click "Reset" to clear and start over.
This project is open-source and available under the MIT License.
Developed by Ahmad jamil — AI and Web Developer
Contact: shazabjamildhami@gmail.com

