thaliproject / thali

Our root repository for all of our projects
MIT License
86 stars 13 forks source link

Port LevelDown to JXCore #148

Closed yaronyg closed 9 years ago

yaronyg commented 9 years ago

SQLDown is a mess. There are functions like destroy that don't appear supported and it's not tested regularly by the PouchDB team. Not to mention that what perf numbers we did get were pretty awful. So it seems clear that we need to run LevelDB. The good new is that LevelDB should compile just fine for both Android and iOS. The bad news is that LevelDown, the wrapper for LevelDB in node.js land, uses V8 specific interfaces. So we need to actually port it, not just compile it.

yaronyg commented 9 years ago

Both https://github.com/calvinmetcalf/SQLdown/issues/11 and https://github.com/calvinmetcalf/SQLdown/issues/12 give some sense of the issues.

yaronyg commented 9 years ago

Done!

doruchiulan commented 9 years ago

Hi yaronyg

I am having exactly the same issue as you as I have a very similar app to the one you develop, i saw the article here: http://thaliproject.org/stories

What have you sold regarding PouchDB + JxCore. I cant manage to make it work on my devices( I guess its the leveldown). Can you please guide me in a direction with some advices/resources.

I really need to make this setup work and there are not many resources regarding this.

Thanks!

yaronyg commented 9 years ago

Hey @doruchiulan we actually have leveldown working quite well thanks to the folks at JXcore. The JXcore guys came up with a fork that is now part of leveldown called leveldown-mobile that runs PouchDB on leveldown on JXcore on Android and iOS. The way we consume it is via Cordova (this handles all the packaging). You can see an example here. That work is based on jxcore-cordova.

Note, however, that JXcore should be able to use levedown-mobile without Cordova. It's just that we haven't tried since all of our current work is focused on Cordova. We do plan to eventually release a stand alone (Cordova free) version of Thali but that work isn't intended to happen for a while.

BTW, I'm really curious about what y'all are up to and if Thali may be able to help?

doruchiulan commented 9 years ago

Hi,

We also tried to use leveldown-mobile but with no success yet. I am sure we are doing something wrong, I will try to read through your code and see what I am doing wrong.

We are planning to do a full cross-platform app(mobile, desktop, web) with offline capability.

At first we were thinking about Xamarin.Forms for apps front-end and ASP.NET with Mono for desktop front-end and a shared C# Portable Class Library as the back-end that was talking with Couchbase Lite / Couchbase Server(I saw you also use Couchbase Lite). We used a factory pattern in the C# backend that depending on a flag (if it's a web app or the browser bundled desktop app) was deciding the library used to talk to Couchbase Server or Couchbase Lite.

But considering we had to write separate front-end (Xamarin.Forms / ASP.NET) we want to try this solution that should be built for mobile platforms with Cordova and bundle somehow the jxcore or node.js backend with the front-end code in a desktop app. JxCore will be used just to provide a REST API so we can talk with the database. For bundling the desktop app we saw there some tools available, we used this before: https://bitbucket.org/chromiumembedded/cef

Can we contact you here if we still have problems with our Cordova + JxCore + PouchDB setup?

Thanks!

yaronyg commented 9 years ago

This sounds like fun! Thali eventually has to go in the exact same direction. That is, we need to run Thali apps on the desktop. Our thinking there is to continue to use Cordova but use the desktop build target and then wrap up JXcore in something like Electron.

I'm happy to help out with your questions but if I were you I would go directly to the source, the JXcore folks. You can file issues either here or here. You will find them super responsive and unlike us, they actually know what they are talking about. :)