An interactive learning map that generates visual learning paths for any topic using AI. Built with Next.js, React Flow, and Google's Gemini AI.
- Generate interactive learning paths for any topic
- AI-powered content generation using Google Gemini
- Beautiful, responsive UI with dark/light mode (Controls component from ReactFlow theme issue)
- Zoom and pan functionality for exploring complex maps
- Mobile-friendly design with touch support
- Expandable nodes to dive deeper into subtopics (beta)
- Frontend: Next.js, React, TypeScript
- UI: Tailwind CSS, Shadcn UI (Lucide-react for icons)
- Visualization: React Flow
- AI: Google Gemini API
- Layout: Dagre for automatic graph layout
- Node.js 18+ and pnpm/yarn
- Google Gemini API key
-
Clone the repository:
git clone https://github.com/bikash1376/Interactive-map cd interactive-map -
Install dependencies:
pnpm install # or yarn install -
Create a
.envfile in the root directory and add your Google Gemini API key:GOOGLE_API_KEY=your_api_key_here -
Run the development server:
pnpm run dev # or yarn dev -
Open http://localhost:3000 in your browser.
The application uses Google's Gemini AI to generate learning maps. The API is called through Next.js API routes.
-
POST /api/generate-map- Generates a learning map for a given topic- Request body:
{ "topic": "Your topic here" } - Response: JSON object containing nodes and edges for the learning map
- Request body:
-
GET /api/health- Health check endpoint- Response:
{ "message": "✅API is fine" }
- Response:
GOOGLE_API_KEY: Your Google Gemini API key (required)
-
Map Generation: When you enter a topic, the app sends a request to the Gemini API with a carefully crafted prompt to generate a structured learning path.
-
Data Processing: The response is processed to create nodes (learning topics) and edges (connections between topics).
-
Visualization: The learning map is rendered using React Flow, with automatic layout handled by the Dagre library.
-
Interaction: Users can:
- Pan and zoom the map
- Click on nodes to see details
- Expand nodes to explore subtopics
- Toggle between light and dark mode
learn-map/
├── app/
│ ├── api/
│ │ ├── generate-map/ # API route for generating learning maps
│ │ └── health/ # Health check endpoint
│ └── page.tsx # Main page component
├── components/
│ ├── ReactFlowMap.tsx # Main map component
│ └── ui/ # Shadcn UI components
├── public/ # Static assets
└── styles/ # Global styles
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- React Flow for the interactive graph visualization
- Shadcn UI for beautiful, accessible components
- Google Gemini for AI-powered content generation
- Dagre for automatic graph layout
