angular-sails-seed icon indicating copy to clipboard operation
angular-sails-seed copied to clipboard

A barebones boilerplate of AngularJS SPA + Sails.js

Boilerplate for AngularJS + Sails.js

Why?

Modern web applications has separated front- and backend sides to use. This boilerplate present one way to make your application which have fully separated back- and frontend sides.

Main goals of this boilerplate

  • Separate back and front development apps
  • Authenticate with backend (possible multiple ways: local, github, twitter, etc.)
  • WebSockets
  • Minimal - I hate bloated boilerplates

Setup

npm install bower -g
npm install sails -g
  1. Frontend landing page: /frontend/src/app/index.html
  2. Backend URL: io.sails.url (customize in frontend/config/config.json)
  3. Copy /backend/config/local_example.js to /backend/config/local_example.js and customize
  4. Install Dependencies: npm install (runs npm/bower install from frontend and backend folders)

Running

You have to start both backend and frontend servers to run this project. These can be started

Backend

cd backend
sails lift

Frontend

In Development:

cd frontend
gulp serve

In Production:

cd frontend
gulp dist
gulp production

Resources

  • Sails.js, http://sailsjs.org/
  • AngularJS, https://angularjs.org/
  • AngularUI Router https://angular-ui.github.io/ui-router
  • Json Web Tokens, http://angular-tips.com/blog/2014/05/json-web-tokens-examples/

Author

Dean Sofer
Tarmo Leppänen

License

The MIT License (MIT)

Copyright (c) 2014 Tarmo Leppänen

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.