This project is a real-time chat application built using the MERN (MongoDB, Express.js, React, Node.js) stack. It allows users to create accounts, join chat rooms, and engage in real-time conversations with other users.
- User authentication and authorization system.
- Create and join chat rooms for real-time conversations.
- Send and receive messages instantly within a chat room.
- Notification system for new messages.
-
Clone the repository:
git clone https://github.com/gauravbhaskar080/Chat-App.git
-
Install dependencies:
Navigate to the project directory and run:
cd Chat-App cd frontend npm install cd backend npm install
-
Set up MongoDB:
-
Create a
.envfile in the root directory and add your MongoDB URL:MONGO_URI = 'your_mongo_db_url' JWT_SECRET = 'your_jwt_secret' PORT = 5000
-
-
Start the server:
In a new terminal window, navigate to the
backenddirectory and run:cd backend npm startThe server will start at
http://localhost:5000. -
Start the client:
In a new terminal window, navigate to the
frontenddirectory and run:cd frontend npm startThe client will start at
http://localhost:3000. -
Access the website:
Open a web browser and go to
http://localhost:3000.
frontend/: Contains the React frontend.public/: Holds static files like CSS, images, and JavaScript.src/: Contains the main source code.components/: React components used in the application.animations/: Animations used for UI elements.config/: Configuration files.context/: React context providers.Pages/: Different pages of the application.App.js: The main application component.index.js: Entry point of the React application.theme.js: Contains theme-related styling.
backend/: Contains the Node.js backend.config/: Configuration files.controllers/: Controllers for handling routes and data.data/: Sample data for initial setup.middleware/: Custom middleware functions.models/: Mongoose models for MongoDB.public/: Static files.routes/: Express.js route handlers.server.js: Entry point of the Node.js application..env: Configuration file for environment variables.
If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with descriptive messages.
- Push your changes to your forked repository.
- Create a pull request to the original repository.
This project is licensed under the MIT License. Feel free to use, modify, and distribute the code for your own purposes.