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. New user creation.
2. User authentication
3. Follow Functionality
4. Unfollow Functionality
5. Error Handling
6. JWT Token Expiration
7. Security
8. Testing
1. First download the project zip file and extract it on your computer.
1. Install node js if you haven’t installed it.
2. Install required node packages - express
, mongoose
, body-parser
, cookie-parser
, jsonwebtoken
, dotenv
, nodemon
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.
1. Run the server by using the command: npm start