This MERN (MongoDB, Express.js, React, Node.js) Chat Application facilitates real-time communication between users in a secure and efficient manner. It utilizes modern technologies such as Socket.io for real-time messaging and Zustand for state management.
-
Real-time Communication: Utilizes Socket.io for instant messaging and seamless interaction between users.
-
Secure Authentication: Implements JSON Web Tokens (JWT) for secure access to the application, ensuring user data protection.
-
Online Status Indication: Provides real-time indication of user online status for enhanced communication experience.
-
Efficient State Management: Uses Zustand for robust and scalable state management across application components.
- Frontend: HTML, CSS, JavaScript, React
- Backend: Node.js, Express
- Database: MongoDB
- Authentication: JSON Web Tokens (JWT)
- Real-time Communication: Socket.io
- State Management: Zustand
- Navigate to the project directory:
cd chat-application - Install dependencies:
npm install
- Start the server:
npm run dev
- Open the application in your browser:
http://localhost:5173
Before running the application, make sure to set up your environment variables in the .env file as follows:
PORT=... # Port number for the server
MONGO_DB_URI=... # MongoDB connection URI
JWT_SECRET=... # Secret key for JWT encryption
NODE_ENV=... # Environment (e.g., development, production)
Build the app
To build the application for production:
shell
Copy code
npm run build
Start the app