This is a simple chat application built using MongoDB, Express.js, and React. It allows users to register, login, search for other users, and engage in real-time chat. The application also displays whether users are online or offline.
- User registration and authentication
- User login/logout functionality
- Real-time chat functionality
- User search functionality
- Seen/ Not seen message functionality
- User can upload images
- Online/Offline status indication
- MongoDB: A NoSQL database used for storing user data and chat messages.
- Express.js: A web application framework for Node.js used for building the backend server.
- React: A JavaScript library for building user interfaces used for the frontend.
- Socket.io: A library for real-time web applications enabling bidirectional communication between web clients and servers.
- Clone the repository:
git clone https://github.com/mohkh833/chatapp.git
- Navigate to the project directory:
cd chat-app
- Install dependencies for both backend and frontend:
cd backend
npm install
cd ../frontend
npm install
-
Configure environment variables:
- Create a
.env
file in thebackend
directory. - Define the following environment variables:
MONGODB_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret
- Create a
-
Run the backend server:
cd backend
npm start
- Run the frontend:
cd frontend
npm start
- Open your browser and navigate to
http://localhost:3000
to access the application.
- Register for a new account or log in if you already have an account.
- Once logged in, you can search for other users by their username.
- Click on a user's name to start a conversation.
- Chat with the selected user in real-time.
- Users' online/offline status is indicated beside their username.
- Users Message status is indicated beside message
- Implement user profile management functionality.
- Add support for multimedia messages (videos).
- Enhance the user interface and user experience.
- Implement typing indicators in chat.
Contributions are welcome! Please feel free to open issues or submit pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
- Special thanks to Socket.io for providing real-time communication capabilities.
- Thanks to the creators of MongoDB, Express.js, and React for their amazing technologies.