This is a Next.js project for an educational platform.
First, install the dependencies:
npm installThen, run the development server:
npm run devOpen http://localhost:3000 with your browser to see the result.
This project uses Firebase Authentication with Google as a provider. Users are assigned one of three roles upon their first login:
- Student (Default): Can view lessons and courses.
- Lecturer: Can view lessons and courses, and has access to a Lecturer Dashboard (future feature).
- Admin: Can view lessons and courses, and has access to an Admin Dashboard (future feature).
Authentication flow has been improved with a loading state to prevent UI flickering on page load. Access control has been refined, replacing direct redirects to removed login/signin pages with informative toast messages for unauthorized access.
Lesson content is written in Markdown. The editing experience has been enhanced with uiw/react-md-editor, providing a richer interface. Code blocks within markdown are now rendered with syntax highlighting using react-syntax-highlighter. Lesson content is securely and consistently stored in Firebase Storage, with robust handling for updates and new lesson initialization.
- Homework Generation: Generate multiple-choice questions for homework assignments based on the content of a selected lesson.
- Lesson Content Generation: Generate full lesson content in Markdown format based on a provided lesson title and summary.
To enable AI features, ensure the GOOGLE_API_KEY environment variable is set.
- Next.js - React framework
- TypeScript - Typed JavaScript
- Tailwind CSS - Utility-first CSS framework
- Genkit - AI integration
- Firebase - Authentication, Firestore for metadata, and Storage for content.
uiw/react-md-editor- Markdown editor for React.react-syntax-highlighter- Syntax highlighting for React components.
The educational content is organized in a hierarchical structure:
- Subjects: Broad categories (e.g., "Mathematics", "History").
- Courses: Specific learning paths within a subject.
- Modules: Sections within a course, grouping related lessons and homeworks.
- Lessons: Individual learning units within a module. Lesson content is written in Markdown.
- Homeworks: Individual assignments within a module, supporting various problem types (starting with multiple-choice).
src/app: Contains the main application pages and layouts.src/components: Contains reusable React components.src/lib: Contains utility functions and data fetching logic.src/ai: Contains AI-related code, including Genkit flows.src/hooks: Contains custom React hooks, including authentication context.