Viet Chat is a real-time chat application inspired by Zalo.
link
Language: Java
Framework: Spring boot
Database: MongoDB
Dependencies: Twilio, Modal Mapper, Spring Security, Spring Validation, Spring Websocket, JJWT, AWS SDK
- Register/Login
- View profiles
- User search
- Send messages
- Recall messages
- Delete messages
- Delete conversations
- Send reactions
- View messages
- Create and manage groups (add members, remove members, ...)
View details API: /api/swagger-ui/index.html
GET /api/v1/chats/{chat-id}
PUT /api/v1/chats/{chat-id}
GET /api/v1/chats/{chat-id}/messages
POST /api/v1/chats/{chat-id}/messages
DELETE /api/v1/chats/{chat-id}/messages
PUT /api/v1/chats/{chat-id}/messages/{message-id}
DELETE /api/v1/chats/{chat-id}/messages/{message-id}
PUT /api/v1/chats/{chat-id}/messages/{message-id}/pin
PUT /api/v1/chats/{chat-id}/messages/{message-id}/unpin
PUT /api/v1/chats/{chat-id}/messages/{message-id}/reaction
DELETE /api/v1/chats/{chat-id}/messages/{message-id}/reaction
GET /api/v1/users/profile
PUT /api/v1/users/profile
Body
{
"firstName": "string",
"lastName": "string",
"bio": "string",
"thumbnailAvatar": "string",
"coverImage": "string",
"gender": true,
"birthday": "2024-07-01"
}
GET /api/v1/users/profile/{phone}
GET /api/v1/users/profile/chats
PUT /api/v1/users/profile/chats/{chat-id}
Body
{
"status": "DELETED" // DELETED, HIDDEN, PINNED, NORMAL
}
GET /api/v1/users/profile/friends?type=friend
PUT /api/v1/users/friends/{friend-id}
DELETE /api/v1/users/friends/{friend-id}
PUT /api/v1/users/friends/{friend-id}/accept
PUT /api/v1/users/friends/{friend-id}/block
PUT /api/v1/users/friends/{friend-id}/cancel
PUT /api/v1/users/friends/{friend-id}/decline
GET /api/v1/users/profile/groups
PUT /api/v1/users/profile/groups/{group-id}/leave
GET /api/v1/users/search/recent
POST /api/v1/verification/otp/sms/send
Body
{
"phone": "phone",
}
POST /api/v1/verification/otp/sms/validate
Body
{
"phone": "0703290094",
"otp": "611487"
}
POST /api/v1/auth/login
Body
{
"phone": "phone",
"password": "pwd"
}
POST /api/v1/auth/logout
Body
{
"token": "token"
}
POST /api/v1/auth/logout/all
Body
{
"token": "token"
}
POST /api/v1/auth/password/change
Body
{
"oldPassword": "pwd",
"newPassword": "pwd",
}
POST /api/v1/auth/password/forgot
Body
{
"phone": "phone",
}
POST /api/v1/auth/password/reset/validate
Body
{
"phone": "XXXX",
"otp": "XXXXXX"
}
POST /api/v1/auth/password/reset
Body
{
"token": "token",
"password": "pwd"
}
POST /api/v1/auth/refresh-token
Body
{
"token": "token"
}
POST /api/v1/auth/register
Body
{
"firstName": "fn",
"lastName": "ln",
"gender": true,
"birthday": "2024-07-01",
"password": "pwd"
}
POST /api/v1/groups
GET /api/v1/groups/{group-id}
PUT /api/v1/groups/{group-id}
Body
{
"name": "new name",
"thumbnailAvatar": "url"
}
DELETE /api/v1/groups/{group-id}
GET /api/v1/groups/{group-id}/members
PUT /api/v1/groups/{group-id}/members
Body
["member id 1", "member id 2"]
DELETE /api/v1/groups/{group-id}/members/{member-id}
PUT /api/v1/groups/{group-id}/members/{member-id}
Body
{
"role": "GROUP_LEADER" // Roles: GROUP_LEADER, DEPUTY_GROUP_LEADER, MEMBER
}
POST /api/v1/files
To run this project, you will need to add the following environment variables to your application-secret.yml file
aws:
access-key: key
secret-key: key
endpoint-url: texts://{bucket-name}.s3.ap-southeast-1.amazonaws.com/
bucket:
name: {bucket-name}
twilio:
accountSID: key
authToken: key
phoneNumberTrial: +XXXXXX
Clone the project
git clone texts://github.com/Minhquanzz1002/viet-chat-backend-v2
Go to the project directory
cd my-project
Install dependencies
./mvnw install
Start the server
./mvnw spring-boot:run
- @Minhquanzz1002