I am new to nodejs and a little confused about the distinction between the server and client side html pages. My goal is to build an e-commerce web store for practice. The stack that I want to try is NodeJS + Express + MongoDB + AngularJS. The basic structure I have right now is as below.
shoppingMall
..bin
..data
..node_modules
..public
....images
....javascripts
....stylesheets
..routes
....index.js
....users.js
..views
....index.jade
....layout.jade
..app.js
..package.json
Here is my logic. The files inside views are html pages that are rendered from server. Javascript files inside public/javascripts/ are rendered on client. I have to include AngularJS inside layout.jade, and any client code related to the index page should go to public/javascripts/index.js and I must include this file from index.jade. Then, the html page is rendered from server using a jade template engine, and any further user interaction is done from client. Any server-side logic related to index.jade must go to routes/index.js and the code that lives inside this file will not be shown to client.
Q1. Is my logic correct?
Q2. Assuming I am trying to keep it up as an MVC structure, which parts correspond to M, V, C in this case?