A Next.js web application that helps students learn better by providing AI-generated explanations, mind maps, and interactive quizzes for any topic.
- Topic Explanation: Get comprehensive explanations with key concepts, examples, and prerequisites
- Interactive Mind Maps: Visual representation of topic relationships using Mermaid diagrams
- Dynamic Quizzes: 20-question quizzes with different difficulty levels and skill types based on Bloom's taxonomy
- Dark/Light Mode: Responsive design with theme support
- Real-time Generation: AI-powered content generation using OpenAI's advanced models
- Framework: Next.js 15 with App Router
- Language: TypeScript
- Styling: Tailwind CSS
- AI Integration: OpenAI API with structured outputs
- Validation: Zod schemas
- Diagrams: Mermaid for mind maps
- Node.js 18+ installed
- OpenAI API key
-
Clone the repository:
git clone <repository-url> cd student_learning_app
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.envfile in the root directory and add your OpenAI API key:OPENAI_API_KEY=your_openai_api_key_here -
Run the development server:
npm run dev
-
Open http://localhost:3000 in your browser.
- Enter a Topic: Type any subject you want to learn about in the input field
- Get Explanation: View a detailed explanation with key concepts and examples
- Explore Mind Map: Visualize the topic's structure and relationships
- Take Quiz: Test your knowledge with 20 carefully crafted questions
src/
├── app/
│ ├── api/ # API routes for AI generation
│ │ ├── generate-explanation/
│ │ ├── generate-mindmap/
│ │ └── generate-quiz/
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Main application page
├── components/ # React components
│ ├── TopicInput.tsx # Topic input component
│ ├── TopicExplanation.tsx # Explanation display
│ ├── MindmapViewer.tsx # Mermaid mind map viewer
│ └── QuizSection.tsx # Interactive quiz component
└── lib/
├── openai.ts # OpenAI client configuration
└── schemas.ts # Zod validation schemas
POST /api/generate-explanation- Generate topic explanationPOST /api/generate-mindmap- Generate mind map dataPOST /api/generate-quiz- Generate interactive quiz
- Comprehensive overview with estimated reading time
- Key concepts with detailed explanations and examples
- Prerequisites and difficulty level assessment
- Clean, readable formatting with visual hierarchy
- Interactive Mermaid diagrams showing topic relationships
- Color-coded nodes for different concept categories
- Hierarchical structure with connection labels
- Fallback text representation for complex diagrams
- 20 questions per topic with varied question types:
- Multiple choice
- True/False
- Fill-in-the-blank
- Short answer
- Difficulty levels: Easy, Medium, Hard
- Bloom's taxonomy skill levels: Knowledge, Comprehension, Application, Analysis, Synthesis, Evaluation
- Real-time timer and progress tracking
- Detailed result analysis with explanations
npm run build
npm start- 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
This project is licensed under the MIT License.
This application is configured to use OpenAI's o1-mini model, which provides excellent reasoning capabilities at a cost-effective rate. The o3 model mentioned in the original request is currently in limited preview. You can update the model in src/lib/openai.ts when o3 becomes generally available.