A real-time chat app allows two users to communicate with each other.
- User authentication
- Private messaging
- Real-time messaging
- User active
- Add friend by his id
- Clone the repository:
git clone https://github.com/Ahmed2872003/Chat_API.git
- Navigate to the project directory:
cd Chat_API
- Install the dependencies:
npm install
- Create a .env file in the root directory of the project.
- Add the following environment variables to the .env file:
PUBLIC_URL=http://localhost:5000 MONGO_URI=<your-mongodb-uri> JWT_SECRET=<your-jwt-secret> MESSAGE_KEY=<your-message-key> MESSAGE_IV=<your-message-iv>
Note: JWT_SECRET, MESSAGE_KEY, and MESSAGE_IV are diffrent random keys for secure purposes. you can generate from here copy Encryption key 256 for all except MESSAGE_IV Basic 16.
- Go to public>js>axios.js
replace
axios.defaults.publicUrl = "https://lets-chat-lxxe.onrender.com";
to
axios.defaults.publicUrl = "http://localhost:5000";
- Start the application:
npm start
This will start the application and it will be accessible at http://localhost:5000.