Source code for demo app @ CB Connection 2017


#1

Great presentation over at https://www.youtube.com/watch?v=-U_UjqnhMBI — cheesy enough for execs to be interested and still a little technical content for devs.

I assume the YouTube channel comments arn’t monitored so I’m cross posting here.

Is the source code from this demo availiable at all? I had a good look though the CB github and blog but I couldn’t find anything.


#2

It’s not yet publicly available. Tagging @hod.greeley


#3

Thanks! Glad you found it valuable.

We’ll be making the repo available, but it needs some clean up. I’d estimate maybe mid to late December.

Is there a particular piece you’re interested in? We may consider releasing or blogging about some topics earlier than that.


#4

I’ve been working on a few frontend and node server projects — which use CB + CB sync gateway + node SDK + PouchDB — so I’ve become very interested to see other developers implementations. There isn’t anything particular I’m looking for but I thought it would be a great way to get ideas or inspiration.

So far my projects are working great but perhaps there are some usage scenarios I’ve missed or opportunities for performance/stability improvement, so they’re the main things I’d be seeking out.

Thanks :slight_smile:


#5

Hi Max, I didn’t use PouchDB in the demo. Do you need local offline storage for browsers?

It’s a bit much to go into the full architecture here, but basically the node server supplies REST endpoints that correspond to the various data/query requests. So, for example, there’s an endpoint to get the geolocation of a group of patients. I use bluebird promises for async operation to keep everything non-blocking.

The mobile side is quite straight-forward. Changes made by the web client automatically feed out to the mobile side based on channels.

Maybe the less obvious parts, to give some idea of usage scenarios, are the full-text search and the geolocation query parts. One nice piece is the use of the built-in cURL capabilities. It allows you to use a cURL-style api to retrieve data from an external source and treat it just like data from the database (meaning you can do joins and other complex N1QL actions with it directly).


#6

@hod.greeley thank you for your answer.

I would have been shocked if you used PouchDB — there’s quite a number of issues with CBSG + PouchDB but it does work. Yes, I use it for offline storage. I’m aiming for an “offline first” PWA experience.

If you do publish the source, please do reply here :slight_smile: