👤 User Blocks
User blocks provide comprehensive functionality for user management in Nodeblocks applications. These blocks handle user lifecycle operations including creation, authentication, profile management, and account administration.
🎯 Overview
User blocks are designed to:
- Manage user accounts with full CRUD operations
- Handle authentication and authorization flows
- Provide profile management with validation
- Support account security with lock/unlock operations
- Enable user administration with role-based access
📦 Block Types
🔍 Schemas
JSON Schema definitions for user data validation:
- userSchema: Base user entity structure
- createUserSchema: User registration validation
- updateUserSchema: Profile update validation
⚙️ Handlers
Core business logic for user operations:
- createUser: User account creation
- getUserById: User data retrieval
- updateUser: Profile updates
- deleteUser: Account deletion
- lockUser: Account security locking
- unlockUser: Account unlocking
🛣️ Routes
HTTP endpoint definitions for user operations:
- createUserRoute: POST
/users
with user creation handler - getUserRoute: GET
/users/:userId
with user retrieval handler - findUsersRoute: GET
/users
with user search and pagination - updateUserRoute: PATCH
/users/:userId
with user update handler - deleteUserRoute: DELETE
/users/:userId
with user deletion handler - lockUserRoute: PUT
/users/:userId/lock
with user locking handler - unlockUserRoute: PUT
/users/:userId/unlock
with user unlocking handler
🚀 Features
Complete user management features combining schemas, routes, and handlers:
- createUserFeature: User registration with validation
- getUserFeatures: User profile retrieval with access control
- findUsersFeatures: User search and listing with pagination
- editUserFeatures: User profile updates with authorization
- deleteUserFeatures: User account deletion with access control
- lockUserFeatures: User account locking (admin only)
- unlockUserFeatures: User account unlocking (admin only)
✅ Validators
Validation functions for user operations:
- validateUserProfileAccess: Validates user profile access based on ownership and permissions
🔗 Related Documentation
- User Schema Blocks - User data validation and contracts
- User Handler Blocks - User business logic functions
- User Route Blocks - HTTP endpoint definitions
- User Feature Blocks - Complete user management features
- User Validator Blocks - User validation functions