TweetHub
This is a demonstration repository showcasing basic Twitter-like functionality through simple APIs for social media interactions
Have the env file placed in the project directory of your machine with the following details:
Parameter |
Description |
PORT |
Port for running the server |
MONGODB_URI |
MongoDB Connection URI |
JWT_SECRET |
Secret to be used for JWT authentication |
To run the backend server:
$npm install
$npm run dev
Body |
Type |
Description |
username |
string |
Required. Email Id of the user |
password |
string |
Required. Password for the user |
Logout user from current session
Header |
Type |
Description |
Authorization |
string |
Required. Should contain Bearer token |
Body |
Type |
Description |
username |
string |
Required. Email Id of the user |
password |
string |
Required. Password of the user |
This will be used to send a message by the logged in user to the feed
POST /message/postmessage
Header |
Type |
Description |
Authorization |
string |
Required. Should contain Bearer token |
Body |
Type |
Description |
content |
string |
Required. The message to be sent |
This will be used to fetch the message feed for the logged in user
Header |
Type |
Description |
Authorization |
string |
Required. Should contain Bearer token |
Parameter |
Type |
Description |
page |
number |
Pagination number |
limit |
number |
Pagination limit |
This will be used to list all users in the system which can be used as a reference for following an user
Header |
Type |
Description |
Authorization |
string |
Required. Should contain Bearer token |
Parameter |
Type |
Description |
page |
number |
Pagination number |
limit |
number |
Pagination limit |
This will be used to follow an user
Header |
Type |
Description |
Authorization |
string |
Required. Should contain Bearer token |
Path Parameter |
Type |
Description |
id |
string |
Required. The ID of the user to be followed |
This will be used to fetch the number of users who follow the logged in user
Header |
Type |
Description |
Authorization |
string |
Required. Should contain Bearer token |
Logout user from all sessions
Header |
Type |
Description |
Authorization |
string |
Required. Should contain Bearer token |
Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.
Please make sure to update tests as appropriate.