www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Writing a scalable chat room service in D

reply =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig outerproduct.org> writes:
Finally published the article that I had prepared in autumn last year. 
It gives an overview of the basic functionality needed to implement a 
typical web application using vibe.d. The example uses Redis as a data 
store - using other storage solutions may be a good topic for a 
follow-up article.

https://vibed.org/blog/posts/a-scalable-chat-room-service-in-d

Reddit: 
https://www.reddit.com/r/programming/comments/3ze948/writing_a_scalable_chat_room_service_in_d/
Jan 04
next sibling parent reply Saurabh Das <saurabh.das gmail.com> writes:
On Monday, 4 January 2016 at 10:19:52 UTC, Sönke Ludwig wrote:
 Finally published the article that I had prepared in autumn 
 last year. It gives an overview of the basic functionality 
 needed to implement a typical web application using vibe.d. The 
 example uses Redis as a data store - using other storage 
 solutions may be a good topic for a follow-up article.

 https://vibed.org/blog/posts/a-scalable-chat-room-service-in-d

 Reddit: 
 https://www.reddit.com/r/programming/comments/3ze948/writing_a_scalable_chat_room_service_in_d/
Love the new (light) look of vibed.org! :)
Jan 04
parent =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig outerproduct.org> writes:
Am 04.01.2016 um 12:15 schrieb Saurabh Das:
 On Monday, 4 January 2016 at 10:19:52 UTC, Sönke Ludwig wrote:
 Finally published the article that I had prepared in autumn last year.
 It gives an overview of the basic functionality needed to implement a
 typical web application using vibe.d. The example uses Redis as a data
 store - using other storage solutions may be a good topic for a
 follow-up article.

 https://vibed.org/blog/posts/a-scalable-chat-room-service-in-d

 Reddit:
 https://www.reddit.com/r/programming/comments/3ze948/writing_a_scalable_chat_room_service_in_d/
Love the new (light) look of vibed.org! :)
Thanks! I felt that it was time to change it to something that better reflects the goals of the framework (fast, simple etc.). Still requires some tweaking for mobile phones and large screens, but it will get there.
Jan 04
prev sibling next sibling parent reply Bubbasaur <bubba gmail.com> writes:
On Monday, 4 January 2016 at 10:19:52 UTC, Sönke Ludwig wrote:
 Finally published the article that I had prepared in autumn 
 last year...
Neat but just one thing, when I click in the link on the Reddit, Chrome warns: " Your connection is not private Attackers might be trying to steal your information from vibed.org (for example, passwords, messages, or credit cards). NET::ERR_CERT_INVALID " So to proceed I had to take out the "s" from "http://" You should look over this, because some users maybe be afraid to proceed. Bubba.
Jan 04
parent reply =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig outerproduct.org> writes:
Am 04.01.2016 um 15:05 schrieb Bubbasaur:
 On Monday, 4 January 2016 at 10:19:52 UTC, Sönke Ludwig wrote:
 Finally published the article that I had prepared in autumn last year...
Neat but just one thing, when I click in the link on the Reddit, Chrome warns: " Your connection is not private Attackers might be trying to steal your information from vibed.org (for example, passwords, messages, or credit cards). NET::ERR_CERT_INVALID " So to proceed I had to take out the "s" from "http://" You should look over this, because some users maybe be afraid to proceed. Bubba.
Which browser did you use? It's a Let's Encrypt certificate, maybe that still has issues.
Jan 04
parent reply Bubbasaur <bubba gmail.com> writes:
On Monday, 4 January 2016 at 14:35:18 UTC, Sönke Ludwig wrote:
 Which browser did you use? It's a Let's Encrypt certificate, 
 maybe that still has issues.
"Chrome" - Like I said above "Chrome warns...". :) Here is more info about the warning: " vibed.org normally uses encryption to protect your information. When Chrome tried to connect to vibed.org this time, the website sent back unusual and incorrect credentials. Either an attacker is trying to pretend to be vibed.org, or a Wi-Fi sign-in screen has interrupted the connection. Your information is still secure because Chrome stopped the connection before any data was exchanged. You cannot visit vibed.org right now because the website sent scrambled credentials that Chrome cannot process. Network errors and attacks are usually temporary, so this page will probably work later. " Bubba.
Jan 04
parent reply =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig outerproduct.org> writes:
Am 04.01.2016 um 17:33 schrieb Bubbasaur:
 On Monday, 4 January 2016 at 14:35:18 UTC, Sönke Ludwig wrote:
 Which browser did you use? It's a Let's Encrypt certificate, maybe
 that still has issues.
"Chrome" - Like I said above "Chrome warns...". :)
Oh sorry, missed that. However, my tests with Chrome on Windows and Chromium on Linux were both successful. Maybe it's something specific to your OS/Chrome version? I do get a certificate validation error on my Blackberry browser, though. It seems that it doesn't trust the IdenTrust root certificate (DST Root CA X3).
 Here is more info about the warning:

 "
 vibed.org normally uses encryption to protect your information. When
 Chrome tried to connect to vibed.org this time, the website sent back
 unusual and incorrect credentials. Either an attacker is trying to
 pretend to be vibed.org, or a Wi-Fi sign-in screen has interrupted the
 connection. Your information is still secure because Chrome stopped the
 connection before any data was exchanged.

 You cannot visit vibed.org right now because the website sent scrambled
 credentials that Chrome cannot process. Network errors and attacks are
 usually temporary, so this page will probably work later.
 "

 Bubba.
Jan 04
parent reply Bubbasaur <bubba gmail.com> writes:
On Monday, 4 January 2016 at 17:02:01 UTC, Sönke Ludwig wrote:
 ...Maybe it's something specific to your OS/Chrome version?
Well, I tried again on the same machine but using Firefox and it worked, then I tried on my Tablet (Android/KitKat) using both Chrome and Native Browser and worked too. So I think It's something going wrong with Chrome here! Bubba.
Jan 04
parent Johannes Pfau <nospam example.com> writes:
Am Mon, 04 Jan 2016 17:15:36 +0000
schrieb Bubbasaur <bubba gmail.com>:

 On Monday, 4 January 2016 at 17:02:01 UTC, S=C3=B6nke Ludwig wrote:
 ...Maybe it's something specific to your OS/Chrome version? =20
=20 Well, I tried again on the same machine but using Firefox and it=20 worked, then I tried on my Tablet (Android/KitKat) using both=20 Chrome and Native Browser and worked too. =20 So I think It's something going wrong with Chrome here! =20 Bubba.
IIRC the letsencrypt people said in their 32c3 talk* that there might still be some issues with chrome. (chrome is probably caching something it shouldn't cache. Try clearing all caches) [*] https://media.ccc.de/v/32c3-7528-let_s_encrypt_--_what_launching_a_free_ca_= looks_like
Jan 04
prev sibling next sibling parent reply bachmeier <no spam.com> writes:
On Monday, 4 January 2016 at 10:19:52 UTC, Sönke Ludwig wrote:
 Finally published the article that I had prepared in autumn 
 last year. It gives an overview of the basic functionality 
 needed to implement a typical web application using vibe.d. The 
 example uses Redis as a data store - using other storage 
 solutions may be a good topic for a follow-up article.

 https://vibed.org/blog/posts/a-scalable-chat-room-service-in-d

 Reddit: 
 https://www.reddit.com/r/programming/comments/3ze948/writing_a_scalable_chat_room_service_in_d/
This is nice work. You've done a good job of showing the power of vibe.d. Something that comes to mind is that there is a lot of demand for self-hosted chat servers. Is there a possibility to make this into an example that works out of the box? By that, I mean someone could install vibe.d on a DigitalOcean server, type "vibe chat start" at the command line, and have a running chat service. That would lead to a lot of vibe.d installs, and then when they want to change something, they could jump into your tutorial and see how easy it is to do. To my knowledge, there is nothing like this available.
Jan 04
parent =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig outerproduct.org> writes:
Am 04.01.2016 um 16:01 schrieb bachmeier:
 On Monday, 4 January 2016 at 10:19:52 UTC, Sönke Ludwig wrote:
 Finally published the article that I had prepared in autumn last year.
 It gives an overview of the basic functionality needed to implement a
 typical web application using vibe.d. The example uses Redis as a data
 store - using other storage solutions may be a good topic for a
 follow-up article.

 https://vibed.org/blog/posts/a-scalable-chat-room-service-in-d

 Reddit:
 https://www.reddit.com/r/programming/comments/3ze948/writing_a_scalable_chat_room_service_in_d/
This is nice work. You've done a good job of showing the power of vibe.d. Something that comes to mind is that there is a lot of demand for self-hosted chat servers. Is there a possibility to make this into an example that works out of the box? By that, I mean someone could install vibe.d on a DigitalOcean server, type "vibe chat start" at the command line, and have a running chat service. That would lead to a lot of vibe.d installs, and then when they want to change something, they could jump into your tutorial and see how easy it is to do. To my knowledge, there is nothing like this available.
That would certainly work, I've uploaded each step of the tutorial to GitHub [1]. Something like "git clone https://github.com/rejectedsoftware/webchat-tutorial.git && dub --root=webchat-tutorial" should do it. However, there are a lot of details missing that would be desirable for a real-world application, such as adding time stamps, restricting history length, making a nicer UI and some kind of authentication or nickname stealing prevention. [1]: https://github.com/rejectedsoftware/webchat-tutorial/tree/master/tutorial
Jan 04
prev sibling next sibling parent reply Charles <csmith.ku2013 gmail.com> writes:
On Monday, 4 January 2016 at 10:19:52 UTC, Sönke Ludwig wrote:
 Finally published the article that I had prepared in autumn 
 last year. It gives an overview of the basic functionality 
 needed to implement a typical web application using vibe.d. The 
 example uses Redis as a data store - using other storage 
 solutions may be a good topic for a follow-up article.

 https://vibed.org/blog/posts/a-scalable-chat-room-service-in-d

 Reddit: 
 https://www.reddit.com/r/programming/comments/3ze948/writing_a_scalable_chat_room_service_in_d/
Wish I knew this was being worked on. I had something similar over at: http://wiki.dlang.org/User:Csmith1991/Vibe.d_Documentation/websocket
Jan 04
parent reply =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig outerproduct.org> writes:
Am 04.01.2016 um 16:20 schrieb Charles:
 On Monday, 4 January 2016 at 10:19:52 UTC, Sönke Ludwig wrote:
 Finally published the article that I had prepared in autumn last year.
 It gives an overview of the basic functionality needed to implement a
 typical web application using vibe.d. The example uses Redis as a data
 store - using other storage solutions may be a good topic for a
 follow-up article.

 https://vibed.org/blog/posts/a-scalable-chat-room-service-in-d

 Reddit:
 https://www.reddit.com/r/programming/comments/3ze948/writing_a_scalable_chat_room_service_in_d/
Wish I knew this was being worked on. I had something similar over at: http://wiki.dlang.org/User:Csmith1991/Vibe.d_Documentation/websocket
Oh, that indeed looks painfully similar. In any case, I'll link to it from the tutorials section. It uses the lower level APIs, so it's still interesting as an alternative implementation approach.
Jan 04
parent reply Jason Jeffory <JasonJeffory doodle.com> writes:
bad links in tutorial:

https://vibed.org/blog/posts/a-scalable-chat-room-service-in-d/vibe-web

registerWebInterface is the entry point to vibe.d's high-level 
web application framework. It takes a class instance and 
registers each of its public methods as a route in the URLRouter. 
By default, the method names are mapped to

I wonder if you could add a feature to vibe.d that checks for 
links that are out-dated? Maybe, ultimate, attempt to search for 
"feasible" substitutions instead of a 404 and present them to the 
user? Everyone hates 404's, right?
Jan 04
parent =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig outerproduct.org> writes:
Am 04.01.2016 um 18:33 schrieb Jason Jeffory:
 bad links in tutorial:

 https://vibed.org/blog/posts/a-scalable-chat-room-service-in-d/vibe-web

 registerWebInterface is the entry point to vibe.d's high-level web
 application framework. It takes a class instance and registers each of
 its public methods as a route in the URLRouter. By default, the method
 names are mapped to
Thanks, fixed now.
 I wonder if you could add a feature to vibe.d that checks for links that
 are out-dated? Maybe, ultimate, attempt to search for "feasible"
 substitutions instead of a 404 and present them to the user? Everyone
 hates 404's, right?
That would be difficult to do in the general case. Here, the mistake was in the Markdown syntax ([application framework](vibe-web) instead of [application framework][vibe-web]). Something to detect this could indeed be nicely built into the blog engine, but as a generic vibe.d feature it would be rather difficult to integrate in a nice way.
Jan 04
prev sibling parent reply Meta <jared771 gmail.com> writes:
On Monday, 4 January 2016 at 10:19:52 UTC, Sönke Ludwig wrote:
 Finally published the article that I had prepared in autumn 
 last year. It gives an overview of the basic functionality 
 needed to implement a typical web application using vibe.d. The 
 example uses Redis as a data store - using other storage 
 solutions may be a good topic for a follow-up article.

 https://vibed.org/blog/posts/a-scalable-chat-room-service-in-d

 Reddit: 
 https://www.reddit.com/r/programming/comments/3ze948/writing_a_scalable_chat_room_service_in_d/
This article seems what a lot of people on Hacker News would go for. Do you plan to submit it there as well?
Jan 04
parent reply =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig outerproduct.org> writes:
Am 04.01.2016 um 20:39 schrieb Meta:
 On Monday, 4 January 2016 at 10:19:52 UTC, Sönke Ludwig wrote:
 Finally published the article that I had prepared in autumn last year.
 It gives an overview of the basic functionality needed to implement a
 typical web application using vibe.d. The example uses Redis as a data
 store - using other storage solutions may be a good topic for a
 follow-up article.

 https://vibed.org/blog/posts/a-scalable-chat-room-service-in-d

 Reddit:
 https://www.reddit.com/r/programming/comments/3ze948/writing_a_scalable_chat_room_service_in_d/
This article seems what a lot of people on Hacker News would go for. Do you plan to submit it there as well?
If it fits, I definitely wouldn't mind that. I just don't have an account there, so if someone who does could post it that'd be nice. Otherwise I can create one, too, of course.
Jan 04
parent =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig outerproduct.org> writes:
Am 04.01.2016 um 21:21 schrieb Sönke Ludwig:
 Am 04.01.2016 um 20:39 schrieb Meta:
 On Monday, 4 January 2016 at 10:19:52 UTC, Sönke Ludwig wrote:
 Finally published the article that I had prepared in autumn last year.
 It gives an overview of the basic functionality needed to implement a
 typical web application using vibe.d. The example uses Redis as a data
 store - using other storage solutions may be a good topic for a
 follow-up article.

 https://vibed.org/blog/posts/a-scalable-chat-room-service-in-d

 Reddit:
 https://www.reddit.com/r/programming/comments/3ze948/writing_a_scalable_chat_room_service_in_d/
This article seems what a lot of people on Hacker News would go for. Do you plan to submit it there as well?
If it fits, I definitely wouldn't mind that. I just don't have an account there, so if someone who does could post it that'd be nice. Otherwise I can create one, too, of course.
Has actually already been posted a few hours ago (at pos. 302. currently, though).
Jan 04