title: Working with Angular and Node best practices
body: <p>I am in the process of learning the MEAN stack, or PEAN stack (Postgres).  There are a lot of helpful tutorials online to get started but something still isn't clicking for me.</p>
  
  <p>From what I have gathered there are multiple ways to approach this.  I see tutorials that start a Node project, add Express, Angular etc in something like a client folder or whatever naming convention.  Then there are other tutorials that begin with an Angular project </p>
  
  <pre><code>ng new client
  </code></pre>
  
  <p>and then add some other modules that way.</p>
  
  <p>Where I am at now is I have a Node project using Express to build a rest API which is fine and working as intended.  Then I also have a client folder where I initialized an Angular project via </p>
  
  <pre><code>ng new client.  
  </code></pre>
  
  <p>What is odd to me is the need to start both servers (different ports) for the project.  </p>
  
  <p>Is this normal practice to approach the project like this?  Or is it preferable to include Angular within the node project and use Express sendFile to render the html files?  I am currently trying to use:</p>
  
  <pre><code>app.sendFile('app.component.html')
  </code></pre>
  
  <p>in Express and reference the app.component.html file in my Angular project.  This will render the button but does not apply any styling that should be applied from within the Angular project.</p>
  
  <p>If I run:</p>
  
  <pre><code>ng serve
  </code></pre>
  
  <p>on the Angular project from within the client folder, the same html page gets rendered properly with styling included.  </p>
  
  <p>Is it better to keep the client and the api separated thus forcing me to run something like (for development purposes)...</p>
  
  <pre><code>nodemon
  </code></pre>
  
  <p>To start the web server and accept requests... Then also run..</p>
  
  <pre><code>ng serve
  </code></pre>
  
  <p>To start the client and begin making calls?</p>
  
  <p>This is my first post so I hope it's not too subjective.  There isn't much information that I have found which covers this type of question in regards to the stack.  Most of the tutorials are simply code based and not theoretical.  Any help or advice on the subject would be greatly appreciated.</p>