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
- 🔧 Dead simple configuration
- 🌠 Blazing fast development
- 📡 Modern technologies
- 💻 Self hosted
- 💾 Easy CRUD operations
- 🔑 Authentication/Authorization included
- ✔️ Database support
- 📂 Supports includes/joins
- 🔌 Actions
- 🌐 NLB support
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/
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; }
}
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();
}
}
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
SapphireDb - MIT License
sapphiredb-js - MIT License