Comprehensive REST API routing configuration for hierarchical content management operations.
This module provides complete routing configuration for the WayrApp content management system,
implementing a hierarchical content structure (Course → Level → Section → Module) with full
CRUD operations, role-based access control, and comprehensive input validation. The routes
support both public content access and authenticated content management operations.
The routing structure follows RESTful conventions with nested resources reflecting the content
hierarchy. Each content type (courses, levels, sections, modules) has complete CRUD endpoints
with appropriate authentication and authorization middleware. The module implements sophisticated
middleware stacking including authentication, role-based authorization, input validation using
Zod schemas, and configurable pagination with sorting and filtering capabilities.
Key features include hierarchical nested routing structure, comprehensive CRUD operations for
all content types, role-based access control with content creator and admin permissions,
comprehensive input validation using Zod schemas, configurable pagination with sorting and
filtering, packaged content endpoints for offline support, and dependency injection pattern
for database access.
The routes are designed to support both content consumption (public access) and content
management (authenticated access with appropriate roles). Administrative operations require
admin role, while content creation and editing require content_creator or admin roles.
Author
Exequiel Trujillo
Since
1.0.0
Example
// Mount content routes in main application import { createContentRoutes } from'@/modules/content/routes'; import { prisma } from'@/shared/database/connection';
// Available endpoints structure: // GET /api/v1/courses - List courses with pagination // POST /api/v1/courses - Create course (content_creator/admin) // GET /api/v1/courses/:id - Get specific course // GET /api/v1/courses/:id/package - Get packaged course for offline // GET /api/v1/courses/:courseId/levels - List levels in course // GET /api/v1/levels/:levelId/sections - List sections in level // GET /api/v1/sections/:sectionId/modules - List modules in section
Comprehensive REST API routing configuration for hierarchical content management operations.
This module provides complete routing configuration for the WayrApp content management system, implementing a hierarchical content structure (Course → Level → Section → Module) with full CRUD operations, role-based access control, and comprehensive input validation. The routes support both public content access and authenticated content management operations.
The routing structure follows RESTful conventions with nested resources reflecting the content hierarchy. Each content type (courses, levels, sections, modules) has complete CRUD endpoints with appropriate authentication and authorization middleware. The module implements sophisticated middleware stacking including authentication, role-based authorization, input validation using Zod schemas, and configurable pagination with sorting and filtering capabilities.
Key features include hierarchical nested routing structure, comprehensive CRUD operations for all content types, role-based access control with content creator and admin permissions, comprehensive input validation using Zod schemas, configurable pagination with sorting and filtering, packaged content endpoints for offline support, and dependency injection pattern for database access.
The routes are designed to support both content consumption (public access) and content management (authenticated access with appropriate roles). Administrative operations require admin role, while content creation and editing require content_creator or admin roles.
Author
Exequiel Trujillo
Since
1.0.0
Example
Example