Skip to content

algoscope-hq/AlgoScope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

566 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
AlgoScope Logo

AlgoScope

A modern, interactive algorithm visualizer that demystifies complex logic through real-time, high-fidelity animations.

React Node.js Vite Tailwind CSS License: MIT PRs Welcome GSSoC'26 Docker Hub Discord

Join our community for updates and support!

🌐 Live Demo

Experience AlgoScope in your browser: algo-scope-virid.vercel.app

Core Maintainers

adityapaul26
@adityapaul26
Follow adityapaul26
Bimbok
@Bimbok
Follow Bimbok

Click a profile or follow badge for updates and to connect with the team.


πŸ’‘ Project Purpose

Learning Data Structures and Algorithms (DSA) is often a daunting task for students and developers. Traditional resources like static pseudocode and textbooks fail to capture the dynamic nature of algorithms.

AlgoScope bridges this gap by providing a hands-on environment where users can watch the flow behind every operation. By transforming abstract logic into fluid animations, AlgoScope helps users build a mental model of how algorithms actually work, making the learning process intuitive, engaging, and accessible.


✨ Features

Feature Description
Real-time Visualization Watch algorithms come alive with smooth, step-by-step animations using Framer Motion and Anime.js.
Adjustable Speed Full control over animation speed with +/- precision buttons and input data to learn at your own pace.
Algorithm Coverage Support for Sorting (Quick, Merge, Shell), Searching (Linear, Binary), Graph (BFS, DFS, Dijkstra), and Dynamic Programming (Kadane's, Moore's).
Comparison Mode Side-by-side visualization of multiple algorithms to compare their efficiency and execution patterns in real-time.
Code Insights See implementations in C++, Java, Python, and JS with a multi-language viewer and one-click copy functionality.
Complexity Analysis Interactive performance graphs and complexity cards to visualize Big O notations and scaling behavior.
URL Persistence Shareable links that preserve the current algorithm state and parameters using URL search params.
Interactive Playground Create custom inputs, change array sizes, and interact directly with the canvas.
Secure & Modern UI Dark-themed interface built with Tailwind CSS v4, featuring Clerk authentication and modal-based search.

πŸ› οΈ Tech Stack

Frontend

Backend

Utilities


πŸš€ Quick Start

Follow these steps to set up AlgoScope locally on a clean machine:

Prerequisites

Setup Steps

# 1. Clone the repository
git clone https://github.com/algoscope-hq/AlgoScope.git
cd AlgoScope

# 2. Install dependencies
npm install

# 3. Configure Environment Variables
# Create a .env file from the example
cp .env.example .env
# Open .env and add your VITE_CLERK_PUBLISHABLE_KEY from Clerk Dashboard

# 4. Start the development server
npm run dev

Open http://localhost:5173/ in your browser to start exploring.

Docker Quick Start

If you have Docker installed, you can pull and run the pre-built image:

# 1. Pull the image
docker pull bimbok/algoscope-app:latest

# 2. Run the container
docker run -d -p 8080:80 bimbok/algoscope-app:latest

Access the app at http://localhost:8080.


πŸ—οΈ Architecture

AlgoScope uses a component-based architecture where each algorithm category has its own specialized visualizer:

api/
β”œβ”€β”€ index.js               # Backend entry point (Express)
└── vercel.json            # Vercel deployment configuration
src/
β”œβ”€β”€ algorithms/
β”‚   β”œβ”€β”€ kadane/            # Kadane's Algorithm step generator
β”‚   β”œβ”€β”€ mooreVoting/       # Moore Voting Algorithm step generator
β”‚   β”œβ”€β”€ searching/         # Search and shortest-path step generators/source data
β”‚   └── sorting/           # Sorting algorithm step generators
β”œβ”€β”€ assets/                # Static images and icons
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ about/             # About page cards and sections
β”‚   β”œβ”€β”€ arraySearch/       # Linear and binary search visualizers
β”‚   β”œβ”€β”€ dataStructures/    # Stack, queue, and tree visualizers
β”‚   β”œβ”€β”€ kadaneAlgo/        # Kadane's Algorithm visualizers
β”‚   β”œβ”€β”€ mooreVotingAlgo/   # Moore Voting Algorithm visualizers
β”‚   β”œβ”€β”€ searchAlgo/        # Graph traversal visualizers and controls
β”‚   β”œβ”€β”€ shortestPathAlgo/  # Shortest-path visualizers and controls
β”‚   β”œβ”€β”€ sortingAlgo/       # Sorting visualizers
β”‚   └── visualizer/        # Shared code panel and playback helpers
β”œβ”€β”€ App.jsx                # Main routing and global state management
β”œβ”€β”€ App.css                # App-level styles
β”œβ”€β”€ input.css              # Tailwind entry styles
└── main.jsx               # React entry point

How It Works

  1. State Management: React state tracks the current progress of the algorithm (e.g., current indices being compared).
  2. Animation Engine: Framer Motion and Anime.js handle the transitions based on state changes.
  3. Pseudo-code Sync: The CodeDisplay component highlights lines of code in real-time as the algorithm executes.

System Data Flow

flowchart TD
    user[User]
    subgraph UI
        input_handler((1.0 Manage User Interactions))
        vis_renderer((4.0 Visualize State Changes))
    end
    subgraph Logic
        algorithm_engine((2.0 Execute Algorithms))
        state_manager((3.0 Manage System State))
    end

    %% Data Flows
    user -- Select Algorithm, Speed, Parameters --> input_handler
    input_handler -- Start/Stop/Control Commands --> algorithm_engine
    input_handler -- Initialize/Reset State --> state_manager

    algorithm_engine -- Read Current State --> state_manager
    algorithm_engine -- Step-by-Step Updates (Array/Graph) --> state_manager

    state_manager -- Current State Data --> vis_renderer

    vis_renderer -- Animated Visual Output & Feedback --> user
    vis_renderer -- Visualization Completed/Status --> input_handler
Loading

User Workflow & Execution Logic

flowchart TD
    %% Node Definitions
    Start((Start))
    End((End))

    %% User Actions
    NavCategory["Navigate to Algorithm Category<br>(e.g., Sorting, Graph)"]
    SelectAlgo["Select Specific Algorithm<br>(e.g., Dijkstra, Quick Sort)"]
    SetConfig{"Configure Data & Parameters"}
    SetNodes["Select Source & Target Nodes"]
    SetArray["Generate or Input Array Elements"]
    SetSpeed["Adjust Visualization Speed Slider"]
    ClickStart(["Click 'Start' Button"])

    %% System Validation & Setup
    ValidateInput{"Are Inputs Valid?<br>(e.g., Nodes selected?)"}
    ShowError["Display Warning / Prompt User"]
    InitState["Initialize Algorithm State<br>(Clear highlights, reset vars)"]

    %% Execution Loop
    CheckDone{"Is Algorithm<br>Complete?"}
    ExecStep["Compute Next Algorithmic Step<br>(e.g., Compare, Swap, Traverse)"]
    UpdateState["Update Internal Data State"]
    RenderVis["Render Visual Updates via D3/React<br>(Highlight active elements)"]

    %% Playback Control
    CheckPause{"Is Execution<br>Paused?"}
    WaitResume["Wait for User to click Resume"]
    ApplyDelay["Apply Delay based on Speed Slider"]

    %% Completion
    ShowFinal["Render Final State<br>(Highlight Shortest Path / Sorted Array)"]
    ShowStats["Update Status Display<br>(Time taken, Steps completed)"]

    %% Flow logic
    Start --> NavCategory
    NavCategory --> SelectAlgo
    SelectAlgo --> SetConfig

    SetConfig -->|Graph Algorithms| SetNodes
    SetConfig -->|Array Algorithms| SetArray

    SetNodes --> SetSpeed
    SetArray --> SetSpeed
    SetSpeed --> ClickStart

    ClickStart --> ValidateInput
    ValidateInput -->|No| ShowError
    ShowError --> SetConfig

    ValidateInput -->|Yes| InitState
    InitState --> CheckDone

    %% The main visualization loop
    CheckDone -->|No| ExecStep
    ExecStep --> UpdateState
    UpdateState --> RenderVis
    RenderVis --> CheckPause

    CheckPause -->|Yes| WaitResume
    WaitResume --> CheckPause

    CheckPause -->|No| ApplyDelay
    ApplyDelay --> CheckDone

    %% Algorithm Finished
    CheckDone -->|Yes| ShowFinal
    ShowFinal --> ShowStats
    ShowStats --> End

    %% Styling for clarity
    classDef userAction fill:#2d3748,stroke:#4fd1c5,stroke-width:2px,color:#fff;
    classDef systemAction fill:#1a202c,stroke:#63b3ed,stroke-width:2px,color:#fff;
    classDef decision fill:#2b6cb0,stroke:#90cdf4,stroke-width:2px,color:#fff;

    class NavCategory,SelectAlgo,SetNodes,SetArray,SetSpeed,ClickStart,WaitResume userAction;
    class InitState,ExecStep,UpdateState,RenderVis,ApplyDelay,ShowFinal,ShowStats,ShowError systemAction;
    class SetConfig,ValidateInput,CheckDone,CheckPause decision;
Loading

Star History

Star History Chart

🀝 Contributing

We welcome contributions! Whether it's a bug fix, a new algorithm visualization, or a UI improvement, your help is appreciated.

  1. Fork the repo and create your branch from main.
  2. Setup locally following the Quick Start guide.
  3. Commit your changes with descriptive messages.
  4. Open a Pull Request and describe your changes in detail.

For more detailed guidelines, please refer to our Contribution Guidelines and Code of Conduct.


✨ Contributors

Thanks goes to these wonderful people who have contributed to AlgoScope:

AlgoScope Contributors

πŸ“ž Contact

If you have any questions or want to discuss a contribution, feel free to reach out:


πŸ“„ License

Released under the MIT License.

Made with ❀️ for the DSA community.

About

A modern, interactive algorithm visualizer that demystifies complex logic through real-time, high-fidelity animations.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages