Welcome to the Online Chat Application project! This application is built using the MERN stack (MongoDB, Express, React, Node.js). Follow the instructions below to set up and run the application on your local machine.
Prerequisites Before you begin, ensure you have the following installed on your system:
- Node.js (includes npm)
- MongoDB (for local database)
To get started, clone the repository using the following command:
gh repo clone Ashwanisingh7930/Chat-Application
Navigate to the API Folder:
cd Chat-Application/api
Run the following command to install the necessary dependencies:
npm install
If you encounter any issues, try running:
npm install --force
Configure Environment Variables:
Create a .env file in the root of the api folder and add the following content:
MONGO_URL=mongodb://localhost:27017/chatapp
Replace chatapp with the name of your MongoDB database if different.
Run the following command to start the backend server:
npm start
Alternatively, if you use Yarn, you can run:
yarn start
Navigate to the Public Folder:
cd ../public
Run the following command to install the necessary dependencies:
npm install
npm start
This will open the application in your default web browser.
Frontend: Access the chat application by visiting http://localhost:3000 in your web browser.
Backend: The backend server will run on http://localhost:5000.
- Common Errors: If you face issues during setup, ensure that all dependencies are correctly installed and that your MongoDB server is running.
- Support: For additional help, feel free to open an issue on the GitHub repository.
Contributions are welcome! Please follow the standard GitHub flow:
Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.