Backend server for Learnify app
Learnify is a web platform that uses AI to automatically generate educational courses. This server provides the backend for the Learnify application, managing users, courses, and their content. It features a powerful AI service that can create complete courses, including outlines, lessons, and quizzes, from just a title.
GET /api/courses now supports pagination, filtering, and sorting.
Query parameters:
page(number, default1)limit(number, default25, max100)sortBy(createdAt,updatedAt,title,views,likes)sortOrder(ascordesc, defaultdesc)search(case-insensitive title search)keyword(exact match fromkeywordsarray)all=true(returns all matching records in one response)
Response shape:
data: course arraymeta:{ total, page, limit, totalPages, hasNextPage, hasPreviousPage, sortBy, sortOrder, filters }
- Authentication & Authorization: Secure user access with JSON Web Tokens (JWT) managed through the
auth.jsmiddleware. - Rate Limiting: Protects against brute-force and denial-of-service attacks using the
rateLimiter.jsmiddleware. - Input Validation: Input validation ensures the data is correct.
- Centralized Error Handling: The
errorHandler.jsmiddleware prevents sensitive information from being leaked in error messages. - Secret Management: API keys and other secrets are managed securely through environment variables.