##Overview SANE - A Sails and Ember Starter Kit that will help you get started with rapid Web App prototyping and development. It includes, what are in our opinion the best tools for backend and frontend development. They will save you an immense amount of time, make development smoother and deliver the best results that work optimally across multiple devices.
So what exactly does this kit include?
- A sane folder structure so you can develop server and client seperately, but they integrate smoothly
- A SailsJS Vagrant Box coming with PM2, MongoDB, MySQL and Redis all set-up to work properly - though you could as easily run it without Vagrant if that's not your thing.
- Using ember-cli in the
client
folder, already set-up, using the latest 0.0.42 version. In addition we are already including sass and foundation to get started quickly with frontend styling.
To find out more about Sails and Ember and how they work together, you can take a look at my talk http://vimeo.com/103711300 and slides http://talks.artificial.io/sailing-with-ember/
##Quickstart
- Clone this project
- To get the server up: Run
vagrant up
, once it's all donevagrant ssh
, cd into~/server
and runnpm install
- Run
sails lift
to get the server started onlocalhost:1337
- In the
client
folder runnpm install && bower install
- Run
ember serve
to get the dev server with auto-reload running onlocalhost:4200
- So in dev-mode simply think of your ember app as you would of any other client, for example an Android app.
##Deployment
Note: We have quite considerably improved and automated the deployment experience using PM2 Deploy. Have a look into the ecosystem.json
. The readme will be updated soon.
pm2 start app.js -x -- --prod
in/server
starts sails in production mode on port 80ember build --environment=production && cp -rf dist/* ../server/assets/ && cp -f dist/index.html ../server/views/index.ejs
.- That builds the app and copies it over to be included with Sails.
pm2 restart app -x
so Node can pick up the latest changes
Note: If you are using Node v0.11.x you can run pm2 start app.js -- --prod
(without the -x
) and then you just need pm2 reload app
to reload the server with 0s downtime.
The Server is configured to serve the Ember App on all routes, apart from the api/**
routes, so Ember itself can take full control of handling error routes, etc.
For more information on deployment and different strategies check out:
- The Sails Documentation to read up about some fundamentals
- PM2 Deploy gives you some nice command line tools to ease deployment
- Ember-CLI Deploy for deployment via Redis and Amazon S3
##Thanks
Thanks to mphasize for creating sails-ember-blueprints which overwrites the default SailsJS JSON response to the one that Ember Data's RESTAdapter
and RESTSerializer
expects.
##Contribution Everyone is more than welcome to contribute in any way: Report a bug, request a feature or submit a pull request. Just keep things sensible, so we can easily reproduce bugs, have a clear explanation of your feature request, etc.
##License Sails-Ember Starter Kit is MIT Licensed.