Skip to content

Example of websocket React+Socket.io chat application

License

Notifications You must be signed in to change notification settings

sash-repo/react-chatio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

The app is based on:
React-Redux
Lodash (for react state updates, used instead of ramda and immutable.js)
Resock (middleware for transparent bypassing of socket.io events to react actions)
Socket.IO
NodeJS

How to use

To begin the development, run npm start in this folder.
To create a production bundle, use npm run build.
To build Docker image docker build -t chatio:latest .
To run Docker image docker run --rm -it -p 8080:8080 chatio:latest
and access it via browser on http://localhost:8080

Features I didn't make due to out of time

  • isLoading states
  • true authentication and ACL's
  • external storage for messages and messages state
  • use socket.io to isolate communication channels
  • schemas for events
  • templating/rendering for messages
  • performance optimizations: props bindings, state structure
  • caching layers
  • full test suite + eslint

Technical design considerations:

Backend is meant to be stateless component and synchronize state through external storage (AWS S3 or OpenShift Object storage). Each 'workspace/team' should have separate instance of backend.

This way chat service can have nice strategies for deployments and scaling challenges:

Diagram

Keeping state in S3 Buckets enable us versioning of state, HA. State should be stored using Event Sourcing pattern. This can be achieved either handling event sourcing on backend side or using serverless API like AWS Lambda to assemble latest state. Redis cluster should be used to pub/sub of updates when multiple backend instances push new events to the same state, so backends would update caches/current state.

This way we can have blue\green deployments and scale backends per workspace/team when we need that

About

Example of websocket React+Socket.io chat application

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published