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

    Module UserRoutes

    Profile management and administrative operations REST API routing configuration

    This module provides complete routing configuration for the WayrApp user management system, implementing user profile operations, password management, and administrative user management functions. The routes support both user-facing profile management operations and administrative functions with appropriate role-based access control.

    The routing structure follows RESTful conventions with clear separation between user profile operations (accessible to authenticated users for their own profiles) and administrative operations (restricted to admin users). The module implements comprehensive middleware stacking including authentication, role-based authorization, and input validation using Zod schemas.

    Key features include user profile CRUD operations, secure password update functionality, administrative user listing with pagination and filtering, role management capabilities, comprehensive input validation using Zod schemas, role-based access control with proper authorization checks, and dependency injection pattern for clean architecture.

    The routes are designed with security as a primary concern, ensuring that users can only access and modify their own profiles while providing administrators with comprehensive user management capabilities. All sensitive operations require proper authentication and authorization validation.

    Exequiel Trujillo

    1.0.0

    // Mount user routes in main application
    import userRoutes from '@/modules/users/routes/userRoutes';

    const API_BASE = '/api/v1';
    app.use(`${API_BASE}/users`, userRoutes);
    // Available endpoints:
    // GET /api/v1/users/profile - Get current user profile
    // PUT /api/v1/users/profile - Update current user profile
    // PUT /api/v1/users/password - Update user password
    // GET /api/v1/users - List all users (admin only)
    // GET /api/v1/users/:id - Get user by ID (admin only)
    // PUT /api/v1/users/:id/role - Update user role (admin only)

    Variables

    default