This messaging API allows users to chat and receive messages from other users. Users can
- Signup
- Signin with email
- Signin with Google
- Send a message
- Get messages all messages sent and received
- Get the content of a specific message
- Delete message
This application runs on Node Js version v18 ( to download, go to: https://nodejs.org/en/download/current).
This application also uses mongodb version 7.
- Clone this project (
git clone https://github.com/Esavwede/Cheerp) - Run npm install to download all dependencies
- Create your .env file. ** Checkout the sampleEnv.txt file in the root directory to setup your .env file. The sampleEnv.txt file shows you how to fill your .env file
- Run the following command to start the application
npm start
- To run the application in developer mode using nodemon, run the command
npm run start:dev
- Fork this repository
- Clone your forked repository
- Create a branch and write your codes
- Commit and push
- Star this repository
- Wait for the pull request to merge
This project is licensed under the MIT License.
{
"firstname":"firstname",
"lastname":"lastname",
"email":"email@gmail.com",
"password":"password"
}{
"success": true,
"message": "user signedup successfully ",
"user": {
"userId": "670f442f-7c37-4885-bd54-20b935d86c87",
"firstname": "firstname",
"lastname": "lastname",
"email": "email8@gmail.com"
}
}{
"email":"email@gmail.com",
"password":"password"
}{
"success": true,
"msg": "signin successful",
"data": {
"user": {
"email": "email@gmail.com",
"id": "e05f710f-ca1d-4cf6-9acb-427800d025e3",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImVtYWlsQGdtYWlsLmNvbSIsImlkIjoiZTA1ZjcxMGYtY2ExZC00Y2Y2LTlhY2ItNDI3ODAwZDAyNWUzIiwiaWF0IjoxNjk3NzkzNjk5LCJleHAiOjE2OTc3OTY2OTl9.WSB3pd0YS0rDBcI_domd_ixcX1aH3z0YWVZ9V0jgHAI"
}
}
}none
{
"success": true,
"message": "signin successful",
"user": {
"_id": "65324ca123b8d07f2888e318"
},
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NTMyNGNhMTIzYjhkMDdmMjg4OGUzMTgiLCJpYXQiOjE2OTc3OTUyMzMsImV4cCI6MTY5Nzc5ODIzM30.A-YdaoD8o6xc-sERGX8tNxTCMebjZerTfonpgK0qXF4"
}- Authorization
{
"messageId":"c49b711c-201c-4e64-9022-3863e994ef8d", // existing message Id or null ( not yet messaged )
"receiverId":"0910d789-f178-4bfe-852a-d6bc2c46afa3", // required
"textContent":"Another message to esavwede84@gmail.com" // required
}{
"success": true,
"message": " New Message Sent "
}- Authorization - input jwt token here
{
"userMessagesPreview": [
{
"_id": "653269e474032a386a7fd564",
"messageId": "c49b711c-201c-4e64-9022-3863e994ef8d",
"lastMessagePreview": "Another message to user@gmail.com"
},
{
"_id": "65326cc474032a386a7fd6d1",
"messageId": "427a5686-5b34-47ec-9515-266726065c1b",
"lastMessagePreview": "Another message to user@gmail.com"
}
]
}- Authorization - input jwt token here
{
"messages": {
"_id": "653269e474032a386a7fd564",
"messageId": "c49b711c-201c-4e64-9022-3863e994ef8d",
"messages": [
{
"messageId": "c49b711c-201c-4e64-9022-3863e994ef8d",
"textContent": "Debug message to esavwede84@gmail.com",
"senderId": "670f442f-7c37-4885-bd54-20b935d86c87",
"receiverId": "0910d789-f178-4bfe-852a-d6bc2c46afa3",
"_id": "653269e457c4a8681d3e0fca"
},
{
"messageId": "c49b711c-201c-4e64-9022-3863e994ef8d",
"textContent": "Another message to esavwede84@gmail.com",
"senderId": "670f442f-7c37-4885-bd54-20b935d86c87",
"receiverId": "0910d789-f178-4bfe-852a-d6bc2c46afa3",
"_id": "65326a2257c4a8681d3e0fcd"
},
{
"messageId": "c49b711c-201c-4e64-9022-3863e994ef8d",
"textContent": "Another message to esavwede84@gmail.com",
"senderId": "670f442f-7c37-4885-bd54-20b935d86c87",
"receiverId": "0910d789-f178-4bfe-852a-d6bc2c46afa3",
"_id": "65326aa10fed37aac4ffdb86"
}
]
}
}- Authorization - input jwt here
none
{
"message": " Message Deleted Successfully "
}