Thank you for your interest in contributing to AlgoViz! This project aims to make learning algorithms intuitive and accessible through high-quality visualizations.
We welcome contributions of all kinds: from fixing typos in explanations to building complex new visualizations.
- Static & Performance-First: The site is a static export. Keep client-side JS to a minimum.
- Schema-Driven: All problems must follow the strict TypeScript schema in
src/data/schema.ts. - Visualization Primitives: Whenever possible, use existing components in
src/components/visualizations/_base/.
src/data/problems/: Metadata and code snippets for each problem.src/components/visualizations/: Animated React components for specific problems.src/content/problems/: MDX-based explanations and prose.src/lib/viz-engine/: Core logic for visualization playback (useVizStepper).
- Node.js 18+
bunornpm
git clone https://github.com/sh20RAJ/codevisualiser.git
cd algo-viz
npm installnpm run devOpen http://localhost:3000 to see the site.
Adding a problem requires a 3-step process. Each problem is identified by a unique slug (e.g., two-sum).
Create src/data/problems/<slug>.ts. Follow the Problem interface. Define at least two approaches (if applicable) and provide code in both TypeScript and Python.
Create src/components/visualizations/<slug>/index.tsx.
- Use the
useVizStepperhook for controls. - Use
ArrayVizfor any array-based animations. - Ensure the component is responsive.
Create src/content/problems/<slug>.mdx.
- Explain the intuition behind the approaches.
- Embed your visualization component:
import { YourViz } from '../../components/visualizations/your-slug'; <YourViz ... />
Register your new problem in:
src/data/problems/index.tssrc/content/problems/index.tsx
- Create a new branch:
feat/add-<slug>. - Ensure your code passes linting:
npm run lint. - Verify the production build:
npm run build. - Submit a PR with a description of what you've added.
If you are an AI coding assistant, please refer to AGENTS.md for specialized instructions.