Comprehensive HTTP API controller for progress tracking and gamification endpoints.
This controller provides a complete REST API for managing user progress, lesson completions,
and gamification features in the WayrApp language learning platform. It handles all HTTP
request/response operations for progress-related functionality, including user progress
tracking, lesson completion processing, offline synchronization, and administrative operations.
The controller implements proper authentication and authorization patterns, comprehensive
input validation using Zod schemas, structured error handling with appropriate HTTP status
codes, and detailed logging for audit trails. It follows RESTful conventions and provides
both user-facing and administrative endpoints with role-based access control.
Key features include automatic user authentication validation, comprehensive request/response
validation, structured JSON responses with consistent formatting, proper HTTP status code
usage, role-based authorization for administrative functions, and detailed logging for
monitoring and debugging purposes.
The controller serves as the presentation layer in the clean architecture pattern, handling
HTTP concerns while delegating business logic to the ProgressService layer. All endpoints
require authentication, with specific endpoints requiring elevated permissions for
administrative operations.
Author
Exequiel Trujillo
Since
1.0.0
Example
// Initialize controller with service dependency constprogressService = newProgressService(progressRepository, prisma); constprogressController = newProgressController(progressService);
Comprehensive HTTP API controller for progress tracking and gamification endpoints.
This controller provides a complete REST API for managing user progress, lesson completions, and gamification features in the WayrApp language learning platform. It handles all HTTP request/response operations for progress-related functionality, including user progress tracking, lesson completion processing, offline synchronization, and administrative operations.
The controller implements proper authentication and authorization patterns, comprehensive input validation using Zod schemas, structured error handling with appropriate HTTP status codes, and detailed logging for audit trails. It follows RESTful conventions and provides both user-facing and administrative endpoints with role-based access control.
Key features include automatic user authentication validation, comprehensive request/response validation, structured JSON responses with consistent formatting, proper HTTP status code usage, role-based authorization for administrative functions, and detailed logging for monitoring and debugging purposes.
The controller serves as the presentation layer in the clean architecture pattern, handling HTTP concerns while delegating business logic to the ProgressService layer. All endpoints require authentication, with specific endpoints requiring elevated permissions for administrative operations.
Author
Exequiel Trujillo
Since
1.0.0
Example