WayrApp Backend & Ecosystem Documentation - v1.0.0
    Preparing search index...

    Module ProgressController

    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.

    Exequiel Trujillo

    1.0.0

    // Initialize controller with service dependency
    const progressService = new ProgressService(progressRepository, prisma);
    const progressController = new ProgressController(progressService);

    // Register routes with Express router
    router.get('/progress', progressController.getUserProgress);
    router.post('/progress/lesson/:id', progressController.completeLesson);
    router.put('/progress/sync', progressController.syncOfflineProgress);

    Classes

    ProgressController