SPOO (Single Point of Object) is a JavaScript framework for creating custom platforms using OBJY.
For the official Documentation, visit spoo.io/docs
SPOO is built on OBJY.
For running a basic platform you will need Node.js, Redis and MongoDB
npm i spoojs objy
// 1. import spoo
const SPOO = require('spoojs');
const OBJY = require('objy');
// 2. define some "object wrappers"
OBJY.define({
name: "user",
pluralName: "users",
authable: true
})
OBJY.define({
name: "object",
pluralName: "objects"
})
// 3. run the platform via REST
SPOO.REST({
port:80,
OBJY,
metaMapper: new SPOO.metaMappers.mongoMapper().connect("mongodb://localhost") // The matamapper is for basic config
}).run()
Install via npm or script tag:
<script src="spoo.js">
or
npm i spoo-client
// 1. Initialize the client
const spoo = new SPOO_Client('mytenant');
// 2. Authenticate a user
spoo.io().auth("user", "pass", function(data, err){
if(!err) console.log('you are in!');
})
// Add an object
spoo.io().object({
name: "Mercedes",
type: "car",
properties: {
owner : {
type: "shortText",
value: "Peter Griffin"
}
}
}).add(function(data, err)
{
if(err) return console.error(err);
console.log(data); // {...object...}
})
// Modify an object
spoo.io().object("objectid...").addProperty({
color: {
type: "shortText",
value: "red"
}
}).save(function(data, err)
{
if(err) return console.error(err);
console.log(data); // {...updated object...}
})
- Marco Boelling - Initial work - Twitter
SPOO is open source and licensed under the GNU Affero General Public License. See LICENSE for more details.
If you'd like to contribute to the source code, you are welcome to open a PR. Please make sure to read the CODE OF CONDUCT.
- For more information on SPOO, go to spoo.io