This is a full stack twitter clone project with nextjs. both frontend and backend are created in nextjs. The project includes user registration , login , email verification , creating, updating and deleting tweet, retweet a tweet , comment to a tweet, reply to a comment, sending one to one messages to user , message notification , updating user , and logout .
DEMO VIDEO: https://youtu.be/Vpre5X0EIoA?si=YXSTA_BgIxthVtQk
-
- Create A Tweet
- Create socket connection
- Delete A Retweet
- Delete A Tweet
- Follow An User
- Get Paginated Conversation
- Get Replies of A Specific Tweet Or Comment
- Get Tweet Feed
- Like A Tweet
- Register User
- Reply To A Tweet Or Comment
- Retweet A Specific Tweet
- Search An User By Name and Email
- Send Message To An User
- Update A Tweet
Endpoint:
Method: POST
Type: FORMDATA
URL: http://localhost:3000/api/tweetBody:
| Key | Value | Description |
|---|---|---|
| image | ||
| content | this is a tweet |
More example Requests/Responses:
Body:
| Key | Value | Description |
|---|---|---|
| image | ||
| content | this is a tweet |
{
"success": true,
"data": {
"content": {
"image": "http://localhost:3000/uploads/875092be6f0732c8b8a7cce15.jpg"
},
"likes": [],
"replies": [],
"retweets": [],
"user": {
"id": "643657302b30ef35ad11c622",
"username": "sib.sustswe",
"name": "Sabit Islam",
"image": "http://localhost:3000/uploads/48a1d8a6c492d7678f62e4d00.jpg"
},
"type": "tweet",
"totalLikes": 0,
"totalReplies": 0,
"totalRetweets": 0,
"createdAt": "2023-05-09T10:11:14.794Z",
"updatedAt": "2023-05-09T10:11:14.794Z",
"id": "645a1c42a2930a0311d3ba4b"
},
"error": null
}Status Code: 201
Endpoint:
Method: GET
Type:
URL: http://localhost:3000/api/socketMore example Requests/Responses:
{
"success": true
}Status Code: 200
Endpoint:
Method: DELETE
Type:
URL: http://localhost:3000/api/retweetQuery params:
| Key | Value | Description |
|---|---|---|
| tweetId | 645a011fa2930a0311d3b812 |
More example Requests/Responses:
Query:
| Key | Value | Description |
|---|---|---|
| tweetId | 645a1de0a2930a0311d3ba53 |
{
"success": true,
"error": null,
"data": {}
}Status Code: 200
Endpoint:
Method: DELETE
Type:
URL: http://localhost:3000/api/tweet/6459ee3aa2930a0311d3b809More example Requests/Responses:
{
"success": true
}Status Code: 200
Endpoint:
Method: POST
Type:
URL: http://localhost:3000/api/follow/643657302b30ef35ad11c622More example Requests/Responses:
{
"success": true,
"error": null,
"data": {}
}Status Code: 200
Endpoint:
Method: POST
Type: RAW
URL: http://localhost:3000/api/conversationQuery params:
| Key | Value | Description |
|---|---|---|
| pageIndex | 1 | |
| pageSize | 30 |
Body:
{
"receiverID":"643cd86513a53c746924c1e6"
}More example Requests/Responses:
Query:
| Key | Value | Description |
|---|---|---|
| pageIndex | 1 | |
| pageSize | 5 |
Body:
{
"receiverID":"643cd86513a53c746924c1e6"
}{
"success": true,
"error": null,
"data": [
{
"content": {
"text": "3"
},
"sender": "643cd86513a53c746924c1e6",
"receiver": "643657302b30ef35ad11c622",
"senderReact": "none",
"receiverReact": "none",
"seen": true,
"createdAt": "2023-05-11T05:14:17.477Z",
"id": "645c79a932a534e37ab7ec53"
},
{
"content": {
"text": "12"
},
"sender": "643657302b30ef35ad11c622",
"receiver": "643cd86513a53c746924c1e6",
"senderReact": "none",
"receiverReact": "none",
"seen": true,
"createdAt": "2023-05-11T05:14:12.664Z",
"id": "645c79a432a534e37ab7ec23"
},
{
"content": {
"text": "9"
},
"sender": "643cd86513a53c746924c1e6",
"receiver": "643657302b30ef35ad11c622",
"senderReact": "none",
"receiverReact": "none",
"seen": true,
"createdAt": "2023-05-11T05:14:07.748Z",
"id": "645c799f32a534e37ab7ebf4"
},
{
"content": {
"text": "8"
},
"sender": "643657302b30ef35ad11c622",
"receiver": "643cd86513a53c746924c1e6",
"senderReact": "none",
"receiverReact": "none",
"seen": true,
"createdAt": "2023-05-11T05:14:02.318Z",
"id": "645c799a32a534e37ab7ebc6"
},
{
"content": {
"text": "7"
},
"sender": "643cd86513a53c746924c1e6",
"receiver": "643657302b30ef35ad11c622",
"senderReact": "none",
"receiverReact": "none",
"seen": true,
"createdAt": "2023-05-11T05:13:57.306Z",
"id": "645c799532a534e37ab7eb99"
}
]
}Status Code: 200
Endpoint:
Method: GET
Type:
URL: http://localhost:3000/api/replyQuery params:
| Key | Value | Description |
|---|---|---|
| pageIndex | 1 | |
| pageSize | 10 | |
| tweetId | 645a0578a2930a0311d3b824 |
More example Requests/Responses:
Query:
| Key | Value | Description |
|---|---|---|
| pageIndex | 1 | |
| pageSize | 5 | |
| tweetId | 645a1c42a2930a0311d3ba4b |
{
"pageIndex": "1",
"pageSize": "10",
"data": [
{
"content": {
"text": "hi there",
"image": null
},
"likes": [],
"parent": {
"replies": [],
"id": "645a1c42a2930a0311d3ba4b"
},
"user": {
"id": "643657302b30ef35ad11c622",
"username": "sib.sustswe",
"name": "Sabit Islam",
"image": "http://localhost:3000/uploads/48a1d8a6c492d7678f62e4d00.jpg"
},
"type": "reply",
"totalLikes": 0,
"totalReplies": 0,
"totalRetweets": 0,
"createdAt": "2023-05-09T10:20:57.705Z",
"updatedAt": "2023-05-09T10:20:57.705Z",
"isLiked": false,
"replies": [],
"id": "645a1e89a2930a0311d3ba5b"
}
]
}Status Code: 200
Query:
| Key | Value | Description |
|---|---|---|
| pageIndex | 1 | |
| pageSize | 5 | |
| tweetId | 645a1c42a2930a0311d |
{
"success": false,
"error": "something went wrong",
"data": {}
}Status Code: 500
Endpoint:
Method: GET
Type:
URL: http://localhost:3000/api/feedQuery params:
| Key | Value | Description |
|---|---|---|
| pageIndex | 1 | |
| pageSize | 30 |
More example Requests/Responses:
Query:
| Key | Value | Description |
|---|---|---|
| pageIndex | 1 | |
| pageSize | 30 |
{
"success": true,
"error": null,
"data": {
"pageIndex": "1",
"pageSize": "30",
"data": [
{
"content": {
"text": "dsasdas"
},
"likes": [],
"retweets": [],
"user": {
"id": "643cd86513a53c746924c1e6",
"username": "shawon2046",
"name": "Mohammed Mazhar Ali Shawon",
"image": "http://localhost:3000/uploads/0b1a2494fb547235d42028600.jpeg"
},
"type": "tweet",
"totalLikes": 0,
"totalReplies": 0,
"totalRetweets": 0,
"createdAt": "2023-05-09T11:46:01.007Z",
"updatedAt": "2023-05-09T11:46:01.007Z",
"isLiked": false,
"replies": [],
"id": "645a3279a2930a0311d3bf38"
},
{
"content": {
"text": "fdf"
},
"likes": [],
"retweets": [],
"user": {
"id": "643cd86513a53c746924c1e6",
"username": "shawon2046",
"name": "Mohammed Mazhar Ali Shawon",
"image": "http://localhost:3000/uploads/0b1a2494fb547235d42028600.jpeg"
},
"type": "tweet",
"totalLikes": 0,
"totalReplies": 0,
"totalRetweets": 0,
"createdAt": "2023-05-09T11:45:53.142Z",
"updatedAt": "2023-05-09T11:45:53.142Z",
"isLiked": false,
"replies": [],
"id": "645a3271a2930a0311d3bf35"
},
{
"content": {
"text": "hi there",
"image": "http://localhost:3000/uploads/875092be6f0732c8b8a7cce17.png"
},
"likes": [],
"retweets": [],
"user": {
"id": "643657302b30ef35ad11c622",
"username": "sib.sustswe",
"name": "Sabit Islam",
"image": "http://localhost:3000/uploads/48a1d8a6c492d7678f62e4d00.jpg"
},
"type": "tweet",
"totalLikes": 0,
"totalReplies": 1,
"totalRetweets": 0,
"createdAt": "2023-05-09T10:11:14.794Z",
"updatedAt": "2023-05-09T10:20:58.165Z",
"isLiked": false,
"replies": [],
"id": "645a1c42a2930a0311d3ba4b"
},
{
"content": {
"text": "hi there",
"image": "http://localhost:3000/uploads/875092be6f0732c8b8a7cce12.png"
},
"likes": [],
"retweets": [],
"user": {
"id": "643657302b30ef35ad11c622",
"username": "sib.sustswe",
"name": "Sabit Islam",
"image": "http://localhost:3000/uploads/48a1d8a6c492d7678f62e4d00.jpg"
},
"type": "tweet",
"totalLikes": 0,
"totalReplies": 0,
"totalRetweets": 0,
"createdAt": "2023-05-09T09:21:55.067Z",
"updatedAt": "2023-05-09T09:34:17.052Z",
"isLiked": false,
"replies": [],
"id": "645a10b3a2930a0311d3b891"
},
{
"likes": [],
"retweets": [],
"parent": {
"content": {
"text": "hi there",
"image": "http://localhost:3000/uploads/875092be6f0732c8b8a7cce0a.jpg"
},
"likes": [
"643657302b30ef35ad11c622"
],
"retweets": [
"645a0f7fa2930a0311d3b868"
],
"user": {
"id": "643657302b30ef35ad11c622",
"username": "sib.sustswe",
"name": "Sabit Islam",
"image": "http://localhost:3000/uploads/48a1d8a6c492d7678f62e4d00.jpg"
},
"type": "tweet",
"totalLikes": 1,
"totalReplies": 2,
"totalRetweets": 1,
"createdAt": "2023-05-09T08:35:24.464Z",
"updatedAt": "2023-05-09T09:19:11.368Z",
"isLiked": true,
"replies": [],
"id": "645a05cca2930a0311d3b82c"
},
"user": {
"id": "643657302b30ef35ad11c622",
"username": "sib.sustswe",
"name": "Sabit Islam",
"image": "http://localhost:3000/uploads/48a1d8a6c492d7678f62e4d00.jpg"
},
"type": "retweet",
"totalLikes": 0,
"totalReplies": 0,
"totalRetweets": 0,
"createdAt": "2023-05-09T09:16:47.390Z",
"updatedAt": "2023-05-09T09:16:47.390Z",
"isLiked": false,
"replies": [],
"id": "645a0f7fa2930a0311d3b868"
},
{
"content": {
"text": "hi there",
"image": "http://localhost:3000/uploads/875092be6f0732c8b8a7cce0a.jpg"
},
"likes": [
"643657302b30ef35ad11c622"
],
"retweets": [
"645a0f7fa2930a0311d3b868"
],
"user": {
"id": "643657302b30ef35ad11c622",
"username": "sib.sustswe",
"name": "Sabit Islam",
"image": "http://localhost:3000/uploads/48a1d8a6c492d7678f62e4d00.jpg"
},
"type": "tweet",
"totalLikes": 1,
"totalReplies": 2,
"totalRetweets": 1,
"createdAt": "2023-05-09T08:35:24.464Z",
"updatedAt": "2023-05-09T09:19:11.368Z",
"isLiked": true,
"replies": [],
"id": "645a05cca2930a0311d3b82c"
},
{
"content": {
"text": "undefinedhj",
"image": "http://localhost:3000/uploads/875092be6f0732c8b8a7cce0b.png"
},
"likes": [],
"retweets": [],
"user": {
"id": "643657302b30ef35ad11c622",
"username": "sib.sustswe",
"name": "Sabit Islam",
"image": "http://localhost:3000/uploads/48a1d8a6c492d7678f62e4d00.jpg"
},
"type": "tweet",
"totalLikes": 0,
"totalReplies": 0,
"totalRetweets": 0,
"createdAt": "2023-05-09T08:34:00.232Z",
"updatedAt": "2023-05-09T09:21:34.320Z",
"isLiked": false,
"replies": [],
"id": "645a0578a2930a0311d3b824"
},
{
"likes": [],
"retweets": [],
"parent": null,
"user": {
"id": "643657302b30ef35ad11c622",
"username": "sib.sustswe",
"name": "Sabit Islam",
"image": "http://localhost:3000/uploads/48a1d8a6c492d7678f62e4d00.jpg"
},
"type": "retweet",
"totalLikes": 0,
"totalReplies": 0,
"totalRetweets": 0,
"createdAt": "2023-05-09T08:16:02.595Z",
"updatedAt": "2023-05-09T08:16:02.595Z",
"isLiked": false,
"replies": [],
"id": "645a0142a2930a0311d3b815"
},
{
"content": {
"text": "kl",
"image": "http://localhost:3000/uploads/f77148df2bb92574f1d1d6603.jpg"
},
"likes": [],
"retweets": [],
"user": {
"id": "643657302b30ef35ad11c622",
"name": "Sabit Islam",
"username": "sib.sustswe",
"image": "http://localhost:3000/uploads/48a1d8a6c492d7678f62e4d00.jpg"
},
"type": "tweet",
"totalLikes": -10,
"totalReplies": 8,
"totalRetweets": 0,
"createdAt": "2023-05-04T09:37:19.934Z",
"updatedAt": "2023-05-08T03:59:54.632Z",
"isLiked": false,
"replies": [],
"id": "64537ccf50686c74e7642cc8"
},
{
"likes": [],
"retweets": [],
"parent": null,
"user": {
"id": "643cd86513a53c746924c1e6",
"username": "shawon2046",
"name": "Mohammed Mazhar Ali Shawon",
"image": "http://localhost:3000/uploads/0b1a2494fb547235d42028600.jpeg"
},
"type": "retweet",
"totalLikes": 0,
"totalReplies": 0,
"totalRetweets": 0,
"createdAt": "2023-05-03T11:42:14.774Z",
"updatedAt": "2023-05-03T11:42:14.774Z",
"isLiked": false,
"replies": [],
"id": "645248965664622eae32fef8"
},
{
"likes": [],
"retweets": [],
"parent": null,
"user": {
"id": "643cd86513a53c746924c1e6",
"username": "shawon2046",
"name": "Mohammed Mazhar Ali Shawon",
"image": "http://localhost:3000/uploads/0b1a2494fb547235d42028600.jpeg"
},
"type": "retweet",
"totalLikes": 0,
"totalReplies": 0,
"totalRetweets": 0,
"createdAt": "2023-05-03T11:41:16.912Z",
"updatedAt": "2023-05-03T11:41:16.912Z",
"isLiked": false,
"replies": [],
"id": "6452485c5664622eae32fee7"
},
{
"content": {
"text": "rrrrrr hi fds fasd fgad",
"image": "undefined"
},
"likes": [
"643cd86513a53c746924c1e6",
"643657302b30ef35ad11c622",
"643657302b30ef35ad11c622"
],
"retweets": [
"64532dad50686c74e7642a6e"
],
"user": {
"id": "643cd86513a53c746924c1e6",
"username": "shawon2046",
"name": "Mohammed Mazhar Ali Shawon",
"image": "http://localhost:3000/uploads/0b1a2494fb547235d42028600.jpeg"
},
"type": "tweet",
"totalLikes": -2,
"totalReplies": 0,
"totalRetweets": 1,
"createdAt": "2023-04-27T09:49:32.447Z",
"updatedAt": "2023-05-06T21:53:48.362Z",
"isLiked": true,
"replies": [],
"id": "644a452c36389aea59197083"
},
{
"content": {
"text": "One day you and me",
"image": "http://localhost:3000/uploads/0b1a2494fb547235d42028602.jpg"
},
"likes": [
"643657302b30ef35ad11c622"
],
"retweets": [],
"user": {
"id": "643cd86513a53c746924c1e6",
"username": "shawon2046",
"name": "Mohammed Mazhar Ali Shawon",
"image": "http://localhost:3000/uploads/0b1a2494fb547235d42028600.jpeg"
},
"type": "tweet",
"totalLikes": 2,
"totalReplies": 1,
"totalRetweets": 0,
"createdAt": "2023-04-17T05:29:16.493Z",
"updatedAt": "2023-05-07T18:20:10.976Z",
"isLiked": true,
"replies": [],
"id": "643cd92c13a53c746924c207"
},
{
"likes": [],
"retweets": [],
"parent": {
"content": {
"text": "fdsagfasd",
"image": "http://localhost:3000/uploads/f77148df2bb92574f1d1d6600.png"
},
"likes": [
"643657302b30ef35ad11c622"
],
"retweets": [
"643cd91313a53c746924c1ff"
],
"user": {
"id": "643657302b30ef35ad11c622",
"name": "Sabit Islam",
"username": "sib.sustswe",
"image": "http://localhost:3000/uploads/48a1d8a6c492d7678f62e4d00.jpg"
},
"type": "tweet",
"totalLikes": 0,
"totalReplies": 3,
"totalRetweets": 1,
"createdAt": "2023-04-13T07:13:13.878Z",
"updatedAt": "2023-05-07T18:22:42.952Z",
"isLiked": true,
"replies": [],
"id": "6437ab898df35e69f5602628"
},
"user": {
"id": "643cd86513a53c746924c1e6",
"username": "shawon2046",
"name": "Mohammed Mazhar Ali Shawon",
"image": "http://localhost:3000/uploads/0b1a2494fb547235d42028600.jpeg"
},
"type": "retweet",
"totalLikes": 0,
"totalReplies": 0,
"totalRetweets": 0,
"createdAt": "2023-04-17T05:28:51.542Z",
"updatedAt": "2023-04-17T05:28:51.542Z",
"isLiked": false,
"replies": [],
"id": "643cd91313a53c746924c1ff"
},
{
"content": {
"text": "asdfgsdffgasd"
},
"likes": [
"643657302b30ef35ad11c622"
],
"retweets": [
"6453309950686c74e7642ad2"
],
"user": {
"id": "643657302b30ef35ad11c622",
"name": "Sabit Islam",
"username": "sib.sustswe",
"image": "http://localhost:3000/uploads/48a1d8a6c492d7678f62e4d00.jpg"
},
"type": "tweet",
"totalLikes": 1,
"totalReplies": 0,
"totalRetweets": 1,
"createdAt": "2023-04-13T07:13:26.362Z",
"updatedAt": "2023-05-07T18:22:42.952Z",
"isLiked": true,
"replies": [],
"id": "6437ab968df35e69f5602634"
},
{
"content": {
"text": "fsadgsdfagvasdv"
},
"likes": [],
"retweets": [],
"user": {
"id": "643657302b30ef35ad11c622",
"name": "Sabit Islam",
"username": "sib.sustswe",
"image": "http://localhost:3000/uploads/48a1d8a6c492d7678f62e4d00.jpg"
},
"type": "tweet",
"totalLikes": -1,
"totalReplies": 0,
"totalRetweets": 0,
"createdAt": "2023-04-13T07:13:20.777Z",
"updatedAt": "2023-05-07T18:22:42.952Z",
"isLiked": false,
"replies": [],
"id": "6437ab908df35e69f560262e"
},
{
"content": {
"text": "gsagasdfgasd"
},
"likes": [],
"retweets": [],
"user": {
"id": "643657302b30ef35ad11c622",
"name": "Sabit Islam",
"username": "sib.sustswe",
"image": "http://localhost:3000/uploads/48a1d8a6c492d7678f62e4d00.jpg"
},
"type": "tweet",
"totalLikes": -1,
"totalReplies": 1,
"totalRetweets": 0,
"createdAt": "2023-04-13T07:13:17.320Z",
"updatedAt": "2023-05-07T18:22:42.952Z",
"isLiked": false,
"replies": [],
"id": "6437ab8d8df35e69f560262b"
},
{
"content": {
"text": "fdsagfasd",
"image": "http://localhost:3000/uploads/f77148df2bb92574f1d1d6600.png"
},
"likes": [
"643657302b30ef35ad11c622"
],
"retweets": [
"643cd91313a53c746924c1ff"
],
"user": {
"id": "643657302b30ef35ad11c622",
"name": "Sabit Islam",
"username": "sib.sustswe",
"image": "http://localhost:3000/uploads/48a1d8a6c492d7678f62e4d00.jpg"
},
"type": "tweet",
"totalLikes": 0,
"totalReplies": 3,
"totalRetweets": 1,
"createdAt": "2023-04-13T07:13:13.878Z",
"updatedAt": "2023-05-07T18:22:42.952Z",
"isLiked": true,
"replies": [],
"id": "6437ab898df35e69f5602628"
},
{
"likes": [],
"retweets": [],
"parent": {
"content": {
"text": "fgdsg"
},
"likes": [
"643657302b30ef35ad11c622"
],
"retweets": [
"64350e919f401dcd4e36239f",
"643666452b30ef35ad11c6ea"
],
"user": {
"id": "6434e87f9f401dcd4e3621ad",
"name": "maruf maruf",
"username": "maruf",
"image": "http://localhost:3000/uploads/1a5e9f3abfcdde84f06650b10.jpg"
},
"type": "tweet",
"totalLikes": 1,
"totalReplies": 22,
"totalRetweets": 2,
"createdAt": "2023-04-11T05:09:45.512Z",
"updatedAt": "2023-05-06T21:15:26.040Z",
"isLiked": true,
"replies": [],
"id": "6434eb999f401dcd4e3621d6"
},
"user": {
"id": "643657302b30ef35ad11c622",
"name": "Sabit Islam",
"username": "sib.sustswe",
"image": "http://localhost:3000/uploads/48a1d8a6c492d7678f62e4d00.jpg"
},
"type": "retweet",
"totalLikes": 0,
"totalReplies": 0,
"totalRetweets": 0,
"createdAt": "2023-04-12T08:05:25.089Z",
"updatedAt": "2023-05-07T18:22:42.952Z",
"isLiked": false,
"replies": [],
"id": "643666452b30ef35ad11c6ea"
},
{
"likes": [],
"retweets": [],
"parent": {
"content": {
"text": "fgdsg"
},
"likes": [
"643657302b30ef35ad11c622"
],
"retweets": [
"64350e919f401dcd4e36239f",
"643666452b30ef35ad11c6ea"
],
"user": {
"id": "6434e87f9f401dcd4e3621ad",
"name": "maruf maruf",
"username": "maruf",
"image": "http://localhost:3000/uploads/1a5e9f3abfcdde84f06650b10.jpg"
},
"type": "tweet",
"totalLikes": 1,
"totalReplies": 22,
"totalRetweets": 2,
"createdAt": "2023-04-11T05:09:45.512Z",
"updatedAt": "2023-05-06T21:15:26.040Z",
"isLiked": true,
"replies": [],
"id": "6434eb999f401dcd4e3621d6"
},
"user": {
"id": "6434e87f9f401dcd4e3621ad",
"username": "maruf",
"name": "maruf maruf",
"image": "http://localhost:3000/uploads/1a5e9f3abfcdde84f06650b10.jpg"
},
"type": "retweet",
"totalLikes": 0,
"totalReplies": 0,
"totalRetweets": 0,
"createdAt": "2023-04-11T07:38:57.491Z",
"updatedAt": "2023-04-11T07:38:57.491Z",
"isLiked": false,
"replies": [],
"id": "64350e919f401dcd4e36239f"
},
{
"content": {
"text": "fgdsg"
},
"likes": [
"643657302b30ef35ad11c622"
],
"retweets": [
"64350e919f401dcd4e36239f",
"643666452b30ef35ad11c6ea"
],
"user": {
"id": "6434e87f9f401dcd4e3621ad",
"name": "maruf maruf",
"username": "maruf",
"image": "http://localhost:3000/uploads/1a5e9f3abfcdde84f06650b10.jpg"
},
"type": "tweet",
"totalLikes": 1,
"totalReplies": 22,
"totalRetweets": 2,
"createdAt": "2023-04-11T05:09:45.512Z",
"updatedAt": "2023-05-06T21:15:26.040Z",
"isLiked": true,
"replies": [],
"id": "6434eb999f401dcd4e3621d6"
},
{
"content": {
"text": "fsdafasd",
"image": "http://localhost:3000/uploads/1a5e9f3abfcdde84f06650b01.png"
},
"likes": [
"6434e87f9f401dcd4e3621ad",
"643657302b30ef35ad11c622"
],
"retweets": [],
"user": {
"id": "6434e87f9f401dcd4e3621ad",
"name": "maruf maruf",
"username": "maruf",
"image": "http://localhost:3000/uploads/1a5e9f3abfcdde84f06650b10.jpg"
},
"type": "tweet",
"totalLikes": 2,
"totalReplies": 4,
"totalRetweets": 0,
"createdAt": "2023-04-11T05:01:47.130Z",
"updatedAt": "2023-05-06T21:14:38.595Z",
"isLiked": true,
"replies": [],
"id": "6434e9bb9f401dcd4e3621c3"
},
{
"content": {
"text": "fgasdgfasd",
"image": "http://localhost:3000/uploads/1a5e9f3abfcdde84f06650b00.png"
},
"likes": [
"643657302b30ef35ad11c622",
"643657302b30ef35ad11c622"
],
"retweets": [],
"user": {
"id": "6434e87f9f401dcd4e3621ad",
"name": "maruf maruf",
"username": "maruf",
"image": "http://localhost:3000/uploads/1a5e9f3abfcdde84f06650b10.jpg"
},
"type": "tweet",
"totalLikes": 1,
"totalReplies": 0,
"totalRetweets": 0,
"createdAt": "2023-04-11T05:01:37.688Z",
"updatedAt": "2023-05-06T21:57:59.936Z",
"isLiked": true,
"replies": [],
"id": "6434e9b19f401dcd4e3621c0"
}
]
}
}Status Code: 200
Endpoint:
Method: POST
Type: RAW
URL: http://localhost:3000/api/likeBody:
{
"tweetId":"6459ea7ba2930a0311d3b7fe"
}More example Requests/Responses:
Body:
{
"tweetId":"6459ea7ba2930a0311d3b7fe"
}{
"success": true,
"error": null,
"data": {
"message": "liked successfully"
}
}Status Code: 200
Endpoint:
Method: POST
Type: RAW
URL: http://localhost:3000/api/userBody:
{
"name":"md sabit islam bhuiya",
"email":"[email protected]",
"password":"12345678",
"dateOfBirth":"12-12-2000"
}More example Requests/Responses:
Body:
{
"name":"md sabit islam bhuiya",
"email":"[email protected]",
"password":"12345678",
"dateOfBirth":"12-12-2000"
}{
"success": true
}Status Code: 201
Body:
{
"name":"md sabit islam bhuiya",
"email":"[email protected]",
"password":"12345678",
"dateOfBirth":"12-12-2000"
}{
"success": false,
"error": "user exists",
"data": {}
}Status Code: 409
Body:
{
"name":"md sabit islam bhuiya",
"email":"[email protected]",
"dateOfBirth":"12-12-2000"
}{
"success": false,
"error": "something went wrong",
"data": {}
}Status Code: 500
Endpoint:
Method: POST
Type: FORMDATA
URL: http://localhost:3000/api/replyBody:
| Key | Value | Description |
|---|---|---|
| text | hi there | |
| image | ||
| parent | 6459ea7ba2930a0311d3b7fe |
More example Requests/Responses:
Body:
| Key | Value | Description |
|---|---|---|
| text | hi there | |
| image | ||
| parent | 645a1c42a2930a0311d3 | |
{
"success": true,
"error": null,
"data": {
"content": {
"text": "hi there",
"image": null
},
"likes": [],
"replies": [],
"retweets": [],
"parent": "645a1c42a2930a0311d3ba4b",
"user": {
"id": "643657302b30ef35ad11c622",
"username": "sib.sustswe",
"name": "Sabit Islam",
"image": "http://localhost:3000/uploads/48a1d8a6c492d7678f62e4d00.jpg"
},
"type": "reply",
"totalLikes": 0,
"totalReplies": 0,
"totalRetweets": 0,
"createdAt": "2023-05-09T10:20:57.705Z",
"updatedAt": "2023-05-09T10:20:57.705Z",
"id": "645a1e89a2930a0311d3ba5b"
}
}Status Code: 201
Body:
| Key | Value | Description |
|---|---|---|
| text | hi there | |
| image | ||
| parent | 645a1c42a2930a0311d3 | |
{
"success": false,
"error": "Tweet validation failed",
"data": {}
}Status Code: 400
Endpoint:
Method: POST
Type: RAW
URL: http://localhost:3000/api/retweetBody:
{
"tweetId": "645a011fa2930a0311d3b812"
}More example Requests/Responses:
Body:
{
"tweetId": "645a1c42a2930a0311d3ba4b"
}{
"success": true,
"error": null,
"data": {
"content": {},
"likes": [],
"replies": [],
"retweets": [],
"parent": "645a1c42a2930a0311d3ba4b",
"user": {
"id": "643657302b30ef35ad11c622",
"username": "sib.sustswe",
"name": "Sabit Islam",
"image": "http://localhost:3000/uploads/48a1d8a6c492d7678f62e4d00.jpg"
},
"type": "retweet",
"totalLikes": 0,
"totalReplies": 0,
"totalRetweets": 0,
"createdAt": "2023-05-09T10:18:08.951Z",
"updatedAt": "2023-05-09T10:18:08.951Z",
"id": "645a1de0a2930a0311d3ba53"
}
}Status Code: 201
Endpoint:
Method: POST
Type: RAW
URL: http://localhost:3000/api/searchBody:
{
"user":"shawon"
}More example Requests/Responses:
Body:
{
"user":"shawon"
}{
"success": true,
"error": null,
"data": [
{
"username": "shawon.shellbeehaken",
"email": "[email protected]",
"name": "Shawon",
"score": 1.85,
"id": "643e114113dcb145da71e70a"
},
{
"username": "shawon2046",
"email": "[email protected]",
"name": "Mohammed Mazhar Ali Shawon",
"score": 0.625,
"id": "643cd86513a53c746924c1e6"
}
]
}Status Code: 200
Api endpoint to send message to a user.
Endpoint:
Method: POST
Type: RAW
URL: http://localhost:3000/api/messageBody:
{
"content":{"text":"hi there"},
"customId":"0.321",
"receiver":"6434e87f9f401dcd4e3621ad"
}More example Requests/Responses:
Body:
{
"content":{"text":"hi there"},
"customId":"0.321",
"receiver":"6434e87f9f401dcd4e3621ad"
}{
"success": true,
"error": null,
"data": {
"message": {
"content": {
"text": "hi there"
},
"sender": "643657302b30ef35ad11c622",
"receiver": "6434e87f9f401dcd4e3621ad",
"senderReact": "none",
"receiverReact": "none",
"seen": false,
"originalMessage": {},
"createdAt": "2023-05-10T04:33:47.005Z",
"id": "645b1eabe2f1c7d3e02e425f"
},
"customId": "0.321"
}
}Status Code: 200
Endpoint:
Method: PATCH
Type: FORMDATA
URL: http://localhost:3000/api/tweet/645a10b3a2930a0311d3b891Body:
| Key | Value | Description |
|---|---|---|
| image | ||
| content | hi there |
More example Requests/Responses:
Body:
| Key | Value | Description |
|---|---|---|
| image | ||
| content | hi there |
{
"success": true,
"error": null,
"data": {
"content": {
"text": "hi there",
"image": "http://localhost:3000/uploads/875092be6f0732c8b8a7cce17.png"
},
"user": {
"id": "643657302b30ef35ad11c622",
"username": "sib.sustswe",
"name": "Sabit Islam",
"image": "http://localhost:3000/uploads/48a1d8a6c492d7678f62e4d00.jpg"
},
"likes": [],
"replies": [],
"retweets": [],
"type": "tweet",
"totalLikes": 0,
"totalReplies": 0,
"totalRetweets": 0,
"createdAt": "2023-05-09T10:11:14.794Z",
"updatedAt": "2023-05-09T10:11:14.794Z",
"id": "645a1c42a2930a0311d3ba4b"
}
}Status Code: 200
Made with ♥ by thedevsaddam | Generated at: 2023-05-11 15:18:01 by docgen