Code Monkey home page Code Monkey logo

loopback-sdk-builder's Introduction

NPM NPM

LoopBack SDK Builder

The LoopBack SDK Builder is a community driven module forked from the official loopback-sdk-angular and maintained by @johncasarrubias.

Fork Reasons

Since the launch of Angular 2 - Beta (now RC) the community has been requesting support for this version of the framework with a really slow response from the StrongLoop Team with many doubts if they will continue supporting the generator.

Read Here The GitHub Thread

Also, the official proposed solution does not seems to be fully compatible with todays needs. For instance, the "same" Angular 2 SDK won't work the same depending on the environment you are running (NativeScript, Web, AngularUniversal).

Since Angular 2 does not rely on a browser DOM, the SDK implementations may be different according the environment.

Read about the New Angular 2 Ecosystem

Disclaimer

I really don't have any plan to support Angular 1, I'm not trying to compete with the official module.

If you want to build a SDK for Angular 1 please use the official.

loopback-sdk-angular

Coincidences

The client is dynamic, in other words it automatically includes all the LoopBack models and methods you've defined on your server. You don't have to manually write any static code.

See the official LoopBack AngularJS SDK documentation for more information.

Features

  • Built in LoopBack Authentication.
  • Built in Interfaces and Models.
  • Built in API Calls.
  • Built in PubSub support for the loopback-component-pubsub.
  • Built in Platform Specific Drivers (Angular2 for web, NativeScript2, Angular Universal).
  • Built in CLI Tool for builder.
  • Built in Logger Service.
  • Fully Typed (TypeScript).
  • As small as 100k per generated SDK (Will increase depending on number of models).

Installation

$ cd to/api/project
$ npm install --save-dev [email protected]

LoopBack SDK CLI Options

Options:
  -l, --library  Client's library (angular2, react <todo>, ...)                          [default: "angular2"]
  -d, --driver   Platform specific drivers (ng4web, nativescript2, ng2universal <todo>)  [default: "ng4web"]
  -i, --io       Enable PubSub functionality for loopback-component-pubsub               [default: "disabled"]

Client Requirements

The following package needs to be installed in your client application.

Generate Angular 2 SDK for Web

The default options will create an Angular 2 SDK for Web.

$ ./node_modules/.bin/lb-sdk server/server.js /path/to/client/sdk

Is equivalent to

$ ./node_modules/.bin/lb-sdk server/server.js /path/to/client/sdk -l angular2 -d ng4web -i disabled

Generate NativeScript 2 SDK

$ ./node_modules/.bin/lb-sdk server/server.js /path/to/client/sdk -d nativescript2

Is equivalent to

$ ./node_modules/.bin/lb-sdk server/server.js /path/to/client/sdk -l angular2 -d nativescript2 -i disabled

Enable Real Time Communication

The Angular2 and NativeScript generators currently implement socket connectivity when using loopback-component-pubsub.

Requirements

The following package needs to be installed in your client application.

To enable you will need to add the --io enabled or -i enabled flag.

Angular 2 for Web

$ ./node_modules/.bin/lb-sdk server/server.js /path/to/client/sdk -d ng4web -i enabled

NativeScript 2

$ ./node_modules/.bin/lb-sdk server/server.js /path/to/client/sdk -d nativescript2 -i enabled

Optional Use

Add a script within package.json

{
  "scripts": {
    "build:sdk": "./node_modules/.bin/lb-sdk server/server path/to/ng2-app/src/shared/sdk -d [ng4web | nativescript2] -i [enabled | disabled]"
  }
}

then:

$ cd to/api/project
$ npm run build:sdk

Awesome you now can build SDK for different platforms!!!

TODO

  • Start working in version valid for Angular Universal
  • Redux and ngrx support
  • React Support

Tutorials

Mailing List

Discuss features and ask questions on Twitter.

loopback-sdk-builder's People

Contributors

adagio avatar arielschiavoni avatar bajtos avatar davidcheung avatar dfeddad avatar ezraroi avatar inazarov avatar jonathan-casarrubias avatar jonnybgod avatar jsheely avatar kennethlynne avatar khashayar avatar mnvx avatar palra avatar pandaiolo avatar partap avatar rmg avatar ru108 avatar sam-github avatar sylvaindumont avatar tsertkov avatar

Watchers

 avatar  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.