Awesome Open Source
Awesome Open Source

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


  • 🔧 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


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:

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
      .AddContext<MyDbContext>(cfg => ...);

  public void Configure(IApplicationBuilder app)
    //Add Middleware



AspNet Core Example


React Example

Svelte Example

NodeJs Example

Angular Example


Check out the documentation for more details: Documentation



SapphireDb - Server for Asp.Net Core




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

ng-sapphiredb - Angular client


Morris Janatzek (morrisjdev)


SapphireDb - MIT License

sapphiredb-js - MIT License

FOSSA Status

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
c-sharp (12,441
database (1,238
firebase (491
websockets (314
self-hosted (220
realtime (217
firestore (97
entity-framework (72
net (66
core (66
sse (54
aspnet (52
entity (51
net-core (38
server-sent-events (32
signalr (30
realtime-database (26
entityframework (16