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
Prerequisites
Complete installation
Database connection
MONGODB_URI is configured in server/.env.Dependencies installed
Running the Seed Script
- Local Development
- Docker
Run Seed Script Locally
Navigate to server directory
Run seed command
Verify output
Seeded Data Details
Users
The seed script creates 10 users with realistic profiles:- Educators (7)
- Students (3)
user_seed_educator1brad@traversymedia.com
user_seed_educator2corey@coreyms.com
user_seed_educator3nana@techworld-with-nana.com
user_seed_educator4gary@designcourse.com
user_seed_educator5jeff@fireship.io
user_seed_educator6gaurav@gauravsen.com
user_seed_educator7chuck@networkchuck.com
View educator data structure
View educator data structure
Courses
The seed script creates 10 comprehensive courses with real video URLs:Full-Stack Web Development
Price: ₹3,999 (30% off)
Chapters: 3 | Lectures: 8 | Duration: 177 min
Students: 37
Data Science & ML
Price: ₹4,499 (20% off)
Chapters: 2 | Lectures: 5 | Duration: 120 min
Students: 42
UI/UX Design
Price: ₹2,999 (15% off)
Chapters: 2 | Lectures: 5 | Duration: 115 min
Students: 27
TypeScript Masterclass
Price: ₹2,499 (20% off)
Chapters: 2 | Lectures: 5 | Duration: 104 min
Students: 32
DevOps with Docker & K8s
Price: ₹3,499 (25% off)
Chapters: 2 | Lectures: 5 | Duration: 128 min
Students: 30
React Native
Price: ₹3,299 (10% off)
Chapters: 2 | Lectures: 5 | Duration: 104 min
Students: 24
View course data structure
View course data structure
Quizzes
Each course chapter includes a quiz with 2-3 questions:Example quiz (React Fundamentals)
Example quiz (React Fundamentals)
Community Groups
Four official community groups for discussions:🌐 Web Development
HTML, CSS, JavaScript, React, Node.js
🤖 Data Science & AI
ML, data analysis, Python, AI
🎨 UI/UX Design
Design systems, Figma, user research
💼 Career & Jobs
Resume tips, interviews, job hunting
View group data structure
View group data structure
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
Example progress record
Example progress record
Seed Script Deep Dive
How It Works
The seed script follows this flow:Connect to database
Clear existing seed data
Insert users
Insert courses
Update users with enrolled courses
Insert purchases, progress, quizzes, groups, posts, replies
insertMany().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
Customizing Seed Data
To modify the seed data:Open seed.js
Modify data arrays
Re-run seed script
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
Start 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
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)
Troubleshooting
Seed script hangs or times out
Seed script hangs or times out
- Check MongoDB connection:
- Verify
MONGODB_URIinserver/.env - Increase connection timeout:
server/configs/mongodb.js
Duplicate key error
Duplicate key 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
- 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
- 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:Create migration script
Run migration