This is a real-time chat application developed using the MERN stack. It enables users to register, log in, send and receive real-time messages, and manage their online status. Additionally, it integrates with a language model API for generating responses when the recipient is 'BUSY'.
- User Authentication (Registration and Login)
- Real-Time Chat Functionality
- Message Storage in MongoDB
- User Online Status Management
- Integration with a Language Model API for Generating Responses
-
Clone the repository:
git clone https://github.com/haasithp/chat_application_mern.git
-
Navigate to the project directory:
cd real-time-chat-app
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory with the following environment variables:PORT=9090 MONGODB_URI=mongodb://localhost:27017/chatapp JWT_SECRET=your_jwt_secret LLM_API_URL=your_llm_api_url
Replace
your_jwt_secret
with a secret key for JWT token encryption andyour_llm_api_url
with the URL of the language model API.
-
Start the backend server:
npm start
-
Open another terminal window and navigate to the frontend directory:
cd frontend
-
Install frontend dependencies:
npm install
-
Start the frontend server:
npm start
-
Access the application in your browser at
http://localhost:PORT
.
This project is licensed under the MIT License - see the LICENSE file for details.