A simple and interactive chat application designed to make online communication easier and more engaging. With features like real-time messaging, group chat management, and an admin dashboard, Chat App brings people closer together.
-
User Registration/Login:
- Secure registration and login using unique usernames.
-
Search Users:
- Quickly find and connect with other registered users.
-
Friend Requests:
- Send and receive friend requests, with notifications for incoming requests.
-
Friend Management:
- Accept or decline friend requests to manage your social circle.
-
Chat List:
- View a list of active friends and conversations.
-
Real-Time Messaging:
- Exchange messages and attachments using a responsive chat interface.
-
Group Chats:
- Create group chats with 3 to 100 members.
- Group admins can rename the group, manage members, and delete the group if necessary.
-
Admin Dashboard:
- A secure admin dashboard to monitor users, messages, and chats (accessible with a secret key).
-
Unfriend/Delete Chat:
- Remove a chat or unfriend a user directly from the chat list.
-
Flexible Group Management:
- Members can leave groups. Admins can assign new leadership automatically if the admin leaves.
- Node.js: Ensure you have Node.js installed (version 16+ recommended). Download Node.js
- Package Manager: Use npm (comes with Node.js) or yarn.
git clone https://github.com/Jamil255/Chat_App.git
cd chat-appNavigate to the client directory and install dependencies:
cd client
npm installNavigate to the server directory and install dependencies:
cd ../server
npm install-
Navigate to the client folder.
-
Create a
.envfile and define any necessary variables.Example:
VITE_API_URL=http://localhost:5000
- Navigate to the server folder.
- Create a
.envfile and set up the required variables:PORT=5000 SECRET_KEY=your_secret_key MONGO_URI=mongodb://localhost:27017/chatapp CLOUDINARY_NAME=your_cloudinary_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret
Navigate to the server directory and run the server:
npm startThe server will start on http://localhost:5000 (or the port defined in .env).
Navigate to the client directory and run the client:
npm run devThe client will start on http://localhost:5173 (or the port defined by Vite).
- Open your browser and visit the client URL, typically:
http://localhost:5173 - Interact with the application.
-
Client Build for Production: To build the client for production:
npm run build
The build output will be located in the
distfolder. -
Server in Production: For production, consider using a process manager like PM2 to run your Node.js server:
npm install -g pm2 pm2 start server.js
-
Database: Ensure MongoDB is running locally or remotely accessible through the URI defined in
.env. -
Socket.IO: The client and server communicate in real-time using Socket.IO. Ensure the server URL is properly configured in the client.
We welcome contributions! Here’s how you can get started:
- Fork the repository.
- Clone your forked repository.
- Create a new branch (
git checkout -b feature-name). - Make your changes and commit them (
git commit -m "Add feature"). - Push your changes to the forked repository.
- Submit a pull request.
Please ensure your changes are well-documented and tested.
Feel free to reach out with any questions or ideas to improve this project!