Description: Fetch all chapters.
Query Filters:
class: Filter by class (e.g.,Class 11)unit: Filter by unit namestatus: Filter by status (e.g.,Completed,Not Started)subject: Filter by subject (e.g.,Physics)weakChapters:trueorfalsepage: For pagination (default = 1)limit: Number of results per page (default = 10)
Returns: Filtered and paginated list of chapters + total count
Caching: Cached via Redis for 1 hour
Description: Fetch a single chapter by its MongoDB _id
Returns: Chapter details or 404 if not found
Description: Upload chapters via JSON file (admin-only)
Authorization: Requires Authorization: Bearer admin-secret-token header
Body: Upload .json file using form-data with field name file
Behavior:
- Parses and validates uploaded chapters
- Inserts valid chapters into the database
- Skips invalid ones and returns them in a
failedarray
- Redis Caching: For
GET /chapterswith 1-hour TTL - Rate Limiting: 30 requests per minute per IP (Redis-backed)
- Error Handling: Proper HTTP status codes and JSON error messages