GithubHelp home page GithubHelp logo

chat-room-typescript's Introduction

Chat-Room

Introduction

This project is built to study SSE (Server-Sent Events). To do so, I generated a chat room that allows users to log in with their names, see who is connected, and send messages.

React Usage

In this project, I have done major usage in react. Every element in the page is built by components of react. I also use React to route between the login page to my chat page. This reduces the number of requests that the front needs to send to the back and also makes the running time much faster.

SSE

The server side is working on EventEmmitter, a class in JavaScript that lets me create events and a way to sign that the event happened. In this way, I can sign every time that user logged in or logged out and in any message the users send. What help me to update the data in the front and refresh the page to show me the new data.

How to run

For now, the chat room has no deployment so to use it you need to do The following orders:

  1. Download this repo
  2. Open 2 terminals on your IDE
  3. npm i on the server folder
  4. Add .env file inside the server folder that includes this config:
    • MONGO_URI=<Database connection>
    • JWT_SECRET=<Secret key (choose whatever you like)>
    • ACCESS_TIME=<12h>
    • REFRESH_TIME=<36h>
  5. npm start to run the server
  6. On the second terminal cd client
  7. npm i on this folder
  8. npm run start on this chat-Room-typescript/client root to run the client side of the project

Languages and Tools:

Visual Studio Code HTML5 CSS3 JavaScript React Node.js MongoDB Git GitHub



chat-room-typescript's People

Contributors

shaharkamay avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.