GithubHelp home page GithubHelp logo

sapphiredb / sapphiredb-js Goto Github PK

View Code? Open in Web Editor NEW
43.0 4.0 3.0 4.87 MB

Client for SapphireDb, a self-hosted, easy to use realtime database for Asp.Net Core and EF Core

Home Page: https://sapphire-db.com/

License: MIT License

JavaScript 0.75% TypeScript 51.70% HTML 47.14% Dockerfile 0.09% Less 0.33%
angular websockets rxjs typescript javascript database sse server-sent-events realtime-database filter

sapphiredb-js's Introduction

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

Features

  • ๐Ÿ”ง 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

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.

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

Server

SapphireDb - Server for Asp.Net Core

SapphireDb.RedisSync

SapphireDb.HttpSync

Client

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

ng-sapphiredb - Angular client

Author

Morris Janatzek (morrisjdev)

Licenses

SapphireDb - MIT License

sapphiredb-js - MIT License

FOSSA Status

sapphiredb-js's People

Contributors

mjanatzek avatar morrisjdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sapphiredb-js's Issues

Offline storage configuration doesn' work, it keeps using SapphireNoopStorage

It keeps saying No storage was configured. Using SapphireNoopStorage and will not store things locally..

Here's my app.modules.ts:

providers: [
  {
    provide: SAPPHIRE_DB_OPTIONS,
    useValue: {
      useSsl: true,
      offlineSupport: true,
      serverBaseUrl: "localhost:4445",
      connectionType: "websocket",
    } as SapphireDbOptions,
  },
  SapphireLocalStorage,
],

track and configure reconnect

Hi, first thanks for the nice project - currently im evaluate it for some client projects and two questions came up:
how can i configure the re-connect behavior ?
how can i track the connection state of client <-> server ?

would be nice to show some connection state indicator and reduce the reconnect time based on attempts

collection remove doesn't trigger subscription update

Hi,
when you remove an entry by collection.remove - the subscription is not triggered ( of the caller )
all other clients are correctly updated

after remove, dataCollection.count() shows the corrrect number so i guess its just a missing call of the collection subscription

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.