Skip to content

greenapp-debug/SapphireDb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SapphireDb - Server for Asp.Net Core Build Status

SapphireDb logo

SapphireDb is an open source library that enables you to easily create your own application with realtime data synchronization.

Build amazing reactive applications with realtime data synchronization and get the best results of your project. SapphireDb should serve as a self hosted alternative to firebase realtime database and firestore and also gives you an alternative to SignalR.

SapphireDb is an extension for Asp.Net Core and EF Core and creates a generic API that you can easily use with different clients. This enables you to rapidly develop amazing applications.

Check out the documentation for more details: Documentation

Advantages

  • 🔧 Dead simple configuration
  • 🌠 Blazing fast development
  • 📡 Modern technologies
  • 💻 Self hosted
  • 💾 Easy CRUD operations
  • 🔑 Authentication/Authorization included
  • ✔️ Database support
  • 📂 Supports includes/joins
  • 🔌 Actions
  • 🌐 NLB support

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

About

A self-hosted, easy to use realtime database

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%