SapphireDb / SapphireDb

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

Home Page:https://sapphire-db.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SapphireDb - Server for Asp.Net Core Build Status

FOSSA Status

SapphireDb logo

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.

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

FOSSA Status

About

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

https://sapphire-db.com/

License:MIT License


Languages

Language:C# 99.9%Language:Dockerfile 0.1%