Welcome to the MERN Chatroom project! This is a full-stack web application built using the MERN stack (MongoDB, Express.js, React, and Node.js). The project aims to provide a simple and real-time chatroom experience.
- Real-Time Chatting: Engage in real-time conversations with other users.
- User Authentication: Secure your chatroom with user authentication.
- Message History: View past messages and conversations.
- Responsive Design: The chatroom is accessible and usable on various devices.
- Node.js and npm installed on your machine.
- MongoDB Atlas account for database storage.
-
Clone the repository:
git clone https://github.com/your-username/chat-room.git
-
Navigate to the project directory:
cd chatroom
-
Navigate to the backend directory:
cd backend
-
Install server dependencies:
npm install
-
Install client dependencies:
npm install
-
Navigate to the client directory:
cd frontend
-
Install client dependencies:
npm install
-
Create a
.env
file in the root directory and set up the following environment variables:MONGO_URI=your_mongodb_uri JWT_SECRET=your_jwt_secret
- Open your web browser and go to
http://localhost:3000
. - Register or log in to access the chatroom.
- Enjoy real-time chatting with other users!
chatroom/
|-- frontedn/ # React frontend
| |-- public/
| |-- src/
| |-- package.json
|
|-- backend/ # NodeJS backend
| |-- controllers/
|-- models/ # MongoDB data models
|-- handler/ # async handler
|-- middleware/ # checkauth
|-- routes/ # Express.js routes
|-- .env # Environment variables
|-- index.js # Express.js server setup
|-- package.json # Server dependencies
|-- README.md # Project documentation
-
Server Dependencies:
- express
- mongoose
- socket.io
- jsonwebtoken
-
Client Dependencies:
- react
- react-router-dom
- socket.io-client
Contributions are welcome! Feel free to open issues or pull requests.
This project is licensed under the MIT License.