A simple chat application built using the MERN (MongoDB, Express.js, React.js, Node.js) stack.
- Real-time messaging between users
- User authentication and authorization
- Message history
- Emojis and file sharing support
Check out the live demo of the MERN Chat Application here.
To run the MERN chat application locally, follow these steps:
-
Clone the repository:
git clone https://github.com/Vigneshk5/mern-chatApp.git
-
Navigate to the project directory:
cd mern-chatApp
-
Install the dependencies for the server:
cd api yarn install
-
Install the dependencies for the client:
cd ../client yarn install
-
Create a
.env
file in the server directory and provide the following environment variables:MONGODB_URI=YOUR_MONGODB_URI JWT_SECRET=YOUR_JWT_SECRET CLIENT_URL=CLIENT_URL
Replace
YOUR_MONGODB_URI
with your MongoDB connection string andYOUR_JWT_SECRET
with a secret key for JWT token generation. -
Start the server:
cd ../api yarn start
-
Start the client:
cd ../client yarn start
-
Open your browser and visit http://localhost:3000 to see the application.
- MongoDB: A NoSQL document database for storing messages and user data.
- Express.js: A web application framework for building the server-side API.
- React.js: A JavaScript library for building the user interface.
- Node.js: A JavaScript runtime for executing server-side code.
- WebSockets: A technology for enabling real-time, bidirectional communication between clients and the server.