npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

syncpoint

v0.3.0

Published

Sync multi-user applications with Apache CouchDB and TouchDB on mobile devices.

Downloads

13

Readme

Syncpoint API

Couchbase Syncpoint is an API suite for synchronizing multi-user interactive applications using Apache CouchDB in the cloud and TouchDB on mobile devices.

Why Sync?

Realtime is the future of the web. Users have multiple devices, and they want to share on their own terms. Couchbase Syncpoint gives you the flexibility to build your application on top of CouchDB's trusted multi-user replication model.

Syncpoint can be used for things like these: point-of-sale, retail, medical records (doctor with an iPad and limited wifi), military (need that data no matter what), social games. See these slides from Chicago's WindyCityGo conference for for inspiration of how you might structure an Syncpoint app. (Note the OMG POP bragging has nothing to do with Syncpoint, they use Couchbase Server.)

Millions of users, simplified.

With CouchDB, developers often use per-user database patterns to build sync apps. It works, and folks have success modeling groups, per-user backups, and more complex applications using this model. However, creating and managing all those databases takes code -- code that you don't want to have to write. We've seen what works with CouchSync apps, so we've built Syncpoint to create an easy on-ramp for mobile.

Syncpoint handles user signup, device pairing, and channel management, all with an extensible event-driven _changes based API. Syncpoint provisions users, devices, and channels. It's super-easy to hook into the server-side configuration change listeners and write your own event-driven plugins.

If you're building an app that's mostly a JSON API for phones or webpages, you're in the right place. What do you want to see?

Get Started

You need to have three prerequisites. iOS dev chops, Node.js (>=0.6.0) and Apache CouchDB (>=1.2.0). You can get hosted CouchDB free at IrisCouch or Cloudant. Once you have your cloud CouchDB url, and you have installed node.js, you can use the Node Package Manager to install Syncpoint:

npm install -g syncpoint
npm start syncpoint

It will prompt you for your cloud URL, and help you set up an admin password. Once it is launched it's time to get into the iOS stuff. Or if you want you can continue this adventure by opening the Admin console (your terminal should have printed out the link to the admin console when you ran npm start syncpoint);

It may look like this only with zero users:

admin console

Once you have compiled the iOS app, pointed at your new Syncpoint node, you see the "Sessions Awaiting Admin Approval" list on your phone or simulator, and you can active it via the admin console.

Security

The CouchSync document model encourages the notion that each database is an independent security domain. A member of a database can read all the documents, and update them according to application validation logic. It's up to the developer (that's you) to decide who gets access to which channels.

By default Syncpoint keeps each users's full set of devices identical. That means if they install your app on their phone and their tablet, it will have the same data in both places.

It is possible with some server side configuration, to create shared Channels, with multiple users. Users in shared channels see each others updates in real time. They can also continue to query and update data when they are disconnected, so apps stay smooth even on unreliable networks.

For sync applications, your validation logic is run in the Syncpoint cloud, on the users documents as they sync up from the mobile device. By rejecting and invalid updates (can't change doc.author, or whatever your app needs) you can prevent invalid data from being accepted by your servers.

Channels API

Channels are the unit of sync. A channel is defined by who can access it, and which devices it appears on. If you are subscribed to a channel, you are (generally) able to see all the data in that channel. Since channels are just CouchDB databases, there's existing documentation about the security model.

Channels make it easy to keep all of a users devices in sync, and to create apps that bridge multiple users without stressing.

License

This is under the Apache 2.0 license