Skip to content

Commit

Permalink
Merge branch 'release/0.7.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
balthazar committed Feb 8, 2015
2 parents 2b38819 + 953db19 commit c37d351
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 17 deletions.
43 changes: 32 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,29 @@
* **NO** pre-install for Google Analytics — *Wanna track people? Do it yourself.*
* **Livereload** on changes in client / server — *You don't have time to waste.*
* **JSHint** integration — *Write clean code, for purpose.*
* **Sass** support — *Because CSS is a mess.*
* **Fast build***You do faster? Let's see that.*

Optional:

* **sockets**, with [socket.io](https://github.com/Automattic/socket.io) and [angular-socket-io](https://github.com/btford/angular-socket-io)
* **authentication system**, with [Passport](https://github.com/jaredhanson/passport)
* **MongoDB**, with [Mongoose ODM](https://github.com/learnboost/mongoose)
* **mocked backend**, with [Restock](https://github.com/42Zavattas/Restock.io)

[Demo of generated project](https://github.com/42Zavattas/bangular-demo)

# Install

npm install -g yo generator-bangular
npm install -g generator-bangular
yo bangular

### Table of contents

### Sockets

To use the sockets, you have to confirm the option on project generation.
Yet, it's only when you've selected the mongo backend that you can be prompted by this config.

This will initialize all the server part and create a `Socket` factory in the client.
On each new `api` you create, you can choose to load the sockets for this model.
It will then emit socket events on update and remove of documents of this model.

The sockets can be quickly usable in your controllers, [here is an example](https://gist.github.com/Apercu/9cd8b4b332948dc833f0) with a simple user.
- [Manage project](https://github.com/42Zavattas/generator-bangular#manage-project)
- [Generators](https://github.com/42Zavattas/generator-bangular#generators)
- [Features](https://github.com/42Zavattas/generator-bangular#features)
- [Architecture](https://github.com/42Zavattas/generator-bangular#architecutre)

# Manage project

Expand Down Expand Up @@ -139,6 +143,23 @@ The **name** parameter is required. This will create a new `.scss` file in he `c

The **name** parameter is required. A **name** folder will be created at `server/api/`.

# Features

### Sockets

To use the sockets, you have to confirm the option on project generation.
Yet, it's only when you've selected the mongo backend that you can be prompted by this config.

This will initialize all the server part and create a `Socket` factory in the client.
On each new `api` you create, you can choose to load the sockets for this model.
It will then emit socket events on update and remove of documents of this model.

The sockets can be quickly usable in your controllers, [here is an example](https://gist.github.com/Apercu/9cd8b4b332948dc833f0) with a simple item.

### Passport

On project generation, you can integrate passport authentification in your app. It will create default views for the signup and login. You can easily protect your routes for a connected user by adding the `isAuthenticated` middleware on it.


# Architecture

Expand Down
10 changes: 5 additions & 5 deletions app/templates/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,13 @@ gulp.task('serve', ['watch'], function () {
if (!openOpts.already) {
openOpts.already = true;
gulp.src('client/index.html')
.pipe($.wait(500))
.pipe($.open('', openOpts));
} else {
setTimeout(function () {
$.livereload.changed('/');
}, 1000);
}
})
.on('restart', function () {
gulp.src('client/index.html')
.pipe($.wait(250))
.pipe($.livereload());
});
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generator-bangular",
"version": "0.7.0",
"version": "0.7.1",
"description": "Generate and serve your project in a blink of an eye",
"license": "BSD",
"homepage": "https://github.com/42Zavattas/generator-bangular",
Expand Down

0 comments on commit c37d351

Please sign in to comment.