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 use sapphiredb you have to install the package using npm
In your app folder execute
npm install sapphiredb rxjs axios -S
var sapphiredb = require('sapphiredb');
var db = new sapphiredb.SapphireDb({
serverBaseUrl: 'localhost:5000',
useSsl: false,
apiKey: 'webapp',
apiSecret: 'pw1234'
});
db.collection('demo.entries').values().subscribe(function (values) {
console.log(values);
});sapphiredb also works in a NodeJs application. It will use polling as communication strategy by default. If you want to use websockets you have to install an external library for that.
npm install ws -S
var sapphiredb = require('sapphiredb');
var ws = require('ws');
WebSocket = ws;
var db = new sapphiredb.SapphireDb({
serverBaseUrl: 'localhost:5000',
useSsl: false,
apiKey: 'webapp',
apiSecret: 'pw1234'
});
db.collection('demo.entries').values().subscribe(function (values) {
console.log(values);
});| Browser/Engine | Websocket | SSE | Polling |
|---|---|---|---|
| Chrome | ✔️ | ✔️ | ✔️ |
| Firefox | ✔️ | ❌ | ✔️ |
| Opera | ✔️ | ❌ | ✔️ |
| Edge | ✔️ | ❌ | ✔️ |
| Internet Explorer 11 | ✔️ | ❌ | ✔️ |
| NodeJs | ✔️ | ❌ | ✔️ |
JS, NodeJs, React, Svelte ...
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
