πŸ‘₯ User Service

Github: github.com/le-minh-duc-dev/chat-system-user-service.git

The User Service manages user profile data within the Chat System.
It provides APIs to create, fetch, update, and list user profiles securely and efficiently.


πŸ“œ Features

  • User Creation
    Create a new user profile upon successful registration at the Auth Service.

  • Email Existence Checking
    Allow verification if an email address is already registered (for frontend validations).

  • User Profile Retrieval
    Fetch complete user information by their Auth ID.

  • User Profile Update
    Support partial updates to a user's public profile .

  • Paginated User Listing
    Provide paginated and sorted listing of all user profiles for admin or system needs.


🧰 Technology Stack

  • Spring Boot
  • Spring Data JPA
  • Spring Data Redis
  • Spring Cloud Netflix Eureka
  • Spring Cloud Config
  • Hibernate Validator
  • Redis
  • PostgreSQL

πŸ“‚ Endpoints Overview

MethodEndpointDescription
POST/api/v1/users/email_existsCheck if an email address already exists
POST/api/v1/usersCreate a new user profile
GET/api/v1/users/{authId}Get user profile information by authentication ID
PATCH/api/v1/users/{authId}Partially update a user profile
GET/api/v1/usersGet a paginated and sorted list of all users

πŸ”’ Security Details

  • Authentication Required:
    Accessing user information generally requires a valid JWT token via API Gateway.

  • Input Validation:
    All incoming requests are validated using Hibernate Validator annotations (e.g., @Valid, @Min(1)).


βš™οΈ How the User Profile Creation Flow Works


πŸ“ Data Contracts

Create User Profile Request (UserDTO)

{
  "authId": 123,
  "email": "user@example.com"
}

Check Email Existence Request (EmailCheckingRequest)

{
  "email": "user@example.com"
}

Update User Profile Request (ClientUserDTO)

{
  "email": "updated@example.com"
}

πŸ’¬ "Turning ideas into scalable code."

Β© 2025 LΓͺ Minh Đức. Stay curious.