express-api-user-management-signup
adds user frontend with login-, registration-, and webhook- features to your (express) application. Startingpoint for DIY api management
Last updated 3 years ago by coderofsalvation .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install express-api-user-management-signup 
SYNC missed versions from official npm registry.

express-api-user-management-signup

DEPRECATED by expressa

Middleware for quickly building login systems on top of apis/express apps. This module adds a user facade-backend with login / registration on top of that. Good startingpoint for DIY api management, processable thru webhooks, themable using custom js/css/jade templates.

WARNING: BETA, not production ready

login

login (basic theme)

logged in

form generation using jsonschema

Installation

npm install -g coffeescript 
npm install jade express@4.13.3
npm install express-api-user-management-signup

Usage

var app, cfg, express, http, port, usermanagement, webhookhost, webhookport;

express = require('express');
http = require('http');
require("coffee-script/register");
usermanagement = require('express-api-user-management-signup');

app = express();
port = process.env.PORT || 3010;
webhookport = process.env.WEBHOOK_HOST || port;
webhookhost = process.env.WEBHOOK_HOST || 'http://127.0.0.1';

cfg = {
  webhook: {
    url: 'http://' + webhookhost + ':' + webhookport,
    requestdata: {
      headers: {
        'x-some-token': 'l1kj2k323'
      }
    }
  },
  mongo: {
    host: 'localhost',
    port: 27017,
    name: 'foo'
  },
  layout: {
    theme: __dirname + '/app/public.account',    // define your own 
    // theme: __dirname + '/app/public.basic',   // templates
    title: {
      brand: 'Projectname',
      welcome: 'Please login to your account'
    },
    menu: {
      'Apidoc': {
        target: '_blank',
        url: '/api/v1/doc'
      },
      '---': '---',
      'Contact': {
        target: '_blank',
        url: 'mailto:support@foo.com'
      }
    },
    formurl: '/js/form.json'
  }
};

app.set('port', port);
app.use(usermanagement(app, express, cfg));
http.createServer(app).listen(app.get('port'), function() {
  console.log('Express server listening on port ' + app.get('port'));
});

Themes

Define your own templates for easy integration with your js/css/html framework:

cp -R node_modules/express-api-user-management-signup/app/public.basic mytheme

and in the config define

...
  layout: {
    theme: __dirname + '/mytheme'
...

Features:

  • coffeescript yay!
  • New User Account Creation
  • Secure Password Reset via Email
  • Ability to Update / Delete Account
  • Session Tracking for Logged-In Users
  • Local Cookie Storage for Returning Users
  • Blowfish-based Scheme Password Encryption
  • end-user webhooks
  • optional internal webhooks for flexibilitystorage (to integrate with api proxy like apiaxle or emailgateway e.g.)
  • logging of db actions
  • apikey support + regeneration of apikey
  • works standalone and as express drop-in lib (the latter needs improvement eg. app.use)
  • flexible form using (optionally remote) jsonschema
  • optional google analytics by passing environment variable GOOGLE_ANALYTICS_TOKEN=LK-2342LK

Extend forms easily

By using jsonform, we can easily extend the form without having to fiddle with database code. Just have a look at :

HINT: you can change the 'formurl'-parameter of 'app.[js,coffee]' (or the json above) into a remote url in order to remotely manage the form

Webhooks

The following webhooks are fired whenever these things occur:

  • configuredhost + /add when user adds account
  • configuredhost + /update when user updates account
  • configuredhost + /update/pass when user changes password
  • configuredhost + /update/apikey when user regenerates apikey
  • configuredhost + /login when user logs in
  • configuredhost + /reset/pass when user resets password

Where configuredhost is defined by you in the config ('http://mygateway.com/foo' e.g.) These webhooks can be reacted upon by other middle/software in order to send emails or update api proxy settings e.g.

Todo

  • tests
  • responsive ui (for smartphone etc)
  • url validation for webhook url in jsonschema
  • smaller fonts jsonform validation error tooltips (to match the layout)

Built with

Current Tags

  • 0.0.65                                ...           latest (3 years ago)

31 Versions

  • 0.0.65                                ...           3 years ago
  • 0.0.28                                ...           3 years ago
  • 0.0.64                                ...           5 years ago
  • 0.0.63                                ...           5 years ago
  • 0.0.62                                ...           5 years ago
  • 0.0.61                                ...           5 years ago
  • 0.0.6                                ...           5 years ago
  • 0.0.59                                ...           5 years ago
  • 0.0.58                                ...           5 years ago
  • 0.0.57                                ...           5 years ago
  • 0.0.561                                ...           5 years ago
  • 0.0.56                                ...           5 years ago
  • 0.0.554                                ...           5 years ago
  • 0.0.553                                ...           5 years ago
  • 0.0.552                                ...           5 years ago
  • 0.0.551                                ...           5 years ago
  • 0.0.55                                ...           5 years ago
  • 0.0.54                                ...           5 years ago
  • 0.0.53                                ...           5 years ago
  • 0.0.52                                ...           5 years ago
  • 0.0.51                                ...           5 years ago
  • 0.0.5                                ...           5 years ago
  • 0.0.271                                ...           5 years ago
  • 0.0.27                                ...           5 years ago
  • 0.0.261                                ...           5 years ago
  • 0.0.26                                ...           5 years ago
  • 0.0.25                                ...           5 years ago
  • 0.0.24                                ...           5 years ago
  • 0.0.23                                ...           5 years ago
  • 0.0.22                                ...           5 years ago
  • 0.0.2                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (10)
Dev Dependencies (0)
None
Dependents (2)

Copyright 2014 - 2016 © taobao.org |