Welcome to the Tree Visualizer! This full-stack project enables users to visualize and interact with various types of trees dynamically. With a real-time backend powered by PostgreSQL and Supabase, the application integrates GitHub webhooks to track live commits and repository statistics. It also features an intuitive Konva.js canvas for rendering tree visualizations based on user input.
- Dynamic Tree Generation: Generate trees interactively from user-provided arrays, including Binary Search Trees, AVL Trees, and more.
- Real-Time Updates: Stay updated with live commit tracking and repository statistics through GitHub webhooks integrated with Supabase.
- Interactive Visualization: Explore trees visually on a canvas powered by Konva.js, with features like zooming, panning, and node highlights.
- Extensibility: Additional tree types and features are under development to further enhance visualization capabilities.
- Next.js (Framework for React and server-side rendering)
- React (Frontend library)
- TypeScript (Static typing for better code quality)
- Konva.js (Canvas rendering for interactive visualizations)
- Next.js API Routes (Handles all API calls directly within the framework)
- Supabase (PostgreSQL-based real-time backend)
- GitHub Webhooks (Live commit tracking)
- Vercel (For deploying the full Next.js application, including API routes)
Follow the steps below to set up the Tree Visualizer locally.
- Node.js (v14 or later)
- NPM or Yarn
- A Supabase project with database credentials
- A GitHub repository to enable webhooks (optional but recommended)
git clone https://github.com/AlgoFoe/tree-visualizer.git
cd tree-visualizer# Using npm
npm install
# Or using Yarn
yarn installCreate a .env.local file in the root directory and add the following:
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_SERVICE_ROLE_KEY=
NEXT_PUBLIC_SUPABASE_ANON_KEY=npm run devThe application will be accessible at http://localhost:3000.
1. Log in to Supabase and create a new project.
2. Set up a PostgreSQL database.
3. Add tables for commits and other required entities.
4. Retrieve the API URL and anon/public key from the project settings.
1. Navigate to your GitHub repository settings.
2. Go to Webhooks and click Add webhook.
3. Set the payload URL to your deployed backend endpoint (e.g., https://<your-vercel-app>/api/webhook).
4. Add the secret from your .env.local file.
- Visualization for additional tree types, such as:
- B-Trees
- Splay Trees
- Enhanced analytics for commits, including:
- Top Contributors
- Commit Heatmaps
- Exporting tree visualizations as PNG or JSON.
- Animating the insertion and deletion operation
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
This project is licensed under the MIT License - see the LICENSE file for details.