File: README.md

Recommend this page to a friend!
  Classes of Alien Fernandez   Seed Sails Angular   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Seed Sails Angular
Full stack framework based on Sails, Node, Angular
Author: By
Last change: Update of README.md
Date: 3 years ago
Size: 8,354 bytes
 

Contents

Class file image Download

Seed-sails-angular-es6 is a full-stack JavaScript open-source solution based in new version of javascript for the client side, which provides a solid starting point for Sails.js, Node.js, React.js and AngularJS based applications. The idea is to solve the common issues with connecting those frameworks, build a robust framework to support daily development needs, and help developers use better practices while working with popular JavaScript components.

Before You Begin

Before you begin we recommend you read about the basic building blocks that assemble a Seed-sails-angular-es6 application: * Sails.js - The best way to understand sails.js is through its Official Website, Sails is the most popular MVC framework for Node.js. It is designed for building practical, production-ready Node.js apps in a matter of weeks - not months * AngularJS - Angular's Official Website is a great starting point. You can also use Thinkster Popular Guide, and the Egghead Videos. * Node.js - Start by going through Node.js Official Website and this StackOverflow Thread, which should get you going with the Node.js platform in no time. * React.js - A javascript library for building user interfaces React.js Official Website.

Prerequisite Technologies

Make sure you have installed all of the following prerequisites on your development machine:

Linux

If you're using ubuntu, this is the preferred repository to use...

$ curl -sL https://deb.nodesource.com/setup | sudo bash -
$ sudo apt-get update
$ sudo apt-get install nodejs

Windows

OSX

  • Node.js - Download and Install Node.js or use the packages within brew or macports.
  • git - Get git from here.

Prerequisite packages

  • Seed-sails-angular-es6 currently uses Grunt as a build tool and Jspm to manage frontend packages.
  • Gulp - You're going to use the The JavaScript Task Runner to automate your development process. Make sure you've installed Node.js and npm first, then install grunt globally using npm:
$ npm install -g grunt-cli

$ npm install -g jspm

$ npm install -g sails

Cloning The Repository

The recommended way to get Seed-sails-angular-es6 is to use git to directly clone the Seed-sails-angular-es6 repository:

$ git clone https://github.com/alienfernandez/seed-sails-angular-es6

Quick Install

Once you've downloaded the boilerplate and installed all the prerequisites, you're just a few steps away from starting to develop your MEAN application.

The first thing you should do is install the Node.js dependencies. The boilerplate comes pre-bundled with a package.json file that contains the list of modules you need to start your application. To learn more about the modules installed visit the NPM & Package.json section.

To install Node.js dependencies you're going to use npm again, when npm packages are installed will be installed jspm packages automatically. In the application folder run this in the command-line:

$ npm install

This command does a few things: * First it will install the dependencies needed for the application to run. * If you're running in a development environment, it will then also install development dependencies needed for testing and running your application. * Finally, when the install process is over, npm will initiate a jspm install command to install all the front-end modules needed for the application

Running Your Application

After the install process is over, you'll be able to run your application using npm, just run:

$ sails lift

Your application should run on port 1337 with the development environment configuration, so in your browser just go to http://localhost:1337

That's it! Your application should be running. To proceed with your development, check the documentation of sails.js.

Running in Production mode

To run your application with production environment configuration, execute npm as follows:

$ npm run prod

...And Keep It Lifted You will want to use a tool like pm2 or forever to make sure your app server will start back up if it crashes. Regardless of the daemon you choose, you'll want to make sure that it starts the server as described above.

Using pm2:

$ pm2 start app.js -x -- --prod

Using forever:

$ forever start app.js --prod

Troubleshooting

During installation depending on your os and prerequisite versions you may encounter some issues.

Most issues can be solved by one of the following tips, but if you are unable to find a solution feel free to contact us via the repository issue tracker or the links provided below.

Update NPM, Jspm or Gulp

Sometimes you may find there is a weird error during install like npm's Error: ENOENT. Usually updating those tools to the latest version solves the issue.

  • Updating NPM:
    $ npm update -g npm
    
  • Updating Gulp:
    $ npm update -g gulp
    
  • Updating Jspm:
    $ npm update -g jspm
    

Cleaning NPM and Bower cache

NPM and Bower has a caching system for holding packages that you already installed. We found that often cleaning the cache solves some troubles this system creates.

  • NPM Clean Cache:
    $ npm cache clean
    
  • Jspm Clean Cache:
    $ jspm cache-clear
    

Sample Application

The sample application is a simple Articles create, read, update and destroy (CRUD) web site.

Client-side

  • AngularJS - Single Page Applications (SPAs), declarative templates with data-binding, MVW, MVVM, MVC.
  • Bootstrap 3 - Powerful mobile first front-end framework for faster and easier web development.
  • React.js - Building user interfaces, use React as the V in MVC.

Server-side

  • Sails.js Sails is the most popular MVC framework for Node.js.
  • Passport Authentication middleware for Node.js, extremely flexible and modular.

Data Storage

  • Sails bundles a powerful ORM, Waterline, which provides a simple data access layer that just works, no matter what database you're using. In addition to a plethora of community projects, officially supported adapters exist for MySQL, MongoDB, PostgreSQL, Redis, and local disk.

Tools

  • Grunt - The JavaScript Task Runner, build system automating tasks: minification and copying of all JavaScript files, static images, etc.
  • Jspm - Package manager for the SystemJS universal module loader.
  • Babel - Transpiler for JavaScript best known for its ability to turn ES6.

Credits

License