Home

Awesome

NOT MAINTAINED. SEE POST MORTEM

repo-banner

<p align="center">Add anonymous ephemeral real-time chat to any webpage.</p> <br>

Overview

disco.chat adds anonymous ephemeral real-time chat to any webpage. It's a mashup of Twitch's chat and Intercom's customer service chat widget.

<img width="600px" src="https://user-images.githubusercontent.com/4060187/41812799-e9462304-76f7-11e8-957d-251403512978.png" alt="Disco.chat example">

Why?

The Rules

Chat anonymously and ephemerally with other readers.

Post mortem

Although I did actually deploy this on one article on my dad's blog, I stopped working on this side project. A company called Spot.im does pretty much the same thing.

This was my first time writing 3rd-party JS, working with iframes, and websockets. There are some bits of code that I am particularly proud of which you may find useful:

Vision / Roadmap

Developing Locally

Structure

The project's root is the API at the moment. It's source can be found in ./src.

In ./web, you'll find the React x TypeScript chat application and in web/sdk/disco.js, you'll find the 3rd party JS. The rollup watch task (yarn sdk), will conveniently output the sdk js into the ./web/public directory (this is the public directory of the create-react-app app), thus it is served up by react-scripts-ts's webpack dev server at localhost:3000/disco.dev.js during development.

Installation

yarn install && cd web && yarn install && cd .. 

Running the app(s)

Open 3 terminal tabs....

yarn start # 1. start the API
cd web
yarn start # 2. start the application (chat UI)
yarn sdk # 3. develop the sdk (./web/sdk/disco.js)

You can either develop the chat app at localhost:3000. However, you can get the full end-user experience by going to localhost:5000 and localhost:5000/about during development. These serve the 2 HTML pages ./public/about.html and ./public/index.html. These are meant to mimic how the sdk is used by a 3rd-party site. Feel free to change them as you wish to simulate more real world usage.