flowee
v1.0.32
Published
a __lightweight__ way to __create JSONAPI__-compatible api's for _nodejs_
Downloads
10
Readme
Flowee
a lightweight way to create JSONAPI-compatible api's for nodejs
Getting started
$ npm install flowee
$ cp node_modules/flowee/test/model.js .
Create server.js
:
var flowee = require('flowee')
var app = flowee.init({ model: require('./model.js'), store: true, router:true });
flowee.start( function(server) {
return server.listen(1337);
});
( See model.js here )
$ node server.js
Voila! Now you have a server running with automatically mapped database entities (incl. many to many relations OHMY).
Ps. you can use it as express middleware too:
flowee.init({ model: require('./model.js'), store: true });
flowee.store.connect().then( console.dir )
flowee.export_swagger( flowee.model )
app.use( flowee.process )
// add routes
for (resource in flowee.model.paths) {
methods = flowee.model.paths[resource];
for (method in methods) {
obj = methods[method];
app[method](resource, obj.func);
}
}
Architecture
Flowee promotes configuration over convention, click here to see the fullscreen architecture
Howtos
Features
Built on the shoulders of fortunejs, which represents:
- fast installation: core is +/- 10M
- configuration over convention
- a teaspoon of automatic database object relations mappings
- 5 liters of JSONAPI v1 compatible REST responses
- swappable database adapters like MongoDB, Postgres, Redis adapter
Oh..and:
- DDA: design-driven api by using a json SWAGGER v2 compatible model
- middleware compatible: connect express and restify middleware modules from npm
Extensions
flowee-doc: automatic generating api documentation
flowee-auth: passport authentication
flowee-admin: automatic admin interface (TODO)
Philosophy
Take a look at loopback, meteor, cleverstack. Now imagine lightweight. Flowee likes to focus on:
- lightweight and fast to install
- json driven, declarative (monkeypatchable configuration over convention)
- http framework agnostic
- configuration over convention
- allow re-usage of middleware from http frameworks like express/restify etc
- extend using npm installs: no cli tools, no learningcurve