Skip to content

About

Cool Messenger: A full-stack MERN chat application built with MongoDB, Express, React, and Node.js. It demonstrates real-time messaging across multiple devices connected to the same LAN network, using a locally hosted backend server to provide seamless device-to-device communication.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

✨ Full Stack Realtime Messenger -> Cool Messenger✨

Highlights:

  • 🌟 Tech stack: MERN + Socket.io + TailwindCSS + Daisy UI
  • 🎃 Authentication && Authorization with JWT
  • 👾 Real-time messaging with Socket.io
  • 🚀 Online user status
  • 👌 Global state management with Zustand
  • 🐞 Error handling both on the server and on the client

Setup .env file

MONGODB_URI=mongodb+srv://shah125roz_db_user:W67gclLudQvohv56@cluster0.8a42jed.mongodb.net/chat_db?appName=Cluster0
PORT=5001
JWT_SECRET=mysecret

CLOUDINARY_CLOUD_NAME=dayajes8o
CLOUDINARY_API_KEY=665847369657562
CLOUDINARY_API_SECRET=QXFYb6K2L4HjSxFuUvhaLeTEBKQ

NODE_ENV=production

Build the app

npm run build

Start the app

npm start

Start frontend

cd frontend
npx vite --host 

🌐 LAN/Network Access Setup

To run the app on multiple devices on the same network (LAN):

1. Backend Server (Port 5001)

The backend is already configured to listen on all network interfaces (0.0.0.0).

2. Frontend Server (Port 5173)

The frontend is configured to listen on all network interfaces for LAN access.

3. Access from Other Devices

  1. Find your computer's IP address:

    • Windows: Run ipconfig in Command Prompt
    • Linux/Mac: Run ifconfig or ip addr
    • Look for IPv4 address (e.g., 192.168.1.100)
  2. Access the app:

    • Frontend: http://YOUR_IP:5173
    • Backend API: http://YOUR_IP:5001
  3. Example:

    Frontend: http://192.168.1.100:5173
    Backend:  http://192.168.1.100:5001
    

4. Firewall Settings

Make sure ports 5001 and 5173 are open in your firewall for LAN access.

5. Troubleshooting

  • If login doesn't work, check browser console for CORS errors
  • Ensure both devices are on the same WiFi network
  • Try disabling firewall temporarily for testing

About

Cool Messenger: A full-stack MERN chat application built with MongoDB, Express, React, and Node.js. It demonstrates real-time messaging across multiple devices connected to the same LAN network, using a locally hosted backend server to provide seamless device-to-device communication.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages