A modern React-based learning management system built with Vite and Supabase.
Before you begin, make sure you have the following installed on your computer:
- Download: Visit nodejs.org
- Version: Download the LTS (Long Term Support) version
- Installation: Run the installer and follow the setup wizard
- Verify: Open your terminal/command prompt and type:
You should see version numbers if installed correctly.
node --version npm --version
- Download: Visit git-scm.com
- Installation: Run the installer with default settings
- Verify: Open terminal and type:
git --version
- VS Code: Download from code.visualstudio.com
- Alternative: Any text editor works (Sublime Text, Atom, etc.)
git clone https://github.com/RobEn-AAST/roben-learning-hub.git
cd roben-learning-hubOpen your terminal/command prompt in the project folder and run:
npm installThis command will:
- Download all required packages
- Set up the project dependencies
- May take 2-5 minutes depending on your internet speed
Note: You might see some warnings - this is normal and usually safe to ignore.
- Find the file named
.env.examplein the project root - Open it with your text editor
- You should see something like:
VITE_SUPABASE_URL=your_supabase_url_here VITE_SUPABASE_ANON_KEY=your_supabase_key_here - Replace the values with your actual Supabase credentials
- Save the file as .env
Important: Never share your .env file publicly or commit it to version control!
In your terminal, run:
npm run devYou should see output similar to:
VITE v7.1.4 ready in 252 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
- Open your web browser
- Go to:
http://localhost:5173/ - You should see the Learning Hub application!
Solution: Node.js is not installed or not in PATH
- Reinstall Node.js from nodejs.org
- Restart your terminal/computer
- Make sure to use the installer (not just extracting files)
Solution:
- Windows: Run terminal as Administrator
- Mac/Linux: Use
sudo npm install(not recommended) or fix npm permissions - Better solution: Use a Node version manager like nvm
Solution:
- Close other development servers
- Or change the port by running:
npm run dev -- --port 3000
Solution:
- Check your
.envfile has correct Supabase credentials - Verify your internet connection
- Make sure Supabase project is active
Solution:
- Delete
node_modulesfolder - Delete
package-lock.jsonfile - Run
npm installagain
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
# Install dependencies
npm install
# Install a new package
npm install package-name
# Check for outdated packages
npm outdatedA Coursera-style learning experience is available under /courses/[courseId]/learn:
- Sidebar with course outline and completion ticks
- Main area renders Video, Article, and Quiz lessons
- Progress via "Mark as Complete", Previous/Next navigation
APIs used:
GET /api/courses/[courseId]returns course, modules, and lessons withcontent_typeand optionalquizId.POST /api/lessons/[lessonId]/progressmarks a lesson as completed.GET /api/quizzes/[quizId]provides quiz with questions and options for the renderer.
Key components:
src/components/course-player/LessonContentRenderer.tsxsrc/components/course-player/QuizRenderer.tsx
Try it:
- Open a course page at
/courses/[courseId]and enroll. - Click "Start/Continue" to go to
/courses/[courseId]/learn. - Choose a quiz item, answer, and submit to see scoring and lesson completion.