This is the server-side code for a social media application built using the MERN stack (MongoDB, Express.js, React, Node.js). This application allows users to create posts, like and comment on posts, follow other users, and receive notifications when they are followed or someone comments on their post.
Make sure you have the following software installed on your system:
Node.js
MongoDB
npm install
Create a .env file in the root directory of the project and add the following environment variables:
MONGO_URL: The connection URI for your MongoDB database.
JWT_SECRET: A secret key for signing JSON Web Tokens.
PORT: Specify server port.