SapphireDb 2.1.0

A self-hosted, easy to use realtime database

There is a newer version of this package available.
See the version list below for details.
Install-Package SapphireDb -Version 2.1.0
dotnet add package SapphireDb --version 2.1.0
<PackageReference Include="SapphireDb" Version="2.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SapphireDb --version 2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SapphireDb, 2.1.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install SapphireDb as a Cake Addin
#addin nuget:?package=SapphireDb&version=2.1.0

// Install SapphireDb as a Cake Tool
#tool nuget:?package=SapphireDb&version=2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

SapphireDb - Server for Asp.Net Core Build Status

SapphireDb is a self-hosted, easy to use realtime database for Asp.Net Core and EF Core.

It creates a generic API you can easily use with different clients to effortlessly create applications with realtime data synchronization.
SapphireDb should serve as a self hosted alternative to firebase realtime database and firestore on top of .Net.

Check out the documentation for more details: Documentation

Features

  • 🔧 Dead simple configuration
  • 📡 Broad technology support
  • 💻 Self hosted
  • 📱 Offline support
  • 💾 Easy to use CRUD operations
  • ⚡ Model validation
  • ✔️ Database support
  • 📂 Supports joins/includes
  • ➿ Complex server evaluated queries
  • 🔌 Actions
  • 🔑 Authorization included
  • ✉️ Messaging
  • 🌐 Scalable

Learn more

Installation

Install package

To install the package execute the following command in your package manager console

PM> Install-Package SapphireDb

You can also install the extension using Nuget package manager. The project can be found here: https://www.nuget.org/packages/SapphireDb/

Configure DbContext

You now have to change your DbContext to derive from SapphireDbContext. Also make sure to adjust the constructor parameters.

// Change DbContext to SapphireDbContext
public class MyDbContext : SapphireDbContext
{
  //Add SapphireDatabaseNotifier for DI
  public MyDbContext(DbContextOptions<MyDbContext> options, SapphireDatabaseNotifier notifier) : base(options, notifier)
  {

  }

  public DbSet<User> Users { get; set; }

  public DbSet<Test> Tests { get; set; }
}

Register services and update pipeline

To use the SapphireDb you also have to make some changes in your Startup.cs-File.

public class Startup
{
  public void ConfigureServices(IServiceCollection services)
  {
    //Register services
    services.AddSapphireDb(...)
      .AddContext<MyDbContext>(cfg => ...);
  }

  public void Configure(IApplicationBuilder app)
  {
    //Add Middleware
    app.UseSapphireDb();
  }
}

Examples

Server

AspNet Core Example

Client

React Example

Svelte Example

NodeJs Example

Angular Example

Documentation

Check out the documentation for more details: Documentation

Implementations

Server

SapphireDb - Server for Asp.Net Core

Client

sapphiredb - JS client (JS, NodeJs, React, Svelte, ...)

ng-sapphiredb - Angular client

Author

Morris Janatzek (morrisjdev)

Licenses

SapphireDb - MIT License

sapphiredb-js - MIT License

SapphireDb - Server for Asp.Net Core Build Status

SapphireDb is a self-hosted, easy to use realtime database for Asp.Net Core and EF Core.

It creates a generic API you can easily use with different clients to effortlessly create applications with realtime data synchronization.
SapphireDb should serve as a self hosted alternative to firebase realtime database and firestore on top of .Net.

Check out the documentation for more details: Documentation

Features

  • 🔧 Dead simple configuration
  • 📡 Broad technology support
  • 💻 Self hosted
  • 📱 Offline support
  • 💾 Easy to use CRUD operations
  • ⚡ Model validation
  • ✔️ Database support
  • 📂 Supports joins/includes
  • ➿ Complex server evaluated queries
  • 🔌 Actions
  • 🔑 Authorization included
  • ✉️ Messaging
  • 🌐 Scalable

Learn more

Installation

Install package

To install the package execute the following command in your package manager console

PM> Install-Package SapphireDb

You can also install the extension using Nuget package manager. The project can be found here: https://www.nuget.org/packages/SapphireDb/

Configure DbContext

You now have to change your DbContext to derive from SapphireDbContext. Also make sure to adjust the constructor parameters.

// Change DbContext to SapphireDbContext
public class MyDbContext : SapphireDbContext
{
  //Add SapphireDatabaseNotifier for DI
  public MyDbContext(DbContextOptions<MyDbContext> options, SapphireDatabaseNotifier notifier) : base(options, notifier)
  {

  }

  public DbSet<User> Users { get; set; }

  public DbSet<Test> Tests { get; set; }
}

Register services and update pipeline

To use the SapphireDb you also have to make some changes in your Startup.cs-File.

public class Startup
{
  public void ConfigureServices(IServiceCollection services)
  {
    //Register services
    services.AddSapphireDb(...)
      .AddContext<MyDbContext>(cfg => ...);
  }

  public void Configure(IApplicationBuilder app)
  {
    //Add Middleware
    app.UseSapphireDb();
  }
}

Examples

Server

AspNet Core Example

Client

React Example

Svelte Example

NodeJs Example

Angular Example

Documentation

Check out the documentation for more details: Documentation

Implementations

Server

SapphireDb - Server for Asp.Net Core

Client

sapphiredb - JS client (JS, NodeJs, React, Svelte, ...)

ng-sapphiredb - Angular client

Author

Morris Janatzek (morrisjdev)

Licenses

SapphireDb - MIT License

sapphiredb-js - MIT License

NuGet packages (2)

Showing the top 2 NuGet packages that depend on SapphireDb:

Package Downloads
SapphireDb.RedisSync
Redis sync module for SapphireDb
SapphireDb.HttpSync
Http sync module for SapphireDb

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
3.1.7-alpha 68 3/10/2021
3.1.6-alpha 60 3/9/2021
3.1.5-alpha 219 10/26/2020
3.1.4-alpha 170 10/26/2020
3.1.3-alpha 128 10/26/2020
3.1.2-alpha 164 10/26/2020
3.1.1-alpha 315 8/2/2020
3.1.0-alpha 161 8/2/2020
3.0.0 11,984 7/25/2020
2.2.1 167 7/22/2020
2.2.0 838 6/20/2020
2.1.3 214 4/4/2020
2.1.2 224 4/3/2020
2.1.1 197 3/24/2020
2.1.0 325 3/21/2020
2.0.0 263 2/24/2020
1.5.0 186 2/18/2020
1.4.0 293 2/8/2020
1.3.0 223 1/21/2020
1.2.0 217 1/15/2020
1.1.6 200 1/13/2020
1.1.5 217 1/7/2020
1.1.4 281 1/7/2020
1.1.3 195 1/6/2020
1.1.1 262 1/4/2020
1.1.0 298 1/3/2020
1.0.7 238 1/2/2020
1.0.6 255 12/27/2019
1.0.5 206 12/22/2019
1.0.4 194 12/18/2019
1.0.3 204 12/9/2019
1.0.2 190 12/8/2019
1.0.1 206 12/8/2019
1.0.0 203 12/4/2019
Show less