sahat/ember-sass-express-starter

Very simple Boilerplate

Opened this issue · 6 comments

The only question I have is that ember tools is now using grunt. But I have been looking into http://gulpjs.com/ its seems much easier then GRUNT. Also with your boilerplate have you ever thought of creating a sequelizejs version

Ember Tools
https://github.com/rpflorence/ember-tools/tree/loom

I could add an optional sequelize.js version of app.js, called app-sequelize.js, but that will require an extra additional step from the user - to remove this line from javascripts/config.app.js which is added to make Ember work with MongoDB, in particular to map _id to id field:

App.ApplicationSerializer = DS.RESTSerializer.extend({
  primaryKey: '_id'
});

As for Gulp yes I have heard of it. I will in fact use to replace Grunt in this project https://github.com/sahat/requirejs-library. I am using Grunt for only two things there so it would be easy to replace it. Ember-Tools - not so much. I actually really dislike they are using Grunt because compilation takes too long if you include all JavaScript files into Ember config/app.js. That's why I took out all these libraries and placed them into index.html as separate files so they are not minified and concatenated each time by ember-tools:

  <script src="javascripts/vendor/jquery.js"></script>
  <script src="javascripts/vendor/sass-bootstrap.js"></script>
  <script src="javascripts/vendor/handlebars.js"></script>
  <script src="javascripts/vendor/ember.js"></script>
  <script src="javascripts/vendor/ember-data.js"></script>
  <script src="javascripts/vendor/ember-simple-auth.js"></script>
  <script src="javascripts/application.js"></script>

So for now, until ember-tools moves to Loom completely or if I decide to re-write ember-tools in Gulp.js, you should move all those vendor libraries into config/app.js right before deployment to production to have one minified filed application.js. You could move it and keep it there too, if you like, as long as you don't mind waiting a few seconds each time you make a new change in one of the javascript files.

I can help doing a re-write in gulp. Not sure how hard the implementation would be. It would be cool to see a sequalize version of this. Or If you point me in the right direction I can implement a sequalize version of this. By the way you are right Ember App Kit is way complicated. These things should be simple not over complicated.

@kyoukhana I was able to implement POST, GET, UPDATE, DELETE routes with Sequelize, but I am not sure how to proceed with pre-save hooks.

Currently I am using mongoose's presave hook to generate a password salt using bcrypt.

I also need a comparePassword custom method on the User model to check if the user's password matches encrypted password stored in the database.

That's the last thing which is holding me back with this Sequelize port. If you know Sequelize well, your help would be appreciated.

So you need a default password generated with Seuqalize. Also compare password. Do you have a repo setup so i can take a look. Right now i am trying to wrap my head around ember-tools

When you get a chance take a look at the repo I have put together

https://github.com/kyoukhana/nodeember

I basically used ember-tools. But now I can't seem to get it working when i hit the application. I just need a direction as to what I am doing wrong and a better direction of your repo and the structure. We should be able to
render .hbs template files insted of jade. In your app.js you can include

app.js

var hbs = require('express-hbs');
app.set('view engine', 'hbs');

But the problem with this ember doesn't see this

@kyoukhana Typically you would place your ember app inside public folder including index.html. index.html will be loaded by default if you haven't overriden it with a:

app.get('/', function(req, res) {

});

There are many different ways that people use single page applications with server-side web frameworks. Some like to keep completely separate, others like to render templates on the server for SEO. I am not familiar with the second approach. Usually my SPA is completely separate from the server. I place it inside public folder and communicate with the server via JSON.