Skip to content

Full featured framework using RapydScript, PouchDB/CouchDB ORM, React/Preact, and Framework7. Now on Beta!

License

Notifications You must be signed in to change notification settings

faridfibrianto/rapyd-framework

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rapyd Framework

An Object-Relational Mapping for PouchDB/CouchDB and Framework inspired by Odoo

What's New

  • New Async/Await support
  • New Frontend with React/Preact and full ES6, allowing ORM operations to be declared with async-await. Making it more performant and easier to do Parallel and Scalable code.
  • Full external JS libraries compatibility, using CommonJS on Node and Webpack on browser.
  • Full React Components compatibility, making it easier to build Frontend UI even on React Native.
  • Upcoming Python/Odoo backend compatibility. For developers who prefer Python (Flask) or Odoo on server-side rather than Node.js https://github.com/rafi16jan/rapyd-odoo
  • Have many success PoCs and some giant automobile clients in Indonesia on Production. I'll post some details later on

Purpose of this project

  • Replacing or making an alternative to Odoo and Python's synchronous, I/O blocking design. Allowing us to develop asynchronous and performant ERP and IoT Apps.

  • Support some parallel programming paradigms consisting of Threads/Worker, Async-Await, Promises, Promise.all, Coroutines (TODO), and MicroServices.

  • Support hardware interfacing and IoT on the Client (Desktop Browser, Phone) and Server, using technologies like WebBluetooth, WebUSB, Cordova, Cordova/Node.js General Purpose I/0, WebAssembly and we planned to support Microcontrollers or SBCs too.

  • Creating an ORM for PouchDB/CouchDB, with a fabulous sync feature (https://pouchdb.com/guides/replication.html), offline capabilities, revision management, and performance.

  • Build a not so magic server-side MVC or PWA (Progressive Web Apps that only rely to RESTFul APIs and can be ran offline, either with service worker or local PouchDB) Framework. (Framework Client Repo https://github.com/rafi16jan/rapyd-client)

  • Use RapydScript (Python transpiler to Javascript, currently ES5 for compatibilty) in server-side (Node.js) and client-side, because Python's slogan "readability counts" is true.

  • So we will have Python's readabilty, Javascript's performance (JIT Compilation) and async/parallel features, and NoSQL concurrency.

How to use the Framework

To install just do npm install on the module directory

To run the server, do node server.js or pass --clear-cache to clear the cache

Modify app.conf to change port or other variables (Documentation is upcoming)

The Webclient is on client/build folder, put it on nginx or something else or simply open index.html on a browser, it should work. Or if you're lazy enough you can change local_app variable in app.conf to True. Then, open the server url (don't forget the port).

Async/Await support

We added async/await support out of the box for modern browsers and older versions of node.js (using yortus's asyncawait) to minimize Promise chaining and add readability for asynchronous operations. But, because we support old node.js versions (some platform like RHEL 6 on Power Architecture only have Node.js 6 compiled for the platform) the syntax is different with Python's Async/Await. For example instead of async and await being a keyword:

async def get_current_qty(self):
    move_ids = await self.env['stock.move'].search(['product_id', '=', somevariable])

Async become a decorator, and await become an identical keyword but function-like:

@async
def get_current_qty(self):
    move_ids = await (self.env['stock.move'].search(['product_id', '=', somevariable]))

Or

@async
def get_current_qty(self):
    move_ids = await [self.env['stock.move'].search(['product_id', '=', somevariable])]

On Node.js version below 7.6.0 the async decorator will be translated to asyncawait's async call and make the function returns a Promise (just like native async function) and the function-like await to the library's await call. But on newer Node.js versions and modern browsers the decorator will only turn the function to an async function.

What's still undecided

All feedback and advice are appreciated

About

Full featured framework using RapydScript, PouchDB/CouchDB ORM, React/Preact, and Framework7. Now on Beta!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 90.0%
  • CSS 5.3%
  • HTML 4.7%