This is a Next.js project bootstrapped with create-next-app.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
The mind map generation system has been unified to handle both lesson and base class mind maps through a single API endpoint. This reduces code duplication and provides a consistent interface.
- Endpoint:
POST /api/teach/media/generate/mind-map - Body Parameters:
lessonId(string, optional): Generate mind map for a specific lessonbaseClassId(string, optional): Generate mind map for an entire base class
- Query Parameters:
regenerate=true(optional): Force regenerate existing mind map
- Response:
{ "success": true, "asset": { "id": "asset_id", "url": "/api/teach/media/mind-map/asset_id", "title": "Mind Map Title" } }
- Endpoint:
GET /api/teach/media/generate/mind-map - Query Parameters:
lessonId(string, optional): Check for lesson mind mapbaseClassId(string, optional): Check for base class mind map
- Response:
{ "exists": true, "asset": { "id": "asset_id", "url": "/api/teach/media/mind-map/asset_id", "title": "Mind Map Title" } }
- Endpoint:
GET /api/teach/media/mind-map/{id} - Response: Interactive HTML mind map display
- Note: Automatically detects whether the mind map is for a lesson or base class
- Unified Generation: Single endpoint handles both lesson and base class mind maps
- Unified Display: Single viewer endpoint serves both types of mind maps
- Consistent Interface: Same API patterns for both lesson and base class workflows
- Automatic Detection: System automatically determines content type and fetches appropriate data
- Interactive Visualization: Rich SVG-based mind maps with zoom, pan, and expand/collapse functionality
Lesson Mind Maps:
- Center: Lesson title
- Branches: Lesson sections
- Hierarchy: Sections → Concepts → Points → Details
Base Class Mind Maps:
- Center: Course title
- Branches: Course modules/paths
- Hierarchy: Modules → Lessons → Concepts → Details
// Generate lesson mind map
const response = await fetch('/api/teach/media/generate/mind-map', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ lessonId: 'lesson_123' })
});
// Generate base class mind map
const response = await fetch('/api/teach/media/generate/mind-map', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ baseClassId: 'class_456' })
});
// Check for existing mind map
const checkResponse = await fetch('/api/teach/media/generate/mind-map?lessonId=lesson_123');
const { exists, asset } = await checkResponse.json();