Git Product home page Git Product logo

aichbauer / sabogr Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 1.0 3.12 MB

Angular+Sails+JWT-Authentication: Best Angular implementation for Sails. Features: Authentication with json web token. Frontend packages with bower, controlled by bower-installer. Angular pages for landing, home, profile, error. Backend models: User. Backend controllers: User, Auth with json web token

JavaScript 54.23% HTML 0.07% CSS 45.70%

sabogr's Introduction

Sabogr

####Sails Angular Bower Grunt #####Ready to use Sails Angular App with authentication

a Sails application template with AngularJS, Bootstrap.

Getting started

You need to have node, sails installed globaly. Node.js and Sails.js.

Go to your project or working directory and run the following command.

sails new yourProjectName

Now simply fork this repo and merge it.

Let bower-installer and grunt do the magic

Have bower, bower-installer installed globally. bower and bower-installer.

npm install -g bower and npm install -g bower-installer

assets folder

This folder is your public resource which gets pushed by the Gruntfile.js in you root folder into the .tmp folder. The .tmp folder is visible for your clients.

Run bower install and sails lift and your Sails.js, AngularJS app is ready.

Installing bower components

Inside of the assets folder you can now install new bower packages with

bower install package-name --save

Your packages are saved inside of the 'assets/bower_components' directory.

Load only the needed recources to .tmp

We use bower-installer to load the needed resources to our 'assets/_js', 'assets/_css' directory.

Call the following command in your assets folder

bower-installer

Every time you install new components run this command again.

Bower Installer does not load every file to my folder

If that is the case you can specify your file that is not loading into the right folder manually.

open the bower.json file in your assets folder.

Bootstrap.css does not load automatically in that folder so I configured it manually. If some packages you installed does not load automatically simply add your name and the path to your file under the bootstrap line (see example).

"sources" : {
      "bootstrap" : "bower_components/bootstrap/dist/css/bootstrap.css",
      "example": "bower_components/example/css/example.css"
    }

Run bower-installer again.

Sails lift grunt tasks

What happens when you sails lift your server?

When you run grunt or sails liftthe Gruntfile.js in your root directory gets executed.

Which files and in what order your files should get loaded are defined in the pipeline.js in your tasks folder.

The author changed the files which should get loaded in this file and in that order that your angular app will work instantly. Also our own styles, which live in our assets/style folder are loaded to the .tmp folder.

// The CSS files from our bower components
var cssFilesToInject = [
  '_css/**/*.css',
  'style/**/*.css'
];

// The Js files from our bower components
//And our Angular application
var jsFilesToInject = [

  // Dependencies like Angular and Bootstrap are brought in here
  '_js/angular/*.js',
  '_js/jquery/*.js',
  '_js/bootstrap/*.js',
  '_js/**/*.js',

  //load our application init file and all modules for angular
  'src/app/*.js',
  'src/modules/**/*.js',

  // All source files for angular are inside here
  'src/**/*.js',
  'src/*.js',

];

sabogr's People

Contributors

aichbauer avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

okusnadi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.