Overview
The SkillRise seed script (server/seed.js) populates the database with realistic demo data including:
- 10 users (7 educators, 3 students)
- 10 courses across various categories (Web Dev, Data Science, UI/UX, DevOps, etc.)
- 19 purchases (students enrolled in courses)
- 19 course progress records (tracking lecture completion)
- 15 quizzes with multiple-choice questions
- 4 community groups (Web Development, Data Science, UI/UX, Career)
- 12 discussion posts with upvotes
- 18 threaded replies
Safe to re-run: The seed script clears existing seeded data before inserting new records. Your production data remains untouched.
Prerequisites
Complete installation
Ensure you’ve completed Installation and Configuration.
Running the Seed Script
- Local Development
- Docker
Run Seed Script Locally
Seeded Data Details
Users
The seed script creates 10 users with realistic profiles:- Educators (7)
- Students (3)
Brad Traversy
brad@traversymedia.com
user_seed_educator1brad@traversymedia.com
Corey Schafer
corey@coreyms.com
user_seed_educator2corey@coreyms.com
Nana Janashia
nana@techworld-with-nana.com
user_seed_educator3nana@techworld-with-nana.com
Gary Simon
gary@designcourse.com
user_seed_educator4gary@designcourse.com
Jeff Delaney
jeff@fireship.io
user_seed_educator5jeff@fireship.io
Gaurav Sen
gaurav@gauravsen.com
user_seed_educator6gaurav@gauravsen.com
Chuck Keith
chuck@networkchuck.com
user_seed_educator7chuck@networkchuck.com
View educator data structure
View educator data structure
server/seed.js:21-70
Courses
The seed script creates 10 comprehensive courses with real video URLs:Full-Stack Web Development
Educator: Brad Traversy
Price: ₹3,999 (30% off)
Chapters: 3 | Lectures: 8 | Duration: 177 min
Students: 37
Price: ₹3,999 (30% off)
Chapters: 3 | Lectures: 8 | Duration: 177 min
Students: 37
Data Science & ML
Educator: Brad Traversy
Price: ₹4,499 (20% off)
Chapters: 2 | Lectures: 5 | Duration: 120 min
Students: 42
Price: ₹4,499 (20% off)
Chapters: 2 | Lectures: 5 | Duration: 120 min
Students: 42
UI/UX Design
Educator: Corey Schafer
Price: ₹2,999 (15% off)
Chapters: 2 | Lectures: 5 | Duration: 115 min
Students: 27
Price: ₹2,999 (15% off)
Chapters: 2 | Lectures: 5 | Duration: 115 min
Students: 27
TypeScript Masterclass
Educator: Jeff Delaney
Price: ₹2,499 (20% off)
Chapters: 2 | Lectures: 5 | Duration: 104 min
Students: 32
Price: ₹2,499 (20% off)
Chapters: 2 | Lectures: 5 | Duration: 104 min
Students: 32
DevOps with Docker & K8s
Educator: Nana Janashia
Price: ₹3,499 (25% off)
Chapters: 2 | Lectures: 5 | Duration: 128 min
Students: 30
Price: ₹3,499 (25% off)
Chapters: 2 | Lectures: 5 | Duration: 128 min
Students: 30
React Native
Educator: Jeff Delaney
Price: ₹3,299 (10% off)
Chapters: 2 | Lectures: 5 | Duration: 104 min
Students: 24
Price: ₹3,299 (10% off)
Chapters: 2 | Lectures: 5 | Duration: 104 min
Students: 24
View course data structure
View course data structure
server/seed.js:104-213
All courses use real educational YouTube videos. Video URLs point to actual tutorials (not placeholders).
Quizzes
Each course chapter includes a quiz with 2-3 questions:Example quiz (React Fundamentals)
Example quiz (React Fundamentals)
server/seed.js:1349-1384
Community Groups
Four official community groups for discussions:🌐 Web Development
128 members
HTML, CSS, JavaScript, React, Node.js
HTML, CSS, JavaScript, React, Node.js
🤖 Data Science & AI
94 members
ML, data analysis, Python, AI
ML, data analysis, Python, AI
🎨 UI/UX Design
76 members
Design systems, Figma, user research
Design systems, Figma, user research
💼 Career & Jobs
210 members
Resume tips, interviews, job hunting
Resume tips, interviews, job hunting
View group data structure
View group data structure
server/seed.js:910-951
Purchases & Progress
- 19 completed purchases linking students to courses
- 19 course progress records tracking which lectures each student has completed
- Realistic progress percentages (some courses 100% complete, others partially watched)
Example purchase record
Example purchase record
server/seed.js:1038-1047
Example progress record
Example progress record
server/seed.js:1216-1223
Seed Script Deep Dive
How It Works
The seed script follows this flow:Source Code Location
The seed script is located at:- Lines 21-92: User data
- Lines 104-906: Course data (10 courses with full content)
- Lines 908-951: Community group data
- Lines 955-1700+: Main seed function
View seed.js header
View seed.js header
server/seed.js:1-18
Customizing Seed Data
To modify the seed data:Example: Add a new educator
Example: Add a new educator
Example: Add a new course
Example: Add a new course
Verify Seeded Data
Using MongoDB Shell
Using the Application
Browse seeded content
- Open http://localhost:5173
- Navigate to Courses → See 10 seeded courses
- Navigate to Community → See 4 groups
- Sign up with Clerk → Your account is separate from seed data
Seed data uses hardcoded IDs like
user_seed_educator1. Real users from Clerk will have different IDs (e.g., user_2abc...).Resetting Data
To clear all seeded data:- Re-run seed script
- Manual deletion
- Drop entire database (DANGER)
The seed script automatically clears existing seed data before inserting new records:
Troubleshooting
Seed script hangs or times out
Seed script hangs or times out
Symptom: Script runs but never completesSolutions:
- Check MongoDB connection:
- Verify
MONGODB_URIinserver/.env - Increase connection timeout:
server/configs/mongodb.js
Duplicate key error
Duplicate key error
Error:
E11000 duplicate key error collection: SkillRise.users index: _id_ dup keyCause: Seed data already exists in the database.Solutions:- The seed script should auto-clear. Verify lines 959-969 in
seed.js - Manually delete conflicting records (see Resetting Data)
No data appears in the app
No data appears in the app
Symptom: Seed completes successfully but app shows no coursesSolutions:
- Verify you’re connected to the correct database:
- Check that courses are marked as published:
- Restart the server:
Videos don't play
Videos don't play
Symptom: Courses load but lecture videos show “Video unavailable”Cause: YouTube URLs may be region-restricted or removed.Solutions:
- This is expected for demo data (videos are real but may have geo-restrictions)
- Replace with your own video URLs in
seed.js:104-906 - Use a different video platform (Cloudinary, Vimeo, etc.)
Production Considerations
Safe Production Data Loading
For production, use migration scripts instead:Consider using a migration tool like migrate-mongo for production deployments.