VisualX

November 9, 2025 ยท View on GitHub

An interactive platform to visualize algorithms step-by-step. Built with Next.js, this project helps developers understand data structures and algorithms through smooth, real-time animations and detailed performance metrics.

Getting Started

  1. Install dependencies: npm install
  2. Run the development server: npm run dev
  3. Open http://localhost:9002 to start exploring algorithms

Features

  • Interactive Visualizations: Watch algorithms in action with smooth animations
  • Custom Data Input: Test algorithms with your own datasets
  • Performance Metrics: Real-time analysis of time/space complexity and operation counts
  • Multiple Algorithm Categories: Sorting, searching, and graph algorithms

Project Structure

VisualX/
โ”œโ”€โ”€ ๐Ÿ“ src/                           # Source code
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ ai/                        # AI & GenKit Integration
โ”‚   โ”‚   โ”œโ”€โ”€ dev.ts                    # Development GenKit server
โ”‚   โ”‚   โ””โ”€โ”€ genkit.ts                 # GenKit configuration
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ app/                       # Next.js App Router
โ”‚   โ”‚   โ”œโ”€โ”€ globals.css               # Global styles
โ”‚   โ”‚   โ”œโ”€โ”€ layout.tsx                # Root layout component
โ”‚   โ”‚   โ”œโ”€โ”€ page.tsx                  # Homepage
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“ algorithms/            # Algorithm pages
โ”‚   โ”‚       โ”œโ”€โ”€ ๐Ÿ“ graph/             # Graph algorithms
โ”‚   โ”‚       โ”‚   โ””โ”€โ”€ page.tsx
โ”‚   โ”‚       โ”œโ”€โ”€ ๐Ÿ“ searching/         # Search algorithms
โ”‚   โ”‚       โ”‚   โ””โ”€โ”€ page.tsx
โ”‚   โ”‚       โ””โ”€โ”€ ๐Ÿ“ sorting/           # Sorting algorithms
โ”‚   โ”‚           โ””โ”€โ”€ page.tsx
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ components/                # React Components
โ”‚   โ”‚   โ”œโ”€โ”€ logo.tsx                  # VisualX logo component
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ layout/                # Layout components
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ sidebar-content.tsx   # Sidebar navigation
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ ui/                    # Reusable UI components (Radix + Tailwind)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ accordion.tsx         # Accordion component
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ alert-dialog.tsx      # Alert dialog
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ alert.tsx             # Alert notifications
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ avatar.tsx            # Avatar component
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ badge.tsx             # Badge/label component
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ button.tsx            # Button component
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ calendar.tsx          # Calendar picker
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ card.tsx              # Card container
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ carousel.tsx          # Image carousel
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ chart.tsx             # Chart/graph component
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ checkbox.tsx          # Checkbox input
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ collapsible.tsx       # Collapsible sections
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ dialog.tsx            # Modal dialogs
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ dropdown-menu.tsx     # Dropdown menus
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ form.tsx              # Form components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ input.tsx             # Text input
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ label.tsx             # Form labels
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ menubar.tsx           # Menu bar
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ popover.tsx           # Popover component
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ progress.tsx          # Progress bar
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ radio-group.tsx       # Radio button group
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ scroll-area.tsx       # Scrollable area
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ select.tsx            # Select dropdown
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ separator.tsx         # Visual separator
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ sheet.tsx             # Slide-out sheet
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ sidebar.tsx           # Sidebar component
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ skeleton.tsx          # Loading skeleton
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ slider.tsx            # Range slider
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ switch.tsx            # Toggle switch
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ table.tsx             # Data table
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ tabs.tsx              # Tab navigation
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ textarea.tsx          # Multi-line input
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ toast.tsx             # Toast notifications
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ toaster.tsx           # Toast container
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ tooltip.tsx           # Hover tooltips
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“ visualizer/            # Algorithm visualization components
โ”‚   โ”‚       โ”œโ”€โ”€ code-panel.tsx        # Code display panel
โ”‚   โ”‚       โ”œโ”€โ”€ color-legend.tsx      # Color coding legend
โ”‚   โ”‚       โ”œโ”€โ”€ controls.tsx          # Playback controls
โ”‚   โ”‚       โ”œโ”€โ”€ data-form.tsx         # Data input form
โ”‚   โ”‚       โ”œโ”€โ”€ graph-canvas.tsx      # Graph visualization canvas
โ”‚   โ”‚       โ”œโ”€โ”€ graph-visualizer.tsx  # Graph algorithm visualizer
โ”‚   โ”‚       โ”œโ”€โ”€ metrics-panel.tsx     # Performance metrics display
โ”‚   โ”‚       โ”œโ”€โ”€ search-canvas.tsx     # Search visualization canvas
โ”‚   โ”‚       โ”œโ”€โ”€ searching-visualizer.tsx # Search algorithm visualizer
โ”‚   โ”‚       โ”œโ”€โ”€ sorting-visualizer.tsx   # Sorting algorithm visualizer
โ”‚   โ”‚       โ””โ”€โ”€ visualization-canvas.tsx # General visualization canvas
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ hooks/                     # Custom React hooks
โ”‚   โ”‚   โ”œโ”€โ”€ use-mobile.tsx            # Mobile detection hook
โ”‚   โ”‚   โ””โ”€โ”€ use-toast.ts              # Toast notification hook
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ ๐Ÿ“ lib/                       # Utility libraries
โ”‚       โ”œโ”€โ”€ placeholder-images.json   # Placeholder image data
โ”‚       โ”œโ”€โ”€ placeholder-images.ts     # Image utilities
โ”‚       โ”œโ”€โ”€ utils.ts                  # General utilities
โ”‚       โ””โ”€โ”€ ๐Ÿ“ algorithms/            # Algorithm implementations
โ”‚           โ”œโ”€โ”€ graph.ts              # Graph algorithms (BFS, DFS, Dijkstra)
โ”‚           โ”œโ”€โ”€ graph_backup.ts       # Backup graph algorithms
โ”‚           โ”œโ”€โ”€ searching.ts          # Search algorithms (Binary, Linear)
โ”‚           โ”œโ”€โ”€ sorting.ts            # Sorting algorithms (Bubble, Quick, Merge, etc.)
           โ””โ”€โ”€ types.ts              # Algorithm type definitions
โ”‚

โ”œโ”€โ”€ ๐Ÿ“ .github/                       # GitHub configuration
โ”œโ”€โ”€ ๐Ÿ“ .next/                         # Next.js build output
โ”œโ”€โ”€ ๐Ÿ“ .nyc_output/                   # Coverage output
โ”œโ”€โ”€ ๐Ÿ“ .scannerwork/                  # SonarQube analysis
โ”œโ”€โ”€ ๐Ÿ“ coverage/                      # Test coverage reports
โ”œโ”€โ”€ ๐Ÿ“ metrics-report/                # Code metrics
โ”œโ”€โ”€ ๐Ÿ“ node_modules/                  # Dependencies
โ”œโ”€โ”€ ๐Ÿ“ plato-report/                  # Code complexity reports
โ”œโ”€โ”€ ๐Ÿ“ playwright-report/             # Playwright test reports
โ”œโ”€โ”€ ๐Ÿ“ test-results/                  # Test execution results
โ”‚
โ”œโ”€โ”€ ๐Ÿ“„ .gitignore                     # Git ignore rules
โ”œโ”€โ”€ ๐Ÿ“„ components.json                # UI component configuration
โ”œโ”€โ”€ ๐Ÿ“„ next-env.d.ts                  # Next.js TypeScript declarations
โ”œโ”€โ”€ ๐Ÿ“„ next.config.ts                 # Next.js configuration
โ”œโ”€โ”€ ๐Ÿ“„ package.json                   # Project dependencies & scripts
โ”œโ”€โ”€ ๐Ÿ“„ package-lock.json              # Dependency lock file
โ”œโ”€โ”€ ๐Ÿ“„ postcss.config.mjs             # PostCSS configuration
โ”œโ”€โ”€ ๐Ÿ“„ README.md                      # Project documentation
โ”œโ”€โ”€ ๐Ÿ“„ sonar-project.properties       # SonarQube configuration
โ”œโ”€โ”€ ๐Ÿ“„ SONARQUBE_ZERO_ERROR_STRATEGY.md # SonarQube guidelines
โ”œโ”€โ”€ ๐Ÿ“„ tailwind.config.ts             # Tailwind CSS configuration
โ”œโ”€โ”€ ๐Ÿ“„ tsconfig.json                  # TypeScript configuration
โ””โ”€โ”€ ๐Ÿ“„ tsconfig.tsbuildinfo           # TypeScript build cache

Development

Scripts

  • Development: npm run dev - Start development server on port 9002
  • Build: npm run build - Build production application
  • Type Check: npm run typecheck - Run TypeScript type checking
  • Lint: npm run lint - Run ESLint code analysis
  • GenKit Development: npm run genkit:dev - Start GenKit AI development server
  • GenKit Watch: npm run genkit:watch - Start GenKit with auto-reload

Testing

  • Run Tests: npm test - Execute Playwright E2E tests
  • Headed Tests: npm run test:headed - Run tests with browser UI
  • Debug Tests: npm run test:debug - Debug tests interactively

Key Files

  • Entry Point: src/app/page.tsx - Application homepage
  • Algorithm Logic: src/lib/algorithms/ - Core algorithm implementations
  • Visualizers: src/components/visualizer/ - Interactive visualization components
  • UI Components: src/components/ui/ - Reusable interface elements

Technology Stack

  • Framework: Next.js 15 with App Router
  • Language: TypeScript
  • Styling: Tailwind CSS + Radix UI primitives
  • Testing: Playwright (E2E), SonarQube (Code Quality)
  • AI Integration: Google GenKit for AI-assisted features
  • Animations: Framer Motion
  • Icons: Lucide React
  • Charts: Recharts for performance visualization

Architecture

Algorithm Implementation Pattern

Each algorithm follows a consistent structure:

const algorithmInfo: AlgorithmInfo = {
  name: "Algorithm Name",
  description: "Clear description",
  complexity: { time: { best: "O(n)", average: "O(nยฒ)", worst: "O(nยฒ)" }, space: "O(1)" },
  pseudocode: ["Step 1", "Step 2", "..."]
};

const generateSteps = (input: InputType): StepType[] => {
  // Algorithm implementation that generates visualization steps
  return steps;
};

Component Hierarchy

  • Page Components โ†’ Visualizer Components โ†’ Canvas Components โ†’ UI Primitives
  • Algorithm Libraries โ†’ Step Generation โ†’ Visualization Rendering