Giter Club home page Giter Club logo

ng-devstack's Introduction

ng-devstack v0.2.2

Everything a front-end developer needs to simplify building AngularJS applications.

Why ng-devstack?

This project has been inspired by another great concept ngBoilerplate, allowing to create modern web applications in AngularJS. It follows all the best practices introduced in ngBoilerplate such as component/feature-oriented directory structure, intelligent build system, etc. However, I decided to improve it a little bit and create my own boilerplate from scratch since I missed some basic features like:

  • watch for any file changes and apply them to the project in real-time,
  • image optimization,
  • remove redundant code on compiling output HTML,
  • plus ngBoilerplate hasn't been updated for months.

Now this all has been made possible. Please welcome ng-devstack!

Features

  • integration with gulp,
  • package management with Bower,
  • feature-oriented directory structure,
  • unit testing with Karma,
  • LiveReload fully handled server-side with NodeJS/Express (without installing additional extensions for browsers),
  • watch for file changes (scripts, styles, templates, assets) and apply them to the project on the fly,
  • caching AngularJS templates to avoid additional server requests,
  • pre-minifying AngularJS files to fix AngularJS' dependency injection upon minification,
  • support for SASS (including Twitter Bootstrap official SASS port),
  • support for JSHint,
  • JS/CSS/HTML minification,
  • remove logging (console.log(), etc.) from compiled JS code,
  • image optimization (see Additional Info for details),
  • html5Mode support (see Additional Info for details),
  • integration with UI Router & UI Bootstrap.

Requirements

  • Ruby
  • NodeJS
  • Bower

Installation

1. Install SASS:

$ gem install sass

2. Install gulp globally, which is giving access to gulp's CLI:

$ npm install gulp -g

3. Install gulp locally to the project with other required plugins:

$ npm install

4. Install required libraries:

$ bower install

Usage

To build the application simply type:

$ gulp build

For development purposes, run watch task to build and start local web server with LiveReload:

$ gulp watch

Deploy the production version by running gulp compile, or simpler:

$ gulp

Additional info

All styles (as well as scripts and templates) added to src/app/ and src/common/ should be included to the project automatically - except to src/sass/ folder. Files put into src/sass/ must be manually imported in src/sass/main.scss file (you may want to set custom order for loading your styles). If files located in src/sass/ are not imported in src/sass/main.scss, they will not work!

Vendor files downloaded with Bower can be added to project by editing 'vendor_files' section in config.json file. The rest of this file should remain unchanged.

If you would like to enable AngularJS HTML5 mode, you have to uncomment 2 lines in src/app/app.js and server.js:

  • src/app/app.js (don't forget to inject $locationProvider):
// $locationProvider.html5Mode(true);
  • server.js:
// app.use(require('connect-modrewrite')(['!\\.\\w+$ /index.html']));

In addition, image optimization is turned off by default but in case you need it, don't hesitate to remove comment from the following line in gulpfile.js:

// .pipe(plugins.imagemin({ optimizationLevel: 5, progressive: true }))

Known issues

  • Outdated libsass in node-sass. This is a main cause of a bug with compiling Twitter Bootstrap SASS to CSS (see this thread and this for details). Not a gulp-sass issue! Temporarily using Ruby version (slower but stable).

TODO

  • replace Ruby SASS compiler with NodeJS equivalent
  • add support for external sources in vendor files (http://*)
  • add source maps support for SASS & JS
  • add authorization service
  • improve images/SVG optimization

ng-devstack's People

Contributors

mariuszm avatar

Watchers

Juha Kalamies avatar

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.