/SPCM

Primary LanguageJavaScript

Web Chat Application

Web chat application for chating between single web user or broadcasting it in group.

Table of contents

Files and architecture

  • Frontend - jQuery
    • client
      • css - css styling
      • img - images
      • js - javascript files
      • dasboard.html - chat app interface
      • index.html - login page
      • signup.html - signup page
  • Backend - Node.js
    • config - Redis and MongoDB configuration
    • controllers - contains function for each route
    • libs - libraries
    • middlewares - for checking authorization
    • models - Databse Models and schemas
    • routes - api routes
    • app.js - connection and imports

Environment

Installation

1.Fetch the code. 2. Goto chat-app directory

cd chat-app
  1. Install all dependencies
npm install
  1. Signup and Login on redislabs.com

  2. Create database and copy Endpoint and Redis Password, update the given info in config/configApp.js file.

redis: {
        url: 'redis://<endpoint>',
        password: '<redis password>'
    }
  1. Run server
npm start
  1. Open given below url on browser
http://localhost:3000/

Functionality

  • Chating with individual registered users and each chat having seen and delivered status.
  • Able to see online status of all users and if anyone when offline the last seen of user can be seen.
  • Any user can be blocked which results in, you will not be able to send or receive any chat from that user and the user and you will not able to see the online or last seen of each other.
  • Any user can be reported spam which result in first blocking the user and then removing it from user's list and putting it in spammed users of the database. The spammed user cannot be unspammed later.
  • The seen and delivered status is shown with double tick and cyan double tick respectively.
  • Groups can be formed with more than one user, so that chat can be broadcasted among the whole.
  • The person who forms the group becomes the admin and has right to dismiss or to make multiple admin.
  • Admin can't dismiss or remove a member who became admin before it.
  • Admin can also add more members later once the group is formed.
  • A blocked user who is admin can't add members who blocked it.
  • For each group chat the seen count, delivered count can be seen and who and when it is delivered to or seen by can be displayed.
  • The chat window shows only limited chats to see more chats scroll upwards.

Technologies

References