Follow and Unfollow APIs development using NodeJS | ExpressJs | MongoDB

Published At: 1 year ago
Published By: Santosh Kumar
Downloads: 3
Watch Video
node js express js mongodb

This Node.js and Express.js API, backed by MongoDB, enables users to authenticate with unique usernames and follow/unfollow other users, mimicking Instagram's social interaction features. After login, JWT tokens are used for secure authentication. Users can follow and unfollow others, update their follower and following lists, and search for users by criteria like usernames. The API includes error handling. It is well-documented and suitable for deployment.

1. Key features of the project:

1. New user creation.

2. User authentication

3. Follow Functionality 

4. Unfollow Functionality

5. Error Handling

6. JWT Token Expiration

7. Security

8. Testing

2. Steps to set up the project:

a) Download the project:

1. First download the project zip file and extract it on your computer.

b) Installation process:

1. Install node js if you haven’t installed it.

2. Install required node packages - expressmongoosebody-parser, cookie-parser, jsonwebtoken, dotenv, nodemon

c) MongoDB Database setup :

1. Login to the MongoDB database and create a new cluster and database

2. Change the MongoDB string in the (.env) file (MONGOURL) with your own database, username, and password.

d) Run the server :

1. Run the server by using the command: npm start