π₯ 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
Method | Endpoint | Description |
---|---|---|
POST | /api/v1/users/email_exists | Check if an email address already exists |
POST | /api/v1/users | Create 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/users | Get 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"
}