Skip to content

Mayank-Garg7/dsa_visualizer_lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿง  DSA Visualizer โ€“ Algorithm Learning Lab

A full-stack interactive Data Structures & Algorithms visualizer that helps users understand how sorting algorithms work step-by-step using real-time animations.

Built using:

  • โš›๏ธ React (Vite + Tailwind CSS)
  • ๐Ÿš€ FastAPI (Python backend)
  • ๐Ÿ“Š Algorithm step-engine (custom implementation)

โœจ Features

๐ŸŽฏ Core Features

  • Step-by-step visualization of sorting algorithms
  • Bubble Sort, Merge Sort, Quick Sort support
  • Real-time animation of comparisons and swaps
  • Step counter + progress tracking
  • Algorithm selector (dropdown)

๐ŸŽฎ Controls System

  • โ–ถ๏ธ Play / โธ Pause animation
  • ๐ŸŽš Speed control slider
  • ๐Ÿ”„ Step-by-step navigation
  • ๐Ÿš€ Start sorting button

๐Ÿ“Š Educational Features

  • Current operation display (comparison/swapping)
  • Step counter (e.g., Step 5 of 24)
  • Visual highlighting of active elements
  • Big-O friendly structure (for teaching)

๐Ÿ—๏ธ Tech Stack

Frontend

  • React (Vite)
  • Tailwind CSS
  • JavaScript (ES6+)

Backend

  • FastAPI
  • Python 3
  • Custom sorting algorithm engine

๐Ÿ“ Project Structure


visualizer-frontend/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ Visualizer.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ Controls.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ Bar.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ StatsPanel.jsx
โ”‚   โ”‚   โ””โ”€โ”€ ActionDisplay.jsx
โ”‚   โ””โ”€โ”€ pages/

visualizer_backend/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ api/routes/
โ”‚   โ”‚   โ””โ”€โ”€ sorting.py
โ”‚   โ””โ”€โ”€ algorithms/
โ”‚       โ”œโ”€โ”€ sorting.py
โ”‚       โ”œโ”€โ”€ merge_sort.py
โ”‚       โ””โ”€โ”€ quick_sort.py


๐Ÿš€ How to Run the Project

1๏ธโƒฃ Backend (FastAPI)

cd visualizer_backend
python -m venv venv
venv\Scripts\activate   # (Windows)
# source venv/bin/activate (Mac/Linux)

pip install fastapi uvicorn
uvicorn app.main:app --reload

Backend runs at:

http://127.0.0.1:8000

2๏ธโƒฃ Frontend (React)

cd visualizer-frontend
npm install
npm run dev

Frontend runs at:

http://localhost:5173

๐Ÿ”— API Endpoints

Algorithm Endpoint
Bubble Sort /sort/bubble
Merge Sort /sort/merge
Quick Sort /sort/quick

๐Ÿง  Learning Outcomes

This project demonstrates:

  • Algorithm visualization techniques
  • Step-based state management
  • Full-stack API integration
  • React component architecture
  • Real-time UI updates
  • Educational UX design for DSA concepts

๐Ÿ“ธ UI Preview

just saved

๐Ÿ”ฅ Future Improvements

  • Pathfinding visualizer (Dijkstra, BFS, DFS)
  • Array generator (random + custom input)
  • Sound effects for swaps
  • Comparison counter (Big-O visualization)
  • Export animation as GIF/video

๐Ÿ‘จโ€๐Ÿ’ป Author

Built by Mayank Garg a Python + Frontend Developer focused on:

  • DSA teaching tools
  • Full-stack development
  • Interactive learning systems

โญ If you like this project

Give it a star โญ and feel free to fork it!


๐Ÿณ docker-compose.yml

version: "3.9"

services:

  backend:
    build: ./visualizer_backend
    ports:
      - "8000:8000"
    volumes:
      - ./visualizer_backend:/app
    command: uvicorn app.main:app --host 0.0.0.0 --reload

  frontend:
    build: ./visualizer-frontend
    ports:
      - "5173:5173"
    volumes:
      - ./visualizer-frontend:/app
    command: npm run dev

About

A full-stack interactive DSA Visualizer built with React (Vite + Tailwind) & FastAPI. It visually demonstrates how sorting algorithms (Bubble, Merge, Quick Sort) work step-by-step with real-time animations, play/pause controls, and speed adjustment. Designed as an educational tool to help students understand Data Structures & Algorithms by visuals.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors