MeChat is a real-time chat application built with the MERN stack and Socket.IO. It enables users to communicate instantly, manage group chats, update profiles, and share media, providing a seamless and interactive messaging experience.
MeChat is designed to solve the problem of real-time, secure, and user-friendly communication. It supports both one-on-one and group conversations, allowing users to register, authenticate, and chat instantly. The app is suitable for teams, friends, or any group needing fast, reliable messaging.
- Real-time Messaging: Instant message delivery using Socket.IO.
- User Authentication: Secure registration and login with JWT.
- Group Chats: Create, join, and manage group conversations.
- Message History: Persistent chat history for all conversations.
- Media Sharing: Send images and other media files.
- Profile Management: Update user profiles and avatars.
- Responsive UI: Modern, mobile-friendly interface.
- Notifications: Real-time notifications for new messages and group activity.
Backend (Located in /server):
- Node.js
- Express.js
- MongoDB & Mongoose
- Socket.IO
- JWT (jsonwebtoken)
- Multer (file uploads)
- dotenv, config, cors, bcrypt
Frontend (Located in /public):
- React
- React Router DOM
- Socket.IO Client
- Axios
- SCSS (Sass)
- Emoji Picker React
- React Toastify
- React Icons
Dev Tools:
- Nodemon (backend)
- Gulp, Browser Sync (frontend)
- Create React App (frontend bootstrap)
- Node.js (v14+ recommended)
- npm or yarn
- MongoDB instance (local or cloud)
git clone https://github.com/Ash-the-k/MeChat.git
cd MeChatCreate a .env file in the server directory with the following variables:
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=someverysecretkey
PORT=5000MONGO_URI: MongoDB connection string. eg.- Use mongodb+srv://... if you're connecting to a MongoDB Atlas (cloud) instance.
- Use mongodb://127.0.0.1:27017/mechat if you're using MongoDB locally with Compass.
JWT_SECRET: Secret key for JWT authenticationPORT: Port for backend server (default: 5000)
Create a .env file in the public directory with:
REACT_APP_LOCALHOST_KEY = "chat-app-user";
REACT_APP_PROFILE_PICS_PATHS = "http://localhost:5000/images/profile_pictures/"
REACT_APP_ATTACHMENT_PATHS = "http://localhost:5000/images/attachments/"
REACT_APP_API_URL=http://localhost:5000REACT_APP_API_URL: The base URL for backend API requests
You will need two terminals: one for the backend, one for the frontend.
cd server
npm installcd public
npm installUse the two terminal created to start.
npm start- Runs on
http://localhost:5000by default.
npm start- Runs on
http://localhost:3000by default.
Open your browser and go to: http://localhost:3000
Login screen where users enter credentials
Main chat interface with contacts and messages
Chat window with an open conversation and message thread
- Folder Structure:
/server: Backend API, authentication, database models, and Socket.IO server./public: React frontend, UI components, and static assets.
- API Endpoints: All backend API routes are prefixed with
/api/(e.g.,/api/auth,/api/messages,/api/chats). - WebSocket: Socket.IO is initialized on the backend and connects from the frontend for real-time features.
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes with clear messages.
- Open a pull request describing your changes.
Please follow the existing code style and add tests where appropriate.
This project is currently unlicensed. All rights are reserved.

