Skip to content

jewelsjacobs/anguloop-example

 
 

Repository files navigation

anguloop idea/poc of loopback 4 angular

Searching for contributors Contact me: Skype: psitrax ; IRC: Psi|4ward@freenode ; wio[at]psitrax.de

  • RESTapi accessable through Websockets express-websocket

  • Requesting a list-endpoint (/api/users) via socket results in an update subscription

  • Broadcast model changes to all subscribeders (like SailsJS)

  • $http compatible $httpSock angular service

  • ApiLoop angular service as Model-Layer

  • JsonSchema support for angular-schema-form and validation

  • (npm-installable) Packages support containing Loopback and Angular code (like MeanJS)

  • Gulp based build system Gulpsi

  • generator to scaffold new apps (todo)

Install and usage

You need Gulp and Bower

npm install psi-4ward/anguloop-example
npm start

Todo

  • Refactor modelChange2socket.js

    • Respect filter param
  • (yeoman) Generator

  • Extract ApiLoop into own project

  • Extreact jsonschema-validator and meta-endpoint bootscripts into own project

  • Extreact modelChange2socket bootscript into own project

  • Documentation

  • MenuService

  • frontend base package (AdminLTE?)

RESTapi accessable through Websockets

express-websocket pushes socket json-web-requests into the express routing

  • every express route is also a socket route
  • go through all middlewares so we dont bypass anything

Model update boradcasts

See modelChange2socket.js for an draft

Packages

  • loopback-packageloader loads loopback with model/configs aggregated from all package directories
  • Gulpsi build the angular and aggregate bower deps from all package directories

suggested (but configurable) filestructure

├── packages
│   └── my-package
│       ├── angular
│       │   ├── templates
│       │   ├── providers
│       │   ├── controllers
│       │   ├── directives
│       │   ├── config.js
│       │   ├── routes.js
│       │   └── run.js
│       ├── assets
│       ├── less
│       ├── loopback
│       │   ├── boot
│       │   ├── models
│       │   ├── datasources.json
│       │   ├── middleware.json
│       │   └── model-config.json
│       ├── gulpsi.json
│       ├── package.json
│       └── README.md
├── public
├── config.json
├── package.json
└── server.js

Or split into angular and loopback packages? Whats your opinion?

npm-installed Packages

  • gulpsi findes it by searching for gulpsi.json
  • loopback-packageloader inspects package.json and searches for anguloopModule: true key

JsonSchema endpoint and validation

Define a JsonSchem in your Model.json using the jsonSchema property. You could also mark this schema as strict using strictJsonSchema: true. A strict schema does not allow additional properties.

The Schema gets exposed via _meta endpoint for each Model. The fronend can request the Schema and hand it over to angular-schema-form.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 84.1%
  • CSS 12.8%
  • HTML 3.1%