• This repository has been archived on 09/Mar/2022
  • Stars
    star
    154
  • Rank 236,546 (Top 5 %)
  • Language
    Objective-C
  • Created almost 13 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The simplest Couchbase Lite demo app for iOS

⚠️ This repo is obsolete. This application is built against a version of Couchbase Lite that reached end of life years ago.

Grocery Sync for iOS (Objective-C version)

This is a simple demo app showing how to use the Couchbase Lite framework to embed a nonrelational ("NoSQL"), document-oriented database in an iOS app and sync it with a database server in "the cloud".

If you prefer developing in Swift, click here!

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.

For demo purposes, the app is hardcoded to sync with a specific database on a server run by Couchbase. You can (and should) easily modify it to sync with a database you create on a Couchbase Sync Gateway. Instructions for that are below.

Building & Running The App

These instructions assume you are familiar with building and running an iOS app.

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

Prerequisite: Xcode 6.0 or later with an iOS SDK.

Get the main repository

git clone git://github.com/couchbaselabs/Grocery-Sync-iOS.git

Note: If you want the Swift version, run git checkout swift.

Get the Couchbase Lite framework

  1. Download Couchbase Lite for iOS.
  2. Copy CouchbaseLite.framework into the Frameworks directory of this repo.

Open the Xcode workspace

open GrocerySync.xcodeproj

Build and run

  1. Select 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.

Install Sync Gateway

  1. Download and install Sync Gateway (see the installation page for details).

  2. Start Sync Gateway with the configuration file in the root of this project.

    ~/Downloads/couchbase-sync-gateway/bin/sync_gateway sync-gateway-config.json
  3. Open DemoAppDelegate.m and update the kServerDbURL constant to point to your Sync Gateway instance.

    #define kServerDbURL @"http://localhost:4984/grocery-sync/"
  4. Build and run the app.

  5. Add items and they should be visible on the Sync Gateway Admin UI at [http://localhost:4985/_admin/] (http://localhost:4985/_admin/).

Using A Local Sync Gateway

If you've installed Couchbase Server and the Couchbase Sync Gateway, you can easily configure Grocery Sync to sync locally instead of with the remote server.

(For help setting up the Sync Gateway, read the getting started guide.)

  1. Create a Couchbase Server bucket named grocery-sync.
  2. If Couchbase Server is not running on the same computer as the Sync Gateway, edit the sync_gateway_config.json file in this directory and enter the correct server URL.
  3. Start the Sync Gateway using the supplied configuration file: sync_gateway sync_gateway_config.json
  4. Edit DemoAppDelegate.m and change the value of kServerDbURL to have the hostname/address and port of the Sync Gateway. Make sure to specify the public API port (4984) not the admin port (4985).
  5. Build and run Grocery Sync.

Adding Couchbase Lite to your existing Xcode project

Please see the documentation for Couchbase Lite.

License

Released under the Apache license, 2.0.

Copyright 2011-2014, Couchbase, Inc.

More Repositories

1

TouchDB-iOS

CouchDB-compatible mobile database; Objective-C version
Objective-C
764
star
2

iOS-Couchbase

This repository fork is obsolete; the project's been restructured and development is going on in other repos. Please follow the link below, or read the current README.
Erlang
403
star
3

node-ottoman

Node.js ODM for Couchbase
TypeScript
285
star
4

TouchDB-Android

CouchDB-compatible mobile database; Android version
Java
240
star
5

CouchCocoa

Objective-C API for CouchDB on iOS and Mac OS
Objective-C
218
star
6

Android-Couchbase

The android build for humans.
C
203
star
7

ToDoLite-Android

To-Do list sample app for Couchbase Lite, native Android version
Java
186
star
8

cbfs

Distributed Blobstore using Couchbase Server
Go
185
star
9

Couchbase-Lite-PhoneGap-Plugin

Plugin to install Couchbase Lite in your PhoneGap app on iOS or Android
Objective-C
183
star
10

mini-hacks

A fun and quick way to discover the beauty of Couchbase Mobile in real apps.
Java
137
star
11

GrocerySync-Android

Couchbase Lite demo app for Android: A simple synced shopping list
Java
136
star
12

react-native-couchbase-lite

Couchbase Lite binding for React Native Android & iOS
Java
111
star
13

couchbase-rs

The official, community supported Couchbase Rust SDK
C
100
star
14

Linq2Couchbase

A Language Integrated Query (LINQ) provider for the Couchbase .NET SDK
C#
91
star
15

nativescript-couchbase

Objective-C
87
star
16

ToDoLite-iOS

To-Do list sample app for Couchbase Lite, native iOS version
Objective-C
85
star
17

CouchbaseLiteViewer

Mac app for viewing/modifying Couchbase Lite databases
Objective-C
81
star
18

iMonkey

Threadsafe Spidermonkey Static Library for iOS
C++
81
star
19

CouchChat-iOS

Couchbase Lite demo app for iOS: A chat client
Objective-C
78
star
20

cbgb

an experimental server, the birthplace of punk, and a future backcronym
Go
60
star
21

couchstore

couchbase storage file library
C
58
star
22

devguide-examples

Examples for topics in the developer guide
C
58
star
23

mobile-training-todo

ToDo List app built with Couchbase Mobile
Java
57
star
24

touchbase

A Couchbase N1QL example of a social network app using Angular.js and Node.js
JavaScript
56
star
25

vagrants

Vagrant files to provision Couchbase VMs
Puppet
56
star
26

try-cb-java

Java-Based Couchbase 7.0 travel-sample application
Java
56
star
27

TodoLite-PhoneGap

Basic todo list app for Couchbase Lite and PhoneGap
JavaScript
55
star
28

couchbase-shell

Shell yeah!
Rust
55
star
29

try-cb-nodejs

JavaScript
51
star
30

couchbase-server-coreos

Dockerfiles and scripts for running Couchbase Server under Docker and CoreOS
43
star
31

Couchbase-by-Example

Series of tutorials for Couchbase Lite, Sync Gateway and Couchbase Server
Swift
42
star
32

couchbase-mobile-tools

A repo for hosting both supported and unsupported tools made by Couchbase
C++
41
star
33

photo-drop

P2P Photo Sharing app. Read more http://blog.couchbase.com/photodrop
Swift
40
star
34

couchbase-aspnet

Couchbase Asp.Net infrastructure support
C#
38
star
35

iOS-Couchbase-manifest

Repo manifest for (legacy) iOS-Couchbase project. Current development is on the next gen native version: TouchDB (see link)
37
star
36

iErl14

Project to build static lib for iOS containing Erlang VM BEAM, CouchDB drivers, emonk interface to spidermonkey
C
35
star
37

query

PLEASE NOTE: code is currently maintained at
Go
35
star
38

try-cb-dotnet

Couchbase Travel Sample app written in ASP.NET
C#
34
star
39

sdk-rfcs

SDK RFCs
34
star
40

ForestDB-Benchmark

Benchmark program for ForestDB, Couchstore, LevelDB, RocksDB, and WiredTiger
C++
34
star
41

php-couchbase-v2

Couchbase 2.0 API based on pecl/memcached. For 3.0 see couchbase-php
PHP
34
star
42

cellar

An experimental KV store, which implements an LSM on top of Bolt segments.
Go
32
star
43

WebSockets-Cocoa

Objective-C implementation of WebSockets and BLIP protocols, for iOS and Mac OS
Objective-C
32
star
44

CouchChat-PhoneGap

=> https://github.com/couchbaselabs/TodoLite-PhoneGap
31
star
45

TodoLite-Ionic

To-Do list sample app for Couchbase Lite, using Ionic and the PhoneGap plugin
JavaScript
31
star
46

libcouchbase-cxx

Header-only C++11 Couchbase Client
C++
30
star
47

walrus

Tiny Go implementation of Couchbase Bucket API, for testing
Go
28
star
48

restful-angularjs-nodejs

An example of using the Node.js SDK for Couchbase with an AngularJS frontend
JavaScript
27
star
49

cbft

*THIS PROJECT HAS MOVED* from couchbaselabs TO: https://github.com/couchbase/cbft -- no further development will be done here on couchbaselabs/cbft
Go
27
star
50

cean-web-chat

Real-time chat with the CEAN stack and Socket.io
JavaScript
26
star
51

CouchDraw

A synchronized drawing app that utilizes Couchbase Sync Gateway and Xamarin to enable shared canvases.
C#
25
star
52

crouton

C++20 coroutine runtime and cross-platform I/O library
C++
25
star
53

ng-couchbase-lite

AngularJS Wrapper for Couchbase Lite RESTful Endpoints
JavaScript
24
star
54

cbugg

Because all bug systems are bad and I like writing bad code.
JavaScript
23
star
55

blog-source-code

Source code for blog posts
C#
23
star
56

OnTheSpot

Saves photos with lat/lon and other telemetry to Mobile Couchbase. Please fork and play with it, we hope it becomes the basis for other folks "real" apps. Coolest part about it is the different apps can share the same dataset, and hence share network effects.
Objective-C
23
star
57

mobile-travel-sample

Mobile Version of Travel sample App using Couchbase Lite 2.x
Java
22
star
58

try-cb-python

Couchbase Travel Sample Application Python REST API Backend
Python
22
star
59

Android-Couchbase-SourceBuild

Full source build of Android stuff.
Shell
22
star
60

couchbase-nginx-module

The module for nginx webserver to access Couchbase Server
C
22
star
61

learningportal

A Learning Portal built with Couchbase Server 2.0 and ElasticSearch
Ruby
21
star
62

pouchdb-angular2

Couchbase Mobile Web Application with PouchDB and Angular 2
TypeScript
21
star
63

showfast

Performance dashboard
HTML
19
star
64

couchbase-net-examples

Examples for configuring and using the Couchbase .NET SDK 2.0
C#
18
star
65

couchbase-lite-titanium

Couchbase Lite Titanium Module
Objective-C
18
star
66

erlgeom

Erlang binding for geometry libraries
Erlang
18
star
67

sdk-doctor

Application-server-side cluster connection diagnostics.
Go
18
star
68

tuqtng

TUQ - The Next Generation
Go
18
star
69

Couchbase.Lite.Mapping

A simple library that extends Couchbase.Lite to provide extension methods for converting an object to a Document/MutableDocument and a Document/MutableDocument to an object.
C#
18
star
70

sequoia

Scalable testing with containers
Python
17
star
71

gameapi-nodejs

Make a simple game server API using NodeJS and Express
JavaScript
17
star
72

couchbase-lite-local

Run a couchbase lite instance with REST interface locally on you Mac or Raspberry Pi
Ruby
17
star
73

sg-replicate

A tool that can drive a replication between Sync Gateway instances
Go
17
star
74

couchbase-capi-server

OBSOLETE, NO LONGER MAINTAINED. An abstract Java HTTP server for pretending to be a Couchbase Server node.
Java
17
star
75

DeveloperDay

Couchbase Developer Day Sample Code By Language
Java
17
star
76

cbforest

C++ wrapper library around ForestDB, for use in Couchbase Lite.
C++
17
star
77

dcp-documentation

couchbase unified protocol for replication
17
star
78

BLIP-Cpp

C++ implementation of BLIP network protocol
C++
16
star
79

couchbase-spark-samples

Examples on how to use the Couchbase Spark Connector
Scala
16
star
80

couchtalk-node

Example push-to-talk app using Couchbase Server, node.js, and the browser.
JavaScript
16
star
81

php-ext-couchbase

A PHP extension wrapping libcouchbase (work in progress)
C
16
star
82

try-cb-golang

Go
16
star
83

todolite-electron-pouchdb

Example to demonstrate Couchbase in an Electron desktop application with PouchDB
JavaScript
15
star
84

couchbase-spring-cache

An implementation for Spring Cache based on Couchbase Java SDK 2.x
15
star
85

mobile-testkit

Mobile QE Test Framework
Python
15
star
86

sync_gateway_admin_ui

Admin UI for Sync Gateway, submodule to couchbase/sync_gateway
JavaScript
15
star
87

couchbase-scala-client

The (not yet) Official Couchbase Scala SDK
Scala
14
star
88

pouchdb-angularjs-app

Sync data with Couchbase using AngularJS and PouchDB
JavaScript
14
star
89

spring-data-couchbase

!! The project moved over to: https://github.com/springsource/spring-data-couchbase
Java
14
star
90

couchbase-aspnet-identity

A custom storage provider for ASP.NET Identity that uses Couchbase Server as a storage medium.
C#
14
star
91

ionic2-web-chat

JavaScript
14
star
92

ToDoLite-Xamarin-Forms

C#
14
star
93

docs-ng

Official repository for Couchbase documentation
HTML
14
star
94

BLIP-Cocoa

Implementation of the BLIP messaging protocol, for iOS and Mac OS X
Objective-C
14
star
95

Couchbase-Lite-PhoneGap-Kit

HTML5 apps love JSON data, this is an easy starter kit for Cordova and Couchbase Lite
Objective-C
13
star
96

PicMapper

Reads EXIF data from your Camera Roll and adds thumbnails to Couchbase Lite for display in MapKit
Swift
13
star
97

restful-angularjs-java

An example of using the Java SDK for Couchbase with an AngularJS frontend
Java
13
star
98

cloud-formation

Templates for Couchbase software for the Amazon AWS CloudFormation
JavaScript
13
star
99

cboperator-hol

This repo will have hands-on labs for Couchbase Operator for different public cloud environments
Shell
13
star
100

Couchbase-Sync-Gateway-Postman-Collection

Postman Collections for Sync Gateway 3.0 REST Interface
13
star