A real-time chat application built using the MERN stack and Socket.IO, featuring end-to-end encryption, timestamped messages, and support for creating and managing chat channels.
- Features
- Tech Stack
- Installation
- Usage
- Architecture
- API Endpoints
- Challenges and Learnings
- Future Scope
- License
- Real-Time Messaging: Users can send and receive messages instantly.
- Channels: Create and join channels for group conversations.
- Timestamps: Display the timestamp for every message.
- File Transfer: Transfer images and other files securely.
- Responsive UI: Optimized for both desktop and mobile devices.
- Frontend: React.js, Tailwind CSS
- Backend: Node.js, Express.js
- Database: MongoDB
- Real-Time Communication: Socket.IO
- File Upload: Multer
- State Management: Zustand
- Deployment: Vercel (frontend and backend)
- Node.js and npm installed
- MongoDB installed and running locally or a MongoDB cloud instance
- Clone the repository:
git clone https://github.com/prashantsaxe/chatChamber.git cd chat-app - Install dependencies for both the server and client:
# Install server dependencies cd server npm install # Install client dependencies cd ../client npm install
- Set up environment variables:
- Create a .env file in the server directory with the following content:
PORT=5000 MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret
- Create a .env file in the server directory with the following content:
- Start the server:
cd server npm start - Start the client:
cd ../client npm start - Open your browser and navigate to http://localhost:5173 to use the application.
- Sign Up or Log In: Create a new account or log in with an existing one.
- Channels: Create or join channels to start group conversations.
- Real-Time Messaging: Send and receive messages instantly.
- File Transfer: Securely upload and share images and other files.
- Timestamps: View timestamps for all messages to track communication.
The application follows a typical MERN stack architecture:
- Frontend: Built with React.js and styled using Tailwind CSS.
- Backend: Built with Node.js and Express.js, providing RESTful API endpoints.
- Database: MongoDB is used to store user data, messages, and channels.
- Real-Time Communication: Socket.IO is used for real-time messaging.
- File Upload: Multer is used for handling file uploads.
- POST /api/auth/signup: Sign up a new user.
- POST /api/auth/login: Log in an existing user.
- GET /api/auth/get-userInfo: Retrieve user information.
- POST /api/auth/update-profile: Update user profile details.
- POST /api/auth/add-profile-image: Add a profile image.
- DELETE /api/auth/delete-profile-image: Delete a profile image.
- POST /api/auth/logout: Log out a user.
- POST /api/messages/get-messages: Retrieve messages for a chat.
- POST /api/messages/upload-file: Upload a file to a chat.
- POST /api/channels/create-channel: Create a new channel.
- GET /api/channels/get-user-channels: Retrieve all channels for a user.
- GET /api/channels/get-channel-messages/:channelId: Get all messages for a specific channel.
- POST /api/contacts/search: Search for contacts.
- GET /api/contacts/get-contacts-for-dm: Retrieve contacts for direct messaging.
- GET /api/contacts/get-all-contacts: Retrieve all contacts.
- Implementing real-time messaging with Socket.IO.
- Ensuring secure file transfer and storage.
- Managing state efficiently with Zustand.
- Deploying the application seamlessly on Vercel.
- Implementing end-to-end encryption for messages.
- Adding support for video and voice calls.
- Enhancing the UI/UX for a better user experience.
- Adding more customization options for channels and messages.
This project is licensed under the MIT License.


