This Project is an innovative chat application that leverages modern technologies such as Socket.io, React, React Bootstrap, HTML, CSS, and more to deliver a dynamic and interactive messaging experience. With its robust features and seamless integration, ChatApp allows users to connect, communicate, and express themselves in real-time with other users from around the world.
HTTP Verbs | Endpoints | Action |
---|---|---|
POST | api/v1/user/register | To Create new User |
POST | api/v1/user/login | To Log in new user |
POST | api/v1/setAvatar/:id | To set Avatar as profile picture |
GET | api/v1/allusers/:id | To get all the registered users |
POST | api/v1/addmsg | To send message any of the registered users |
GET | api/v1/getallmessages | To retrive all conversations of a specific user |
{
"username": "Müller",
"email": "mü[email protected]",
"password": "12345678"
"avatarImage": "",
"isAvatarImageSet": false
}
Route: api/v1/user/register (POST)
Request body:
{
"username": "Müller",
"email": "mü[email protected]",
"password": "12345678"
"avatarImage": "",
"isAvatarImageSet": false
}
Response: The newly created user object. Response Sample Pattern:
{
"status":"success" ,
"message": "Data Inserted",
"data": {
"username": "Müller",
"email": "mü[email protected]",
"password": "",//in hash format
"avatarImage": "",
"isAvatarImageSet": false
},
}
Route: api/v1/user/login (POST)
Request body:
{
"username": "Müller",
"password": "12345678"
}
Response: The user's array of objects. Response Sample Pattern:
{
"status":"success" ,
"message": "Data Retrived",
"data": {
"username": "Müller",
"email": "mü[email protected]",
"password": "", //in hash format
"avatarImage":"PHuNTQx=PHN2ZyB4bmYwMDAwOyIvPjwvc3ZnPg===",
"isAvatarImageSet": false
},
}
Route: /api/v1/setAvatar/:id (POST)
Request Param: :id
Request body:
{
"_id": "" //id of the single user,
"avatarImage": "PHuNTQx=PHN2ZyB4bmYwMDAwOyIvPjwvc3ZnPg==="
}
Response: The specified user object.
Response Sample Pattern:
{
"success": "success",
"message": "Avatar Image set successfully",
}
Route: /api/v1/allusers/:id (GET)
Request Param: :id
Response: The array of all user object.
Response Sample Pattern:
{
"success": "success",
"message": "All Uers retrived successfully",
"data": [{},{}...],
}
Route: api/v1/addmsg (POST)
Request body:
{
"message":"", //Message to send
"sender":"", //Sender Id
"reciver":"", //Reciver Id
"createdAt":"" //Time Stamp
}
Response:Sent message .
Response Sample Pattern:
{
"success": "success",
"message": "Message sent successfully",
"data": "" //Sent message
}
Route: api/v1/getallmessages (GET)
Request body:
{
"sender":"", //Sender Id
"reciver":"", //Reciver Id
}
Response:Retrive all messages .
Response Sample Pattern:
{
"success": "success",
"message": "Message sent successfully",
"data": [{},{}....] //Sent message
}
Error Response Object include the following properties:
{
"success": false,
"message": "E11000 duplicate key error collection: univerity-management.students index: email_1 dup key: { email: \"[email protected]\" }",
"errorMessages": [
{
"path": "",
"message": "E11000 duplicate key error collection: univerity-management.students index: email_1 dup key: { email: \"[email protected]\" }"
}
],
"stack": "MongoServerError: E11000 duplicate key error collection: univerity-management.students index: email_1 dup key: { email: \"[email protected]\" }\n at H:\\next-level-development\\university-management-auth-service\\node_modules\\mongodb\\src\\operations\\insert.ts:85:25\n at H:\\next-level-development\\university-management-auth-service\\node_modules\\mongodb\\src\\cmap\\connection_pool.ts:574:11\n at H:\\next-level-development\\university-writeOrBuffer (node:internal/streams/writable:391:12)"
}