Fireship · @fireship

I built a decentralized chat dapp // GUN web3 Tutorial

Uploaded August 31, 2021 · Length 10:47

I built a decentralized chat dapp // GUN web3 Tutorial

Summary

Building a decentralized chat app using GUN web3 technology, similar to YouTube super chat, with user authentication and group chat functionality.

  • decentralized chat app
  • gun web3 tutorial
  • user authentication
  • group chat
  • web3 development
  • blockchain alternative

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    i recently built a chat app that can

  2. 0:01

    handle thousands of messages per second

  3. 0:03

    scales around the world and cost me

  4. 0:05

    nothing to run but the real weird thing

  5. 0:07

    about it is that the data and

  6. 0:08

    infrastructure is not controlled by a

  7. 0:10

    big tech company instead it's

  8. 0:12

    decentralized across the entire user

  9. 0:14

    base using web technologies in fact you

  10. 0:16

    can chat with me right now on the live

  11. 0:18

    demo by going to gunchatdap.web.app

  12. 0:21

    again that's

  13. 0:22

    gunchatdap.web.app and i'm trusting you

  14. 0:24

    not to hack it to pieces this time in

  15. 0:26

    today's video we'll build a

  16. 0:27

    decentralized chat app or dap if you

  17. 0:29

    prefer similar to youtube super chat

  18. 0:32

    using a library called gun js in the

  19. 0:34

    process you'll learn about the benefits

  20. 0:36

    of building a decentralized app along

  21. 0:38

    with the weird trade-offs and challenges

  22. 0:40

    for the front end ui we'll use svelt a

  23. 0:42

    javascript library that's not sponsored

  24. 0:44

    by big tech if you're new here like and

  25. 0:45

    subscribe and you'll find the full

  26. 0:47

    source code on github then i want to

  27. 0:48

    give a shout out to mark nadal the

  28. 0:50

    creator of gun js who donated a bunch of

  29. 0:53

    his time to answer all my questions and

  30. 0:54

    help make this video happen before we

  31. 0:56

    jump into the code let's first answer

  32. 0:58

    the question of how does this thing

  33. 1:00

    actually work i made a short video about

  34. 1:02

    gun js a few weeks ago and you guys had

  35. 1:04

    a ton of questions about it at a high

  36. 1:06

    level gun js is a decentralized graph

  37. 1:08

    database a normal database would store

  38. 1:10

    all of your data in a hard disk

  39. 1:12

    somewhere in the cloud it may be sharded

  40. 1:14

    across multiple machines but for all

  41. 1:15

    intents and purposes you can imagine

  42. 1:17

    your entire data set on a single disk

  43. 1:19

    gun on the other hand stores a small

  44. 1:21

    subset of data on each user based on the

  45. 1:24

    actual data that they consume in the

  46. 1:26

    application when a user makes a query

  47. 1:28

    for some data it will search across the

  48. 1:30

    network for other users that have that

  49. 1:31

    data and sync it up using technologies

  50. 1:34

    like webrtc so you can think of the

  51. 1:36

    entire database as the union of all

  52. 1:38

    peers on the network the idea is very

  53. 1:40

    similar to a blockchain ledger where no

  54. 1:42

    one individual has control of the entire

  55. 1:44

    network but it's important to point out

  56. 1:46

    that this is not blockchain technology

  57. 1:48

    which tends to be too slow and just

  58. 1:50

    unnecessary to build something like a

  59. 1:52

    super chat however it does rely heavily

  60. 1:54

    on cryptography to implement things like

  61. 1:56

    user authentication when you create a

  62. 1:58

    new user account a cryptographically