Sails.js as the backend

I just put up my Sails-Ember-Blueprints in a repository: https://github.com/mphasize/sails-ember-blueprints

Check them out and let me know what you think.

I am still trying to figure out, how I could package the blueprints in a way to make them maintainable and testable. I asked around on the Sails IRC channel and it might be possible to turn the blueprints into a Sails generator, but I am not sure how to do that yet.

Anyway - feedback welcome!

Arenā€™t blueprints only good for prototyping? Eventually, youā€™re going to need custom logic in your controller actions and therefore end up overwriting the blueprint implementations. Iā€™m curious how you will move passed this hurdle? It almost sounds like there needs to be a custom adapter / serializer on the Ember side of the fence and not at Sails.

Or perhaps a Sails service that serializes incoming / outgoing JSON communications?

Curious to see your thoughts!

  • Patrick

That does look great, I will take a will take a look over the next couple days, though I have just overwritten the find.js and findone.js so far.

@nani I am still just in the getting started phase with sails, but as far as I understood that is exactly the intention of bluebrints, see here:

and

@marcus Thank you for putting the repo together, now that I have actually got to work with sails and you have already done most of the heavy-lifting I could start much quicker. Based on the project I worked on and your blueprints I created an ember-sails starter kit: https://github.com/artificialio/sails-ember-starter-kit Check it out.

Also I think it would be great to see this merged into sailsjs as an --ember option or something similar. Could I just use your code to get started writing a PR?

Hereā€™s a simple project I created for a simple sailsjs code demo Iā€™ll be doing at the LA NodeJS meetup, https://github.com/dlai0001/la-sails-meetup-game/tree/lesson/1

Iā€™ve also shimmed in some code on some of the pub/sub related adapter methods. My fork of the adapter can be found here, https://github.com/dlai0001/ember-data-sails-adapter

@GlobeCoder The starter kit looks interesting. When Iā€™m back from holidays, Iā€™m going to give it a spin. An `ā€“emberā€™ option in Sails is something I would highly appreciate, but apart from putting together the blueprints, Iā€™m not sure how much time I have to invest into that, so go ahead ā€“ I would be happy if you can make use of some of my stuff.

hi, do you have a link to this app, is it open source?

As a Rails developer Iā€™ve been watching Sails and am impressed with their architectural choices, in particular Policy Objects which are implemented by the underrated Pundit gem in Rails. This pattern handles arbitrary complexity in permissions by injecting all you need to know into the object for you (user, subject, attempted action) and then you implement the logic to determine whether the action should be allowed.

It also handles multiple data stores, an example where they are attempting to leapfrog Rails.

So one day I may well use Sails over Rails.

Hi, Did anyone try using sailsjs as an API for Ember 2.0?

Ember-Data 2 now recommends using the JSONAPISerializer, which supports the jsonapi.org

So it seems to comes down to making sailsjs jsonapi.org compatible.

Are there any jsonapi-compatible blueprints for Saills.js?

Ember-Data 2 now recommends using the JSONAPISerializer, which supports the jsonapi.org

You can still use the RESTAdapter/RESTSerializer.

@elithrar Thanks. Well, yes of course I can still use RESTā€¦ I was just wondering about sails.js support for jsonapi.

But maybe this question belongs more to a Sails forumā€¦ so sorry about thatā€¦

It seems like there is some work on this, but itā€™s not production ready yet: https://github.com/IanVS/sails-hook-jsonapi

Thanks! Iā€™ll keep an eye on that one