This script seeds chapters for all courses in the database.
- Course 1: JavaScript Basics (3 chapters)
- Course 2: HTML (12 chapters) - Already exists, use
/api/admin/save-chapters - Course 3: CSS Basics (3 chapters)
- Course 4: React Basics (3 chapters)
- Course 5: Python Basics (3 chapters)
- Course 6: Python Advanced (2 chapters)
- Course 7: Generative AI (2 chapters)
- Course 8: Machine Learning (2 chapters)
Navigate to:
http://localhost:3000/api/admin/seed-all-chapters
Navigate to:
http://localhost:3000/api/admin/seed-all-chapters?courseId=1
Replace 1 with the course ID you want to seed (1-8).
After seeding chapters, you need to:
- Create exercise content in
/data/exercises.tsfor each course - Run
/api/admin/save-exercisesto push exercises to DB
Chapters are stored with:
courseId: The course this chapter belongs tochapterId: The chapter number within the coursename: Chapter titledescription: Chapter descriptionexercises: JSON array of exercise metadata (name, slug, xp, difficulty)