Skip to content

aboodmagdy1/Chat-App

Repository files navigation

Chat App

  • server side rendering realtime chat application buit on NodeJs and Socket.io


    Chat App
    Realtime Chat App

Key Features

Authentication and Authorization

  • Signup, Login, and Logout:
    • Users can create an account, log in to their account, and log out when they are done.

Real-time Notifications

  • Add Friend: when a user click on add friend button to send friend Request:

    • when the user is logged in he is in a unieque room to recive the friend request on it (socket.io)
    • the sender's data is added to the recipient's friend request list .
    • the recipient's data is added to the sender's sent request list .

Friends Request Operations

Friend request operations allow users to manage their friend requests effectively. The following operations are supported:

  • Accept: When a user accept a friend request from another user, the following actions are performed:

    • The sender's data is added to the recipient's friends list.
    • The friend request is deleted from the recipient's friend requests.
    • The recipient's data is added to the sender friends list.
    • The recipient's data is deleted from the sender's sent requests.
    • new chat is created between the sender and the recipient
  • Reject: When a user reject a friend request from another user, the following actions are performed:

    • The friend request is deleted from the recipient's friend requests.
    • The recipient's data is deleted from the sender's sent requests.
  • Cancel: If a user sent a friend request to another user and want to cancel , the following actions are performed:

    • The recipient's data is deleted from the sender's sent requests.
    • The sender's data is deleted from the recipient's friend requests.
  • Delete : If a user delete a friend from his friends list, the following actions are performed

    • the friend data is deleted form user friends list
    • the user data is delted form the this friend friends list
    • the chats and messages are deleted

Real-time Private Chat and Messages :

  • getChat
    • we explain before that when user accept friend request we create a chat to them
    • so when user click on the chat button he joined this chat room
    • when send btn is clicked a new message is created in DB and send to the client socket to apper in the fron
    • every user have a unique color for him to can distinguish between senders

Real-time Group Chat and Groups :

  • getCreatePage,createGroup

    • user can create a group chat by adding name ,images and group members form his frineds
    • when user click on the create Group btn we create a chat for this group .
    • the chat is only for group member and have a unique id
  • getMyGroups

    • page to display all user groups that belongs to or created by him
  • getGroupChat

    • To get the chat of a specific group and messages
    • each member have it's own color .i made it because this is a backend project so i use it to distinguish between users

Demonstration 🖥️

Signup , Login ,Logout Pages :

auth img

The Notifications(add friend , cancel Request) :

notification img

Friends Page , operations and Home Page :

friends img

Private Chat :

private img

Group and Group Chat :

group img

To do :

  • make admin for group
  • delete group if user is the admin
  • leave group if user is a member not admin

Getting Started

  1. Clone the repository to your local machine.
  2. Install the required dependencies.

You can fork the app or you can git-clone the app into your local machine. Once done, please install all the dependencies by running

$ npm i
  Strat work
$ npm start 
  1. Configure the project settings.
  • just in the .env file add this :
  • DB_URI : you DB URI
  • PORT : as you like (say 3000)
  1. Run the project locally.

Usage

  • run the project and go to browser .. http://localhost:3000
  • You should use different browse for each user because of the sessioins settings

Build With 🏗️

About

Real-time chat application with socket.io

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published