Code Monkey home page Code Monkey logo

chat-sse's Introduction

Building a Resilient Chat Application with SSE, React, Redux, Express, TypeScript and Vite!

This is a chat application created as a small (yet fully functional) code example. Clients establish connections and receive new messages using the Server-Sent Events (SSE) protocol. For sending new messages and pinging, REST methods are employed since SSE does not support bidirectional communication.

Both the client and server are implemented in TypeScript. The server-side runs on Node.js and utilizes Express.

On the client-side, React, Redux, and CSS modules are utilized.

Please take note of the development environment setup using Vite. Vite was chosen for its ability to easily configure multiple entry points, including both the client and server components.

SSE (Server-Sent Events) was selected for its reliability. As it essentially establishes a simple GET connection, it functions across most web browsers. The downside is a limitation on the number of open connections, which is capped at just 6 across all tabs in your browser. However, for a basic example, this limitation is unlikely to pose any issues.

It should look similar

And yes! Don't forget to update .env.development for the production build. The VITE_API_BASE variable contains the URL to the API that the client uses.

chat-sse's People

Stargazers

Peter Wood avatar  avatar

Watchers

Alexander Bedenko 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.