biozal / dotnet-maui-cblite-learning-path

Maui Learning Path for Couchbase Lite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Learn Couchbase Lite with dotnet and Maui

In this learning path you will be reviewing an dotnet Application written in C# and Maui that uses the Couchbase Lite .NET SDK. You will learn how to get and insert documents using the key-value engine, query the database using the QueryBuilder engine or SQL++, and learn how to sync information between your mobile app and either a Couchbase Server using Sync Gateway or using peer-to-peer technology.

Full documentation can be found on the Couchbase Developer Portal

Prerequisites

To run this prebuilt project, you will need:

  • Familiarity with building dotnet Application with Maui.
  • Visual Studio or Visual Studio Code
  • dotnet version 7 or above installed and setup
  • Android SDK installed and setup (> v.33.0.0)
  • Android Build Tools (> v.33.0.0)
  • Android device or emulator running API level 24 or above

Installing Couchbase Lite Framework

  • Nuget can be used to install the Couchbase Lite nuget package. From the terminal in your main project directory, run the following command:
dotnet add package Couchbase.Lite

An entry should be added to your CSPROJ file.

...
	<ItemGroup>
		<PackageReference Include="Couchbase.Lite" Version="3.0.8" />
	</ItemGroup>

For more information on installation, please see the Couchbase Lite Documentation.

Demo Application

Overview

The demo application used in this learning path is based on auditing inventory for a fictitious company. Most companies have some inventory - from laptops to office supplies and from time to time must audit their stock. For example, when a user's laptop breaks, they can send out a replacement from the inventory of spare laptops they have on hand.

Users running the mobile app would log into the application to see the projects they are assigned to work on. Then, the user would look at the project to see which office location they need to travel to. Once at the site, they would inspect the number of items, tracking them in the mobile application.

Architecture

The demo application uses application architecture concepts in developing modern Maui applications recommended by the Maui development team.

Dependency injection is handled using the built-in dotnet classes that are popular with the dotnet community. Microsoft.Extensions.DependencyInjection is used to set up the dependency injection container. The container is used to set up the services that are used throughout the application. The services are then injected into the various classes that need them. The services are also injected into the ViewModels that are used to control the state of the application.

Try it out

  • Open src/Couchbase.Maui.sln using Visual Studio.
  • Build and run the project.
  • Verify that you see the login screen.

About

Maui Learning Path for Couchbase Lite

License:MIT License


Languages

Language:C# 44.5%Language:Shell 27.1%Language:Python 17.4%Language:JavaScript 9.4%Language:Dockerfile 1.6%