• This repository has been archived on 12/Apr/2022
  • Stars
    star
    111
  • Rank 314,510 (Top 7 %)
  • Language
    Java
  • License
    MIT License
  • Created about 9 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

Couchbase Lite binding for React Native Android & iOS

⚠️ This repo is obsolete. It is no longer maintained and is based on a version of Couchbase Lite that reached end of life years ago. Please see the new version of this repo for more up to date information.

react-native-couchbase-lite

NOTE: This plugin works for Couchbase Lite 1.x only. For new projects, we recommend to use the Couchbase Lite 2.0 Native API and to write your own wrapper to access Couchbase Lite APIs from a JavaScript codebase (see https://facebook.github.io/react-native/docs/communication-ios.html).

Disclaimer

This package is not an official couchbase plugin and is not supported in any way by couchbase. If you have issues with it please do not use the couchbase forums but raise an issue here instead. Although this package does work as described it may not be fully featured and may not be suitable for your requirements. This package is just a thin layer over the CBL REST API, PRs and suggestions are welcome!

Couchbase Lite binding for react-native on both iOS and Android. It works by exposing some functionality to the native Couchbase Lite and the remaining actions are peformed via the REST API.

Installation

  1. Create a new React Native project.

    react-native init <project-name>
    
  2. Navigate to your project directory and install the plugin.

    cd <project-name>
    npm install react-native-couchbase-lite --save
    
  3. Link the native libraries.

    react-native link react-native-couchbase-lite
    

    iOS only

    Download the Couchbase Lite iOS SDK from here and drag CouchbaseLite.framework, CouchbaseLiteListener.framework, CBLRegisterJSViewCompiler.h, libCBLJSViewCompiler.a in the Xcode project.

Make sure these files can be resolved via Framework Search Paths in the XCODE projects Build settings, either by adding them to one of the mentioned directories or adding a new location in the list.

  1. Start React Native.

    react-native start
    
  2. Build and run for iOS/Android.

Note: If you wish to install the plugin from source, refer to the other installation options page.

Getting Started

In your app's entrypoint file, import the plugin and initialize the Couchbase Lite Listener.

import Couchbase from "react-native-couchbase-lite";

Couchbase.initRESTClient(manager => {
	// use manager to perform operations
});

The manager is the Couchbase Lite entrypoint to perform different operations.

Documentation

The full API is derived from the Couchbase Lite Swagger spec.

The API is self documented through the help() method. You can print the list of tags for an endpoint.

Couchbase.initRESTClient(manager => {
	// use manager to perform operations
	manager.help();    // prints all tags and endpoints
});

Once you know the kind of operation to perform, you can print all the endpoints available on a particular tag.

Couchbase.initRESTClient(manager => {
	// use manager to perform operations
	manager.database.help();    // prints all endpoints for the database tag
});

End finally drill down on a particular endpoint for the operation you wish to perform.

Couchbase.initRESTClient(manager => {
	// use manager to perform operations
	manager.database.put_db.help(); // prints the list of parameters for PUT /{db}
});

As you can see, there are two parameters to provide (db and body). The same exact parameters are documented on the /{db}}/_bulk_docs endpoint.

Publishing to npm

  1. Bump the version number in package.json.
  2. Run npm publish locally (it will fail if you don't access rights to publish to npm for this module).

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
287
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
190
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

Grocery-Sync-iOS

The simplest Couchbase Lite demo app for iOS
Objective-C
154
star
11

mini-hacks

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

GrocerySync-Android

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

couchbase-rs

The official, community supported Couchbase Rust SDK
C
104
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

couchbase-shell

Shell yeah!
Rust
68
star
21

cbgb

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

couchstore

couchbase storage file library
C
58
star
23

devguide-examples

Examples for topics in the developer guide
C
58
star
24

mobile-training-todo

ToDo List app built with Couchbase Mobile
Java
57
star
25

touchbase

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

vagrants

Vagrant files to provision Couchbase VMs
Puppet
56
star
27

try-cb-java

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

TodoLite-PhoneGap

Basic todo list app for Couchbase Lite and PhoneGap
JavaScript
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

photo-drop

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

couchbase-mobile-tools

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

iOS-Couchbase-manifest

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

try-cb-dotnet

Couchbase Travel Sample app written in ASP.NET
C#
35
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

sdk-rfcs

SDK RFCs
34
star
39

ForestDB-Benchmark

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

php-couchbase-v2

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

cellar

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

WebSockets-Cocoa

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

CouchChat-PhoneGap

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

TodoLite-Ionic

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

libcouchbase-cxx

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

walrus

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

crouton

C++20 coroutine runtime and cross-platform I/O library
C++
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

ng-couchbase-lite

AngularJS Wrapper for Couchbase Lite RESTful Endpoints
JavaScript
24
star
53

cbugg

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

blog-source-code

Source code for blog posts
C#
23
star
55

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
56

mobile-travel-sample

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

try-cb-python

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

Android-Couchbase-SourceBuild

Full source build of Android stuff.
Shell
22
star
59

couchbase-nginx-module

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

learningportal

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

pouchdb-angular2

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

showfast

Performance dashboard
HTML
19
star
63

couchbase-net-examples

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

couchbase-lite-titanium

Couchbase Lite Titanium Module
Objective-C
18
star
65

erlgeom

Erlang binding for geometry libraries
Erlang
18
star
66

sdk-doctor

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

tuqtng

TUQ - The Next Generation
Go
18
star
68

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
69

sequoia

Scalable testing with containers
Python
17
star
70

gameapi-nodejs

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

couchbase-lite-local

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

sg-replicate

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

couchbase-capi-server

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

cbforest

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

dcp-documentation

couchbase unified protocol for replication
17
star
76

DeveloperDay

Couchbase Developer Day Sample Code By Language
Java
17
star
77

BLIP-Cpp

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

couchbase-spark-samples

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

couchtalk-node

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

php-ext-couchbase

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

try-cb-golang

Go
16
star
82

todolite-electron-pouchdb

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

couchbase-spring-cache

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

mobile-testkit

Mobile QE Test Framework
Python
15
star
85

sync_gateway_admin_ui

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

couchbase-scala-client

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

pouchdb-angularjs-app

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

ToDoLite-Xamarin-Forms

C#
14
star
89

couchbase-aspnet-identity

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

docs-ng

Official repository for Couchbase documentation
HTML
14
star
91

ionic2-web-chat

JavaScript
14
star
92

BLIP-Cocoa

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

spring-data-couchbase

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

Couchbase-Lite-PhoneGap-Kit

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

PicMapper

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

restful-angularjs-java

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

cloud-formation

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

cboperator-hol

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

Couchbase-Sync-Gateway-Postman-Collection

Postman Collections for Sync Gateway 3.0 REST Interface
13
star
100

bikeshop-cb

Node.js Example Application for Couchbase using the Ottoman ODM
JavaScript
12
star