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

    Module SchemasIndex

    Centralized schema exports for WayrApp Backend API validation system

    This module serves as the central export hub for all validation schemas used throughout the WayrApp language learning platform backend. It provides a unified interface for accessing validation schemas and their corresponding TypeScript types, ensuring consistent imports and reducing coupling between modules while maintaining a clear organizational structure for the validation system.

    The centralized export approach offers several architectural benefits including simplified imports that reduce boilerplate code, consistent schema access patterns across the application, clear dependency management that prevents circular imports, and centralized documentation of all available validation schemas and types for developer reference.

    The module organizes schemas by functional domain (common utilities, authentication, user management, content management, and progress tracking) while maintaining flat exports that allow for flexible importing patterns. This structure supports both specific schema imports and bulk imports based on development needs and module requirements.

    Key organizational principles include domain-based grouping that reflects application architecture, comprehensive type exports that support full TypeScript integration, consistent naming conventions that improve developer experience, and clear separation between schemas and their inferred types for optimal code organization.

    The export structure supports various import patterns including individual schema imports for specific validation needs, bulk imports for modules that use multiple schemas, type-only imports for TypeScript type definitions, and mixed imports that combine schemas and types as needed for different use cases.

    Security and performance considerations include tree-shaking support through named exports that allow bundlers to eliminate unused code, consistent validation behavior through centralized schema management, and clear dependency tracking that supports security auditing and maintenance operations.

    Exequiel Trujillo

    1.0.0

    // Individual schema imports for specific validation needs
    import { EmailSchema, PasswordSchema } from '@/shared/schemas';
    import { validate } from '@/shared/middleware/validation';

    router.post('/auth/register',
    validate({
    body: z.object({
    email: EmailSchema,
    password: PasswordSchema
    })
    }),
    authController.register
    );
    // Bulk imports for modules using multiple schemas
    import { CourseSchema, LessonSchema, ExerciseSchema } from '@/shared/schemas';
    // Type-only imports for TypeScript definitions
    import type { RegisterRequest, LoginRequest, PaginationQuery } from '@/shared/schemas';
    // Mixed imports for comprehensive validation and typing
    import { PaginationSchema, UserQuerySchema } from '@/shared/schemas';
    // Domain-specific imports for focused functionality
    import { RegisterSchema, LoginSchema, CourseSchema, PaginationSchema } from '@/shared/schemas';

    References

    PaginationSchema → PaginationSchema
    IdParamSchema → IdParamSchema
    UuidParamSchema → UuidParamSchema
    LanguageCodeSchema → LanguageCodeSchema
    CountryCodeSchema → CountryCodeSchema
    EmailSchema → EmailSchema
    UsernameSchema → UsernameSchema
    UrlSchema → UrlSchema
    ExperiencePointsSchema → ExperiencePointsSchema
    OrderSchema → OrderSchema
    ScoreSchema → ScoreSchema
    TimeSecondsSchema → TimeSecondsSchema
    BooleanStringSchema → BooleanStringSchema
    RoleSchema → RoleSchema
    ModuleTypeSchema → ModuleTypeSchema
    ExerciseTypeSchema → ExerciseTypeSchema
    TextFieldSchema → TextFieldSchema
    OptionalTextFieldSchema → OptionalTextFieldSchema
    JsonSchema → JsonSchema
    PaginationQuery → PaginationQuery
    IdParam → IdParam
    UuidParam → UuidParam
    PasswordSchema → PasswordSchema
    RegisterSchema → RegisterSchema
    LoginSchema → LoginSchema
    RefreshTokenBodySchema → RefreshTokenBodySchema
    PasswordUpdateSchema → PasswordUpdateSchema
    RegisterRequest → RegisterRequest
    LoginRequest → LoginRequest
    RefreshTokenRequest → RefreshTokenRequest
    PasswordUpdateRequest → PasswordUpdateRequest
    UserProfileUpdateSchema → UserProfileUpdateSchema
    UserRoleUpdateSchema → UserRoleUpdateSchema
    UserQuerySchema → UserQuerySchema
    UserProfileUpdateRequest → UserProfileUpdateRequest
    UserRoleUpdateRequest → UserRoleUpdateRequest
    UserQueryParams → UserQueryParams
    CourseSchema → CourseSchema
    LevelSchema → LevelSchema
    SectionSchema → SectionSchema
    ModuleSchema → ModuleSchema
    LessonSchema → LessonSchema
    ExerciseSchema → ExerciseSchema
    LessonExerciseSchema → LessonExerciseSchema
    ExerciseReorderSchema → ExerciseReorderSchema
    ContentQuerySchema → ContentQuerySchema
    CourseRequest → CourseRequest
    LevelRequest → LevelRequest
    SectionRequest → SectionRequest
    ModuleRequest → ModuleRequest
    LessonRequest → LessonRequest
    ExerciseRequest → ExerciseRequest
    LessonExerciseRequest → LessonExerciseRequest
    ExerciseReorderRequest → ExerciseReorderRequest
    ContentQueryParams → ContentQueryParams
    LessonCompletionSchema → LessonCompletionSchema
    ProgressSyncSchema → ProgressSyncSchema
    ProgressQuerySchema → ProgressQuerySchema
    LessonCompletionRequest → LessonCompletionRequest
    ProgressSyncRequest → ProgressSyncRequest
    ProgressQueryParams → ProgressQueryParams