Sunday, 10 February 2019

Node project structure

So I'm rather new with Node JS and I'm making a chat app to get used to both, Node and Websockets.Working on it I was wondering how to effectively organize the different classes and modules and so on.As for now I have the frontend and backend projects in one, so I plan on making two different projects, one for client side and one for the backend side, although right now both are based on the same server variable (both are served through express and http). I guess I'll just have to use one port for serving my HTTP files and another port for listening to sockets, correct?Another question I have is how are node projects organized? I plan on having different classes in the backend project for the User and Room objects, and also I would like to separate the server setup (http/express) from the server socket logic. But I'm completely lost on this matter.According to Googlin' I should have a src directory with the code of my project - ok cool, but should I put my classes there? What is the model directory for, just mocked data or default data? I don't plan on having anything else than the code, so what are other directories for?

Submitted February 10, 2019 at 10:14PM by DreamOfAWhale

No comments:

Post a Comment