/Chat_API

Primary LanguageJavaScript

Chat app

Application view

Application view

Technologies

HTML CSS JavaScript Node.js Express MongoDB Socket io Swagger

Description

A real-time chat app allows two users to communicate with each other.

Features

  • User authentication
  • Private messaging
  • Real-time messaging
  • User active
  • Add friend by his id

Setup

  1. Clone the repository:
    git clone https://github.com/Ahmed2872003/Chat_API.git
    
  2. Navigate to the project directory:
    cd Chat_API
    
  3. Install the dependencies:
    npm install
    
  4. Create a .env file in the root directory of the project.
  5. 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.

  6. Go to public>js>axios.js
    replace
    axios.defaults.publicUrl = "https://lets-chat-lxxe.onrender.com";
    to
    axios.defaults.publicUrl = "http://localhost:5000";
    
  7. Start the application:
    npm start
    

    This will start the application and it will be accessible at http://localhost:5000.