diff --git a/_posts/2020-02-10-javascript-live-chat-tutorial-free-alternative-to-firebase.md b/_posts/2020-02-10-javascript-live-chat-tutorial-free-alternative-to-firebase.md index 16b5e95..6c1619b 100644 --- a/_posts/2020-02-10-javascript-live-chat-tutorial-free-alternative-to-firebase.md +++ b/_posts/2020-02-10-javascript-live-chat-tutorial-free-alternative-to-firebase.md @@ -10,9 +10,11 @@ The chat is offline-first and end-to-end encrypted. It is stored and propagated No signup of any kind required: just generate a key pair for the chat recipient. Optionally spin up your own free heroku instance to relay messages. **Cost $0**. -# 1. Include iris, gun and sea +# 1. Include gun, sea and iris -Sea is gun's cryptography library. +* [Gun](https://github.com/amark/gun): a decentralized database +* [Sea](https://gun.eco/docs/SEA): gun's cryptography library +* [Iris](https://github.com/irislib/iris-lib): a library for decentralized social networking ``` @@ -26,7 +28,7 @@ Sea is gun's cryptography library. var gun = new Gun({peers: ['https://gun-eu.herokuapp.com/gun']}) ``` -You can connect to someone else's gun node, or you can easily spin up one using Heroku or Docker. +You can connect to someone else's gun node, or you can easily [deploy your own](https://github.com/amark/gun#deploy). # 3. Create a key for the user (chat initiator) @@ -98,6 +100,8 @@ Feel free to inspect the element and override the stylesheet to match your site' Check it out on [Codepen](https://codepen.io/mmalmi/pen/bGddeqE) or [Github](https://irislib.github.io/iris-lib/example/chatbox/) -# Technical notes +# Notes Chats are persisted in users' browsers. Heroku nodes are ephemeral: their filesystem is reset once in a while. If you want to persist the chats on a server, you can add S3 storage to your heroku gun instance, or run a docker gun node. + +Disclaimer: Messages are e2e encrypted, but message timestamps currently aren't. In a decentralized network the timestamp and message author are visible to anyone. The library has not been security audited, so don't use it for privacy critical purposes.