Description: A real-time messaging application built with the MERN stack, utilizing Socket.IO for real-time communication, user status tracking (online/offline), and notifications. The project includes three main folders: server, client, and socket. Follow the instructions below to set up and run each component separately.
-
Navigate to the
serverfolder in the terminal.cd server -
Create a
.envfile in theserverfolder and add the following credentials:PORT=5000 NODE_ENV=development MONGO_URL=<Your MongoDB URL> CLOUDINARY_CLOUD_NAME=<Your Cloudinary Cloud Name> CLOUDINARY_API_KEY=<Your Cloudinary API Key> CLOUDINARY_API_SECRET=<Your Cloudinary API Secret>
-
Install dependencies.
npm install
-
Run the server.
nodemon server.js
- The server provides API routes, models, controllers, and authentication.
- Utilizes Cloudinary and Multer for file (images and PDF) upload and download.
-
Navigate to the
clientfolder in the terminal.cd client -
Install dependencies.
npm install
-
Run the client.
npm start
- Login and register on the initial pages.
- Access the messenger page to view available rooms.
- Join a room to send and receive real-time messages.
- Uses Socket.IO client for messaging, online user tracking, and notifications.
-
Navigate to the
socketfolder in the terminal.cd socket -
Install dependencies.
npm install
-
Run the Socket server.
nodemon index.js
- The
socketfolder contains the Socket.IO server and functions for real-time messaging, notifications, and online user tracking.
- Ensure that each component (server, client, and socket) is running separately for the complete functionality of the real-time messaging application.
- Make sure to replace placeholder values in the
.envfiles with your actual credentials.
Feel free to reach out for any questions or issues!