title: AngularJS + sails.js
body: <p>I am developing an app that can utilize sails.js for back-end and AngularJS for Front-end. I thought that I'll create an Angular App using Yeoman-angular generator <a href="https://github.com/yeoman/generator-angular" rel="noreferrer">https://github.com/yeoman/generator-angular</a>, and once I am done with the front-end logic I'll create a sails app using,</p>
  
  <ol>
  <li>npm install -g sails</li>
  <li>sails new app</li>
  </ol>
  
  <p>And then I'll transfer all my AngularJS files to the Sails folder.</p>
  
  <p>But the thing is that AngularJS creates creates a folder hierarchy like this <a href="https://github.com/rishy/angular-jade-stylus-seed" rel="noreferrer">https://github.com/rishy/angular-jade-stylus-seed</a> and on running "grunt server" a "dist" folder is created which contains the final production version.</p>
  
  <p>On the other hand, after "sails new app" folder hierarchy for sails app is like.</p>
  
  <ul>
  <li>api
  
  <ul>
  <li>adapters/</li>
  <li>controllers/</li>
  <li>models/</li>
  <li>policies/</li>
  <li>services/</li>
  </ul></li>
  <li>assets
  
  <ul>
  <li>images/</li>
  <li>js/</li>
  <li>styles/</li>
  <li>favicon.ico</li>
  <li>robots.txt</li>
  </ul></li>
  <li>config/</li>
  <li>node_modules/</li>
  <li>views
  
  <ul>
  <li>home/</li>
  <li>403.ejs</li>
  <li>404.ejs</li>
  <li>500.ejs</li>
  <li>layout.ejs</li>
  </ul></li>
  <li>Gruntfile.js</li>
  <li>app.js</li>
  <li>package.JSON</li>
  </ul>
  
  <p>So, My questions are:</p>
  
  <ol>
  <li>Now, how do I transfer my Angular Files to this sails directory and how should I structure it?</li>
  <li>Since sails uses "sails lift" to start a server and angular uses "grunt server", which one of those should I use to start the server for my sailsJs + AngularJs app and what about the "dist" folder which is created after AngularJS?</li>
  <li>What changes will I have to make in the Gruntfile.js, since it should now contain the code from both Angular and Sails?</li>
  <li>Where should I keep my different views and style files and how should I access those form Angular or from Sails?</li>
  </ol>
  
  <p>I think lot of people are facing this similar problem since AngularJS and SailsJs are all the rage currently. There should be a robust boilerplate to create an AngularJS + SailsJS app, which sadly is missing right now.</p>