I am front-end + PHP developer who is new to both Node + Express and Ember JS. I am used to MVC frameworks like CodeIgniter. I understand the folder structure of CodeIgniter well (where to put my views, CSS, controllers etc.) but I'm having a hard time trying to understand how to organize my Node + Express + Ember application. I want to understand how to structure the application.
I am just dumping an app created with the Ember CLI into the public folder in my Node + Express app. Is this the right way to do it? Also, this seems to be causing a bug with Ember Build.
Nagarjuns-MacBook-Pro:public nagarjun$ ember build
version: 0.0.40
Building
app/app.js: line 1, col 1, 'import' is only available in ES6 (use esnext option).
app/app.js: line 2, col 1, 'import' is only available in ES6 (use esnext option).
app/app.js: line 3, col 1, 'import' is only available in ES6 (use esnext option).
app/app.js: line 14, col 1, 'export' is only available in ES6 (use esnext option).
4 errors
app/router.js: line 1, col 1, 'import' is only available in ES6 (use esnext option).
app/router.js: line 11, col 1, 'export' is only available in ES6 (use esnext option).
2 errors
app/routes/sign-in.js: line 1, col 1, 'import' is only available in ES6 (use esnext option).
app/routes/sign-in.js: line 3, col 1, 'export' is only available in ES6 (use esnext option).
2 errors
===== 3 JSHint Errors
Built project successfully. Stored in "dist/".
When I load my project after running node bin/www
, I still only see the Express default layout. I have a lot of confusion as to how to organize my project also considering Express uses Jade templates in its own Views folder. Do I just ignore that folder?
I personally would suggest to take a slightly different approach: During development see your ember app more like a 3rd party client and develop it in a separate folder structure, so you get all the nice benefits of ember-cli and you don't mash up two MVC folder structures which can get messy quite quickly in my opinion.
So you would have a server
folder and a separate client
folder and then you either proxy your ember app, or treat your own API like a 3rd party API. For production then you simply build your whole Ember App and let your API Server serve the app.
Also instead of straight express I would recommend http://sailsjs.org/ which is built on top of express and gives a much better folder structure, somewhat comparable to ember and also has it's own cli.
That is what we at my company are using in production and I have also created a cli on top of sails and ember-cli, which we are using internally: https://github.com/artificialio/sane This might explain the folder structure and everything a bit better.