Snappy Chat Application is a real-time chat platform built using the MERN stack (MongoDB, Express, React, Node.js) that allows users to send and receive messages instantly. The app supports multiple chat rooms and real-time messaging functionality using WebSockets.
- Real-time messaging with WebSocket (Socket.IO)
- User authentication (Login/Sign-up)
- Create and join multiple chat rooms
- Responsive user interface
- Backend API for managing chat data
- Frontend: React, CSS
- Backend: Node.js, Express.js
- Database: MongoDB
- Real-time Communication: Socket.IO
- Other: JWT (for authentication), bcrypt (for password hashing)
- Node.js installed on your system
- MongoDB installed locally or access to a cloud MongoDB database (e.g., MongoDB Atlas)
- Clone the Repository:
git clone https://github.com/YourUsername/snappy-chat-app.git cd snappy-chat-app
- Backend Setup This section guides you through setting up the backend server for the Snappy Chat Application.
- Step 1: Navigate to the Server Folder
After cloning the repository, move into the server directory:
cd server
- Step 2: Install Required Dependencies
Install the necessary Node.js packages using npm:
npm install
- Step 3: Configure Environment Variables
Create a .env file in the server directory and add your configuration settings, including your MongoDB connection string and JWT secret.
Here’s a sample of what to include:
MONGO_URI=your_mongo_connection_string
JWT_SECRET=your_jwt_secret_key
- Step 4: Start the Backend Server
You can now start the backend server using the following command:
npm start
The backend server will run on http://localhost:5000 by default. Make sure your MongoDB server is running, or you're connected to a cloud MongoDB service.
Ensure that Node.js and MongoDB are installed and configured correctly. Check the console for any error messages during the installation or startup process and resolve them accordingly.
- User Registration and Login: Users can sign up with their email and password. Passwords are securely hashed using bcrypt and stored in MongoDB.
- Real-time Messaging: Users can create and join chat rooms. Messages are exchanged in real time using Socket.IO for seamless communication.
- Message Persistence: All chat history is stored in MongoDB, so users can view past conversations when they log back in.
- Authentication: JWT (JSON Web Tokens) is used to authenticate users, ensuring secure and protected messaging. Future Enhancements Direct Messaging: Implement one-on-one messaging between users. Typing Indicators: Show when a user is typing in a chat room. Message Encryption: Add end-to-end encryption for secure messaging. Push Notifications: Implement real-time push notifications for new messages. License This project is licensed under the MIT License. See the LICENSE file for more details.
For any questions or feedback, feel free to contact me: Email: [email protected] Portfolio: myportfoliopayal.netlify.app