AlgoVisual
- Stars
- 6
- Language
- Astro
- Updated
AlgoVisual
A Digital Garden for Algorithms - An interactive educational website where users can read explanations of algorithms and visualize them in real-time through React components.
š Features
- Interactive Visualizations: Step through sorting algorithms like Bubble Sort with real-time visual feedback
- Content Collections: MDX-powered articles with structured metadata (difficulty, tags, publish date)
- Islands Architecture: React components loaded only where needed for optimal performance
- Type-Safe: Full TypeScript support with Zod schemas for content validation
- Responsive Design: Clean, modern UI with CSS variables for easy theming
- SEO Optimized: Built with Astro for fast static generation and excellent SEO
š Tech Stack
- Framework: Astro (latest version)
- Content: MDX with Content Collections
- Styling: Vanilla CSS with CSS Variables
- Interactivity: TypeScript & React (Islands)
- Package Manager: npm
š Quick Start
Prerequisites
- Node.js (v18 or higher)
- npm
Installation
-
Clone the repository:
git clone https://github.com/Manavarya09/AlgoVisual.git cd AlgoVisual -
Install dependencies:
npm install -
Start the development server:
npm run dev -
Open http://localhost:4321 in your browser.
Build for Production
npm run build
npm run preview
š Project Structure
src/
āāā content/
ā āāā algorithms/
ā ā āāā bubble-sort.mdx # Sample algorithm article
ā āāā config.ts # Content collection schemas
āāā components/
ā āāā Interactive/
ā āāā SortingVisualizer.tsx # React sorting visualizer
āāā layouts/
ā āāā Layout.astro # Main HTML wrapper
āāā pages/
āāā algorithms/
āāā [...slug].astro # Dynamic routing for articles
š Usage
Adding New Algorithms
-
Create a new
.mdxfile insrc/content/algorithms/:--- title: "New Algorithm" difficulty: Medium tags: ['sorting', 'efficient'] publishDate: 2024-01-01 --- # Algorithm Explanation <SortingVisualizer algorithm="New Algorithm" speed={500} client:load /> -
The page will be automatically available at
/algorithms/new-algorithm.
Creating Interactive Components
Components in src/components/Interactive/ are React components that can be used in MDX files:
- Use
client:loaddirective for full interactivity - Props are type-checked with TypeScript
- Components are isolated to prevent unnecessary JavaScript loading
šØ Theming
The project uses CSS variables for easy theming. Modify :root in src/layouts/Layout.astro:
:root {
--bg-color: #ffffff;
--text-color: #000000;
--accent-color: #007acc;
--border-color: #e0e0e0;
}
š¤ Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Content Guidelines
- Use clear, educational language
- Include time/space complexity analysis
- Provide interactive visualizations where possible
- Tag appropriately for discoverability
š License
This project is licensed under the MIT License - see the LICENSE file for details.
š Acknowledgments
Happy learning! š