feat: Add AI-Powered Visual Mind Map Generator with reactflow and supabase#72
feat: Add AI-Powered Visual Mind Map Generator with reactflow and supabase#72diyamajee-spec wants to merge 1 commit into
Conversation
|
@diyamajee-spec is attempting to deploy a commit to the prabhakarshukla's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Thanks for the contribution. @diyamajee-spec I tested the Mind Maps feature locally. Mind map generation, node inspection, save/load functionality, and React Flow rendering are working correctly. |
|
@diyamajee-spec please update the PR ASAP |
|
I will do it by tonight |
Done ?? |
|
@diyamajee-spec hi, I'm the mentor for this project. If you need any help, please lmk |

💡 Context & Problem Statement
EduFlow-AI excels at generating structured text markdown for course content, summaries, and study planners. However, visual learners often struggle to grasp complex relationships between subtopics when reading linear text. There was no native way for students to dynamically visualize how core concepts connect to their underlying principles.
🚀 Proposed Solution
This PR introduces an AI-Powered Visual Mind Map Generator feature. Instead of outputting standard markdown, a custom AI agent generates a hierarchical representation of a study topic, which the frontend renders into an interactive, zoomable, and draggable concept map.
Key Features:
reactflow.🛠 Technical Implementation Details
1. Database Layer
supabase/migrations/20260613_create_mind_maps.sqlto define themind_mapstable structure (storingnodesandedgesJSONB structures) and configured Row Level Security (RLS) policies so authenticated users only access their own maps.2. AI Backend Agent & Router
lib/ai/agents/mindmap-agent.tswith a specialized system prompt enforcing a strict JSON output structure representing the hierarchy (id,label,parentId,description).lib/ai/agents/shared.tsandlib/ai/agents/agent-router.tsto register the newmindmapagent type.3. API Layer
app/api/mindmap-generator/route.tsto trigger the mindmap agent and parse its JSON output, including utility logic to clean markdown format indicators.4. Frontend Interface
reactflowpackages inpackage.json.app/dashboard/mind-maps/page.tsximplementing custom Tailind-styled glassmorphic node components (CustomNode), map controls, minimap, saved lists explorer, and layout styling matching the EduFlow-AI light/dark mode system.app/dashboard/layout.tsx.5. Build Config Fallbacks
lib/supabase-config.tsto prevent page prerendering from failing if Supabase env variables are not present during Next.js static asset compilation.🧪 Verification & Testing
1. Production Build Successful
Ran
npm run buildto confirm compilation:/dashboard/mind-maps.2. Interactive Verification (Browser Subagent)
/dashboard/mind-mapsinside the browser sandbox./auth/login?next=/dashboard/mind-mapswithout throwing any JavaScript errors or warnings.Closes #52