Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/binocarlos/generic-digger-app

A template for digger apps
https://github.com/binocarlos/generic-digger-app

Last synced: 11 days ago
JSON representation

A template for digger apps

Awesome Lists containing this project

README

        

generic-digger-app
==================

A generic app that combines the following:

* digger(server/client) - for general database storage
* gandalf/shadowfax - for user logins
* admin panel - for user management

## usage

Install:

```bash
$ npm install
```

Build:

```bash
$ make build
```

Run:

```bash
$ make dev
```

## run

To run with the debug module turned on:

```
$ sudo DEBUG=* node index.js
```

### HTTP routes
The main HTTP routes are defined in `lib/router.js`

You can setup the server side login from there.

Control user accounts from the [gandalf](https://github.com/binocarlos/gandalf) api.

The `gandalf.session()` handler can be used to ensure a user session for a route.

### Angular Apps
To write an angular page you need to create a `page` folder in `www/pages`

Then - in the `index.js`:

#### module
```js
var angular = require('angular-bsfy')

var app = angular.module('MyModule',[

])
.controller('MyController', function($scope){

$scope.test = 'hello'

})
```

#### Makefile
Then you add the page to the `pages` step in the Makefile:

```
browserify \
www/pages/home/index.js \
www/pages/register/index.js \
www/pages/mypage/index.js \
-p [ factor-bundle \
-o www/build/home.js \
-o www/build/register.js \
-o www/build/mypage.js \
] \
-o www/build/common.js
```

Then you add a HTML file pointing to the `command` and `mypage` (or whatever your new app is called):

#### HTML
```html







```

#### Debugging

The client side code has the debugger plugged in.

To enable client debugging (in Chrome for nice colors) - open the development console and type:

```
debug.enable('*')
```

Or to only debug a certain section:

```
debug.enable('libs:*')
```

To disable logging again:

```
debug.disable()
```

## licence

MIT