This is a realtime chat application built using the MERN stack (MongoDB, Express, React, Node.js) with Socket.IO for realtime communication.
.env
.gitignore
backend/
controllers/
auth.controller.js
message.controller.js
user.controller.js
db/
connectToMongoDB.js
middleware/
protectRoute.js
models/
conversation.model.js
message.model.js
user.model.js
routes/
auth.routes.js
message.routes.js
user.routes.js
server.js
socket/
socket.js
utils/
generateToken.js
frontend/
.eslintrc.cjs
index.html
package.json
postcss.config.js
public/
...
README.md
src/
components/
context/
hooks/
pages/
utils/
zustand/
tailwind.config.js
vite.config.js
package.json
README.md
git clone https://github.com/your-username/MERN-Realtime-Chat.git
cd MERN-Realtime-Chat
npm install
cd frontend
npm install
MONGO_DB_URL=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
NODE_ENV=development
PORT=5000
npm run server
cd frontend
npm run dev
http://localhost:3000
.To build the application for production, run the following command:
npm run build
This will create a dist
folder in the frontend directory with the production build of the application.
This project is licensed under the MIT License.