Challenge: Develop an IRC-like chat

Hey guys,

I’m looking for some ideas on how can I make a simple chat in a decentralized, SAFE way? An IRC-style chat: public open board, no history. It’s just a hypothetical exercise, not a real thing.

The app:

  • A screen with 3 sections:
    • a public board;
    • input to write messages;
    • list of online users;
  • It must not keep a history (it’s IRC-style, not Slack-style);
  • It must be free or almost free to send messages;
  • It must be internet-resource optimized: it’s not acceptable to make dozens of connections per second;
  • It must be scalable (workable with +50 users / +1M messages over its history);

Example:

  • Mechanism:
    • an Appendable Data (AD) for the room;
    • each user in the room has its own SD in order to write;
    • new message:
      • writes the message + timestamp in the SD;
      • add the SD to the room’s AD;
    • board updates:
      • read the AD and look for new appends;
      • polling rate: 1s;
  • Advantages:
    • few internet resources (1 read/sec);
    • doesn’t keep a history;
    • free (almost): it costs only 1 SD to join the room and talk unlimited;

A big problem with this approach though is that the room is limited to only 1k messages (due to the AD 100k max size limit). After that, no one is able to write new messages to the board.


Any ideas on how to implement a chat like this or on how to fix the above problem?

1 Like

I wish I was a master of AD / SD but not yet, so this was my best attempt at a chat app so far. Just uses simple NFS file commands for the messages