/try-cb-dotnet

Couchbase Travel Sample app written in ASP.NET

Primary LanguageC#Apache License 2.0Apache-2.0

Couchbase .NET travel-sample Application

This is a sample application for getting started with Couchbase Server 4.5 and the .NET SDK. The application runs a single page UI for demonstrating SQL for Documents (N1QL) and Full Text Search (FTS) querying capabilities. It uses Couchbase Server 4.5 together with ASP.NET Web API 2, Angular2 and Bootstrap.

The application is a flight planner that allows the user to search for and select a flight route (including the return flight) based on airports and dates. Airport selection is done dynamically using an angular autocomplete box bound to N1QL queries on the server side. After selecting a date, it then searches for applicable air flight routes from a previously populated database. An additional page allows users to search for Hotels using less structured keywords.

Application

Prerequisites

The following pieces need to be in place in order to run the application.

  • Couchbase Server 4.5 or later with the travel-sample bucket setup
  • Visual Studio 2015 Community or Professional

Running the application

To download the application you can either download the archive or clone the repository:

$ git clone https://github.com/couchbaselabs/try-cb-dotnet.git

Open Visual Studio and open src/try-cb-dotnet.sln from where you downloaded or cloned the source repository. Run (F5 or Debug > Start Debugging) and if all goes well, this will start an IIS Express instance running the application on http://localhost:8080.

Note that when you run the application for the first time, it will make sure that all indexes are created for best performance, so it might take a bit longer.

Configuration Options

By default the application will connect to the Couchbase Server on localhost:8091 and use the travel-sample bucket. It will however separate user account data into the default bucket (and these documents can be set to expire). All these options can be modified in src/Web.Config.

Couchbase Server 5.0

There is a 5.0-updates branch for the upcoming Couchbase Server 5.0 that has additional changes.