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