Hi! I'd like to share a pet project of mine, an anonymous chat service called Cannon: https://cannon-chat.online
It's a chat that's designed to mimic real-life talk. There is no registration and no history—just like in real life.
Apart from Nim, I use JS for the service worker and Python for the push service.
I won't share the code at this point but I'm ready to answer any questions regarding writing SPA in Nim or anything else really.
Who can i talk to?
My link is:
Messaged you. Did you get it?
no but I imagine I should be connected to receive it right? I tried now but what I see is that as soon as I send the message it is not even recorded on my side. is that because you did not receive it and so the message is not recorded in the conversation?
very cool work @moigagoo!
Can't service workers be written using Nim?
Sure. I actually wrote the service worker in Nim at first.
However, at some point I noticed I'm just wrapping JS code in Nim. So I just switched to JS.
And what about the push service?
My push service is written in Python only because there's a ready to use lib for WebPush for Python (https://github.com/web-push-libs/pywebpush) and there is none for Nim.
Writing one from scratch would take a lot of time so I just wrote this part in Python. But Nim was my forst choice of course.
However, it works best on Android where you can install it directly Chrome and use as a regular app.
Hi everyone!
To celebrate NimConf 2024, I've opened the code for Cannon: https://gitflic.ru/company/cannon-chat.
The deployment instructions are in this repo: https://gitflic.ru/project/cannon-chat/cannon.
The SPA app built with the 3K stack (Karax, Kraut, Karkas) is in https://gitflic.ru/project/cannon-chat/client.
P.S. Unfortunately, the code hosting service I've been using doesn't yet offer interface in English, but it's more or less the same as GitHub so navigating through code and cloning the repos shouldn't be an issue.
Thanks for making the source for Cannon available. That will help a lot if trying to learn this stack. A license might be nice too. BTW, my firefox has a mystery translator in it's address bar that worked great for the gitflic.ru interface.
Your NimConf 2024 talk was interesting and is making me more likely to try karax. The sound was a little rough. Perhaps you were recording from a submarine? :) The youtube closed captioner was having trouble with it too.
You probably could have done another 15 minutes on a high level overview of Cannon. I would have been glad to watch it anyway. :)
Some example topics to cover:
-- Is there dynamic updates between components like the mentioned js frameworks, or Signals?
-- Do changes to the backend via api from one client get updated on other clients somehow? Since it's a chat app i guess that's happening somehow. :)
-- What data is stored where and why? I see client side indexedDB and the backend DB with the API. I haven't gone through it yet. Just mentioning as a topic.
Basically, Cannon's design, rationale, and how it went with these design elements/parameters using this stack. Performance notes, etc.
Anyways. Thanks for the talk and the code. I'll hopefully try it out one day soon-ish.
Thanks for the feedback. I'll add the license, good point.
Making a video on Cannon specifically sounds like fun, I'll try and make one.
And sorry about the sound, I didn't expect it to be that lame 😔 I was recording on a built-in MacBook mic, which normally sounds pretty well.
The sound was a little rough. Perhaps you were recording from a submarine? :) The youtube closed captioner was having trouble with it too.
You can read the entire talk text in the speaker notes: https://github.com/moigagoo/nimconf2024/tree/develop/src/nimconf2024/slides