This weekend I was trying to understand how socket.io works. And searching for a good file structure that I can follow. And I found this blog/article. Its really helpful. Here are the key points.- 1. Respect a naming standard. 2. Use of handlers. 3. Validate your events using joi - ( a validation library ). 4. Add an extra layer of helpers. Here is the link of the article if you want to read in deep.
Download the medial app to read full posts, comements and news.