Skip to content

πŸ“˜ Lesson API SpecificationΒ #28

@SurajTechsmith

Description

@SurajTechsmith

Lessons are structured units of content (explanations, examples, media) that belong to a category. They serve as the learning material classification β€” exercises are handled separately.


πŸ”Ή Endpoints

GET /categories/:categoryId/lessons

  • βœ… Fetch all lessons under a specific category.

POST /categories/:categoryId/lessons

  • βœ… Create a new lesson inside a category.

  • πŸ”’ Requires admin role.

GET /lessons/:lessonId

  • βœ… Retrieve a specific lesson by ID.

PUT /lessons/:lessonId

  • βœ… Update lesson fields such as title, content, media, or level.

  • πŸ”’ Requires admin role.

DELETE /lessons/:lessonId

  • βœ… Remove a lesson from the database.

  • πŸ”’ Requires admin role.


🧱 Lesson Document Structure

Field Type Description
_id ObjectId Auto-generated ID
categoryId ObjectId Reference to the parent category
title String Title of the lesson (e.g., "Past Tense")
content String / Object Lesson explanation (can include text, HTML, or JSON)
order Number Sorting index within category
duration Number Estimated time in minutes
level String "beginner", "intermediate", "advanced"
createdAt Date Timestamp of creation
updatedAt Date Timestamp of last update

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions