Open Parse
The collection of middleware which provides flexible RESTful API for accessing to application data store and schemas, users and security management. Save your time to bootstrap new web and mobile projects.
Open Parse is open source BaaS (Backend as a Service). On the schema below that is "Data Proccessing / Management":
Out of the box Open Parse supports:
-
bunyan-logger which could be connected to Logentries, Loggly, NewRelic and other cloud log management services just in a 15 seconds.
-
MongoDB as default data provider. But you could implement custom data providers for any other databases (it takes ~20 min).
Built with love to Functional Principles and.. yes, koa.
Content
How It Works?
Open Parse is incredibly simple. It's just a glue which is connecting 2 pieces:
- Middleware to get RESTful API end-point on your web server. It's implemented according to JSON API specification.
- Data Providers to work with any data storage (by default is MongoDB).
You can extend any of those points.
Installation
npm install --save open-parse
Basic Usage
The following example has been written with using promised-mongo and koa-router packages.
Setup the environment
;; const router = ;const db = 'localhost/my-app'; const dataRequired = { if typeof thisrequestbody'data' === 'object' next; else this; };
Bring up Users API
const users = dataProvider: collection: db ;router;router;router;router;
Bring up Classes API
In this example we're using a local data from JSON file.
const classes = dataProvider: collection: db initialCache: ;router;router;router;router;router;
For ObjectsDataProvider
an initial cache should be specified as a [className][objectId]
hash object:
cached-objects.json
{
"company": {
"our": {
"title": "Startup Makers",
"about": "We are consulting and outsourcing a web-development with cutting-edge JavaScript technologies (ES6, Node.js, React, Redux, koa)"
}
}
}
Bring up Schemas API
const schemas = dataProvider: collection: db ;router;
Connect the router to your application
;;;;; // Create the server instanceconst app = ;app;;app; // ...paste your routes here... // Connect API routerapp; // Go LIVEapp;
Work with Open Parse API from the browser or mobile apps
For example how to implement login in your browser scripts when you have connected Open Parse:
const login = { const loginURL = '/api/login' + '?email=' + + '&password=' + ; ;};
FAQ
How To Connect a Cloud Log Service?
It's really easy. Did you initialize a logger? If you didn't, let's do it right now:
;; const logger = bunyan;
Add just a one line to your code
const users = dataProvider: collection: db logger // THIS LINE!;router;router;router;router;
That's all. You will get a messages (about login, logout and fetching the data about users) in your Logentries account.
Inspiration
- Parse.com - Commercial Backend-as-a-Service platform
- BaasBox API - Java-based open source Backend-as-a-Service solution
- DeployD API - first generation open source BaaS platform
- Sails.js - first generation MVC framework for Node.js
- Reindex.io - Commercial BaaS platform with GraphQL API
Contribution
Are you ready to make the world better?
1. Fork this repo
2. Checkout your repo:
git clone git@github.com:YourAccount/open-parse.git
3. Create your feature (or issue) branch:
git checkout -b my-new-feature
4. Commit your changes:
git commit -am 'Add some changes'
5. Push to the branch:
git push origin my-new-feature
Thank you very much. Your support is greatly appreciated.
Roadmap
Version 0.2
- Support access control layer (ACL)
- Add real world example
- Improve the documentation and architecture schema
- Add 'Access-Control-Allow-Origin' header
Version 0.3
- Add Express middleware adapter
- Support jobs feature
- Support e-mail service
Version 0.4
- Add client SDK for JavaScript and React Native
- Support files feature
Version 0.5
- Support web hooks