Git Product home page Git Product logo

ios-couchbase-demo's Introduction

Grocery Sync for iOS

This is a simple demo app showing how to use the TouchDB and CouchCocoa frameworks to embed a nonrelational ("NoSQL") CouchDB-compatible database in an iOS app and sync it with a database server in "the cloud".

Here's the "user story":

"So this dude is at the grocery store picking up produce and checking it off on his phone. He's all proud looking when he is about to check off the last item on the list, but then ... suddenly new items start appearing. Cut to his wife at home with the kids, and she's adding items.

"'Okra? Ok. Coconut milk? But I already got regular milk!' He checks them off as he goes. Cut to his wife who sees them marked done; she gets a big grin and starts adding cookies and ice cream and paper towels or whatever."

The app just presents a simple editable list of textual items with checkboxes, which are stored persistently in a local database, and shared in realtime with all other users who are synced with the same cloud database.

Syncing is not enabled by default. To sync, press the "Configure" button and enter the URL of a CouchDB-compatible database. Your choices for a database include:

  • Signing up for a free account at IrisCouch or Cloudant, or
  • Installing your own instance of Apache CouchDB, or
  • Using a (rather anarchic) grocery list database we've set up at http://couchbase.iriscouch.com/grocery-sync

Getting Started

These instructions assume you are familiar with how to make an iPhone app. Please follow them fully and in order the first time you build.

If you have questions or get stuck or just want to say hi, please visit the Mobile Couchbase group on Google Groups.

Prerequisite: Xcode 4.2 or later with the SDK for iOS 4 or later.

Building The Demo App

Get the main repository

git clone git://github.com/couchbaselabs/iOS-Couchbase-Demo.git

Get the frameworks (CouchCocoa as well as the embedded Couchbase server)

  1. Either download a compiled build of TouchDB, or check out and build it yourself (be sure to follow its README.)
  2. Likewise, either download a compiled build of CouchCocoa, or check out and build it yourself (be sure to follow its README.)
  3. Copy both Couchbase.framework and CouchCocoa.framework (the ones for iOS, not Mac OS!) into the Frameworks directory of this repo.

Open the Xcode workspace

open CouchDemo.xcworkspace

Build and run the demo app

  1. Select the "CouchDemo" scheme and the appropriate destination (an iOS device or simulator) from the pop-up menu in the Xcode toolbar.
  2. Click the Run button

That's it! Now that you're set up, you can just use the Run command again after making changes to the demo code.

To add the framework to your existing Xcode project

Please see the documentation for TouchDB and CouchCocoa.

License

Released under the Apache license, 2.0.

Copyright 2011-2012, Couchbase, Inc.

ios-couchbase-demo's People

Contributors

snej avatar jchris avatar

Watchers

MM avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.