SapphireDb

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

Github星跟蹤圖

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

  • :wrench: Dead simple configuration
  • :satellite: Broad technology support
  • :computer: Self hosted
  • :iphone: Offline support
  • :floppy_disk: Easy to use CRUD operations
  • :zap: Model validation
  • :heavy_check_mark: Database support
  • :open_file_folder: Supports joins/includes
  • :loop: Complex server evaluated queries
  • :electric_plug: Actions
  • :key: Authorization included
  • :envelope: Messaging
  • :globe_with_meridians: 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.

// Change DbContext to SapphireDbContext
public class MyDbContext : SapphireDbContext
{
  public MyDbContext(DbContextOptions<MyDbContext> options) : base(options)
  {

  }

  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/Packages

Server

SapphireDb - Server for Asp.Net Core

SapphireDb.RedisSync

SapphireDb.HttpSync

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/SapphireDb
主編程語言C#
編程語言C# (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2018-09-28 14:24:39
推送於2022-12-08 09:22:42
最后一次提交2021-06-16 16:39:49
發布數24
最新版本名稱3.1.8 (發布於 )
第一版名稱1.0.1 (發布於 )
用户参与
星數404
關注者數20
派生數37
提交數364
已啟用問題?
問題數19
打開的問題數9
拉請求數3
打開的拉請求數3
關閉的拉請求數3
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?