Discover how to program interactions with the Couchbase Server via the data, query, and search services — using the Travel Sample Application with the built-in Travel Sample data Bucket.
Discover how to program interactions with the Couchbase Server via the data, query, and search services — using the Travel Sample Application with the built-in Travel Sample data Bucket. This version demonstrates various features of Couchbase, including the Collections feature new in Server 7.0.
Fetch the Couchbase C SDK travel-sample Application REST Backend from github:
git clone https://github.com/couchbaselabs/try-cb-lcb.git
With Docker installed, you should now be able to run a bare-bones copy of Couchbase Server, load the travel-sample, add indexes, install the sample-application and its frontend, all by running a single command:
For Couchbase Server 7.1, make sure that you have at least one node each of data; query; index; and search. For a development box, mixing more than one of these on a single node (given enough memory resources) is perfectly acceptable.
If you have yet to install Couchbase Server in your development environment start here.
See the README at https://github.com/couchbaselabs/try-cb-lcb for full details of how to run and tweak the C SDK travel-sample app.
Give yourself a username and password and click Register.
Now try out a few queries, and see Search in action for the hotel finder feature.
The backend code shows
libcouchbase in action with Query and Search,
but also how to plug together all of the elements and build an application with Couchbase Server and the C SDK.
For example, this snippet of the config:
route /api/airports tcblcb_api_airports
is defined in api-airports.c
Other files contain the functions for handling users, registration, and SQL++ (formerly N1QL) queries.
See the Travel App Data Model reference page for more information about the sample data set used.