This is the frontend for the Masterly learning platform, featuring an AI-powered custom learning path generator that integrates with the backend recommendation system.
- AI-Powered Learning Paths: Generate personalized learning journeys based on your goals
- Real-time Concept Search: Search for specific topics to master
- Multiple Learning Approaches: Choose between complete course paths or focused topic learning
- Alternative Routes: Get multiple path options optimized for different learning styles
- Progress Tracking: Visual progress indicators and mastery levels
- Responsive Design: Beautiful, modern UI that works on all devices
The frontend is fully integrated with the backend recommendation system:
-
Concept Search:
/api/concepts/search?q=query- Searches for concepts by title
- Returns concept details including complexity and learning time
-
Recommendation Generation:
/api/recommendation/:userId/:goalConceptId?currentConceptId=root- Generates personalized learning paths
- Returns best path and alternative routes
- Considers user progress and prerequisites
-
User Progress:
/api/users/:userId/progress- Fetches user's concept mastery levels
- Used for personalized recommendations
-
Authentication:
/api/auth/*- Login/logout functionality
- User session management
- User Authentication: Users must be logged in to generate personalized paths
- Concept Search: Users can search for specific topics they want to master
- Path Generation: The system calls the backend recommendation API to generate optimal learning paths
- Path Visualization: The frontend displays the generated paths with beautiful visualizations
- Progress Tracking: Users can see their progress and mastery levels for each concept
- Node.js 18+
- Backend server running on
http://localhost:5000(or setNEXT_PUBLIC_API_URL)
-
Install dependencies:
npm install
-
Set up environment variables:
# Create .env.local file NEXT_PUBLIC_API_URL=http://localhost:5000/api -
Start the development server:
npm run dev
-
Open http://localhost:3000 in your browser
- Login: Navigate to
/loginand sign in with your credentials - Access Learning Paths: Go to
/learning-paths - Choose Learning Approach:
- Complete Course: Select a course for a full curriculum path
- Specific Topic: Search for a particular concept to master
- Generate Path: Click "Generate Learning Path" to get AI-powered recommendations
- Follow the Path: Use the visual path to guide your learning journey
app/
├── learning-paths/
│ └── page.tsx # Main learning path generator
├── login/
│ └── page.tsx # Authentication page
└── layout.tsx # Root layout with providers
lib/
├── api.ts # API service for backend communication
├── auth-context.tsx # Authentication context
└── utils.ts # Utility functions
components/
└── ui/ # Reusable UI components
- Configuration Panel: Choose learning approach and search for topics
- Path Visualization: Beautiful visual representation of learning paths
- Alternative Routes: Multiple path options with different optimization strategies
- Progress Overview: Current progress across different courses
- Handles all communication with the backend
- Type-safe interfaces for API responses
- Error handling and authentication
- Manages user authentication state
- Provides login/logout functionality
- Handles session persistence
The frontend seamlessly integrates with the backend recommendation system:
- Concept Search: Real-time search with debouncing
- Path Generation: Calls the recommendation controller with user and goal parameters
- Progress Integration: Uses user progress to personalize recommendations
- Error Handling: Graceful error handling with user-friendly messages
- New API Endpoints: Add methods to
lib/api.ts - UI Components: Create reusable components in
components/ui/ - Pages: Add new pages in the
app/directory - Styling: Use Tailwind CSS for consistent styling
- Backend Integration: Ensure backend is running and accessible
- Authentication: Test login flow and session management
- Path Generation: Test with different search queries and user scenarios
- Responsive Design: Test on different screen sizes
- API Connection Errors: Check if backend is running and
NEXT_PUBLIC_API_URLis set correctly - Authentication Issues: Clear browser cookies and try logging in again
- Search Not Working: Check backend concept search endpoint
- Path Generation Fails: Verify user authentication and concept IDs
Enable debug logging by setting:
NEXT_PUBLIC_DEBUG=true- Follow the existing code structure and patterns
- Use TypeScript for type safety
- Add proper error handling
- Test thoroughly before submitting changes
- Update documentation for new features
This project is part of the Masterly learning platform.