Fireship · @fireship

Why my chat app broke… a cautionary tale

Uploaded December 22, 2022 · Length 5:33

Why my chat app broke… a cautionary tale

Summary

Fireship developer creates a chat app, but it gets overwhelmed by spam and hate speech, and he shares lessons learned on how to mitigate these issues.

  • chat app security
  • spam prevention
  • hate speech moderation
  • next.js
  • pocketbase
  • serverless

Transcript preview

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

  1. 0:00

    a few days ago I built a next-gen

  2. 0:02

    Discord killer with pocket base and

  3. 0:03

    svelt it was an amazing experience for

  4. 0:05

    about three minutes but then you guys

  5. 0:07

    completely destroyed it by spamming it

  6. 0:09

    with the most deranged comments I've

  7. 0:10

    ever seen on the internet I initially

  8. 0:11

    started with a five dollar Linux server

  9. 0:13

    its usage quickly shot up to 100 so I

  10. 0:16

    resized it to four cores that wasn't

  11. 0:18

    nearly enough juice either and all four

  12. 0:20

    cores quickly became overwhelmed and

  13. 0:21

    this is why we can't have nice things on

  14. 0:23

    this channel the primary person to blame

  15. 0:25

    for all this is me the developer I built

  16. 0:27

    it with bad security practices by Design

  17. 0:29

    just to see what would happen fun to do

  18. 0:32

    bad things luckily I live in America so

  19. 0:34

    I can't go to jail for the horrible

  20. 0:35

    things you guys said unlike other

  21. 0:37

    countries but nobody wants to use an app

  22. 0:39

    that can be spammed by an unlimited

  23. 0:40

    amount of hate speech and profanity this

  24. 0:42

    is a major problem when building any

  25. 0:44

    kind of app with user generated data in

  26. 0:46

    today's video we'll break down all the

  27. 0:48

    problems my app had and talk about tools

  28. 0:50

    and techniques you can use to mitigate

  29. 0:51

    these issues in your own projects the

  30. 0:53

    first problem is that people were using

  31. 0:55

    profanity even though I told them not to

  32. 0:57

    they didn't listen their language is

  33. 0:58

    offensive I thought this might have

  34. 0:59

    happen so I implemented a pooping system

  35. 1:02

    where if a comment gets pooped on five

  36. 1:04

    times it gets removed from the UI I've

  37. 1:06

    seen this feature on other platforms

  38. 1:07

    like Odyssey where you can slime a

  39. 1:09

    comment to death and I think it's a good

  40. 1:11

    idea but it doesn't really work for a

  41. 1:12

    chat where the messages are moving at

  42. 1:14

    100 miles an hour it can also be

  43. 1:16

    hijacked by the bad guys to poop down

  44. 1:17

    all the comments that are actually good

  45. 1:19

    so the next thing I did which is really

  46. 1:20

    easy to implement is just a bad word

  47. 1:22

    filter directly in the front end code

  48. 1:24

    that means the app can't display words

  49. 1:26

    like balls and so on you

  50. 1:28

    can also do filtering like this on the

  51. 1:30

    back end before that data ever goes to

  52. 1:32

    your database but it's impossible to

  53. 1:33

    catch everything with regular

  54. 1:35

    Expressions the trolls will find ways to

  55. 1:36

    say bad words with alternative

  56. 1:38

    characters that bypass your filters in

  57. 1:40

    modern times though artificial

  58. 1:41

    intelligence is starting to take over

  59. 1:43

    this job in Google developed perspective

  60. 1:45

    API which can detect if something is an

  61. 1:47

    insult or some variation of profanity

  62. 1:49

    and they use tools like this at scale to

  63. 1:51

    keep the worst of the worst comments off

  64. 1:53

    of YouTube bad words are one problem but

  65. 1:55

    an even bigger problem is when one

  66. 1:56

    person creates a script that

  67. 1:58

    automatically signs up new users and