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
- Install dependencies:
npm install - Run the development server:
npm run dev - 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