1.0.86 • Published 8 days ago

owservable v1.0.86

Weekly downloads
-
License
Unlicense
Repository
github
Last release
8 days ago

owservable

Owservable backend

Reactive Stack JS replacement.

See owservable.github.io for more info.

Checkout my Reactive Stack Udemy course.

:books: Documentation

See the TypeDoc documentation.

:traffic_light: Testing:

See the Test coverage.

:clipboard: TODOs

  • Web Server abstraction
  • Database abstraction
  • Client-side datastore abstraction
  • Larga Data handling
  • Server-Side Events

:scroll: Uses

:floppy_disk: MongoDB Replica Set

Make sure your MongoDB database is running as a Replica Set: http://stojadinovic.net/2020/07/05/mongodb-change-streams-on-localhost-with-nodejs/

OwservableClient

This is the main class.

It processes client subscription requests, creates appropriate stores and subscribes to them to observe changes.

It extends RxJS:Subject, so that any websocket instance can subscribe to it, in order to forward updates back to the client.

IConnectionManager

Defines a Connection`Manager interface to be implemented by the application using this library.

This implementation is required for the above OwservableClient. An instance of OwservableClient is calling IConnectionManager methods accordingly.

DataMiddlewareMap

This is a map of all defined Data Middleware methods.

A Data Middleware is tied to a collection name and is used to modify an observed payload if necessary. For example, if based on users access permissions a portion of the payload needs to be removed or replaced, etc.

initiateWatchers

Method that initiates all watchers. Takes the project root folder path and a global folder name for the watchers.

Watchers can either perform simple tasks or add jobs to a queue, to be processed by the workers.

initiateCronjobs

Method that initiates all cronjobs. Takes the project root folder path and a global folder name for the cronjobs.

Cronjobs can either perform simple tasks or add jobs to a queue, to be processed by the workers.

initiateWorkers

Method that initiates all workers. Takes the project root folder path and a global folder name for the workers.

Workers can either perform simple tasks or take jobs from a queue.

MongoDB

MongoDBConnector

A MongoDB database connector class, used to initialize the database collection which Mongoose will then use.

processModels

This method parses all models and adds them to the CollectionsModelsMap if they pass validation. The method takes the project root folder path and a global folder name for the models and an optional folder name( s) to exclude, for example mixins and similar.

CollectionsModelsMap

This is a map of all Mongoose models and related MongoDB collections. It is populated automatically during the execution of processModels.

observableModel

Requires MongoDB 3.6+: This method returns an RxJS Subject that can be subscribed to and thus observe a particular MongoDB collection. This method takes a Mongoose model instance.

observableDatabase

Requires MongoDB 4.0+: This method returns an RxJS Subject that can be subscribed to and thus observe the entire MongoDB database.

Routes

processFastifyBlipp

This method stores all fastify routes into the RoutesMap in order to display them on request as a form of quick routes documentation.

This method is set as blippLog options attribute during fastify registration of the fastify-blipp plugin. Eg. server.register(fastifyBlipp, {blippLog: processFastifyBlipp});.

RoutesMap

This is a map of all available routes. It is populated automatically during the execution of processFastifyBlipp.

addFastifyRoutes

This method adds all routes to fastify automatically. It requires as parameters a fastify instance, the project root folder path and a global folder name for the routes.

cleanRelativePath

Helper metohd used in addFastifyRoutes to generate the route path from filename and file location relative to routes root folder.

Store

AStore

Abstract class for CountStore, DocumentStore and CollectionStore implementations.

EStoreType

Enum for existing store types: COUNT | DOCUMENT | COLLECTION.

CountStore

Count store, observes a particular query and returns only an integer representing the count of response rows.

DocumentStore

Document store, observes a particular query and returns all response rows.

CollectionStore

Collection store, observes a particular query and returns all response rows.

storeFactory

Store factory method, creates an appropriate AStore instance based on passed subscription parameters.

Types

These types are self explanatory.

  • CronJobType
  • WatcherType
  • WorkerType
  • StoreScopeType
  • StoreSubscriptionConfigType
  • StoreSubscriptionUpdateType
  • ConnectionManagerRefreshType

:scroll: License

Licensed under The Unlicense.

:sparkles: Contributors

This project follows the all-contributors specification.

Contributions of any kind welcome!

:chart_with_upwards_trend: UML

Checkout the UML diagram.

1.0.86

8 days ago

1.0.84

10 days ago

1.0.85

10 days ago

1.0.83

1 month ago

1.0.82

2 months ago

1.0.81

2 months ago

1.0.8

3 months ago

1.0.2

3 months ago

1.0.1

4 months ago

0.9.9

6 months ago

0.9.961

5 months ago

0.9.962

5 months ago

1.0.0

5 months ago

0.9.96

5 months ago

0.9.92

5 months ago

0.9.93

5 months ago

0.9.95

5 months ago

0.9.91

6 months ago

0.9.82

7 months ago

0.9.8

8 months ago

0.9.81

8 months ago

0.9.7

9 months ago

0.9.4

9 months ago

0.8.63

11 months ago

0.9.3

9 months ago

0.8.62

11 months ago

0.9.6

9 months ago

0.9.5

9 months ago

0.8.61

11 months ago

0.8.60

11 months ago

0.8.52

11 months ago

0.8.51

11 months ago

0.8.54

11 months ago

0.8.53

11 months ago

0.8.50

11 months ago

0.8.42

11 months ago

0.9.0

9 months ago

0.9.2

9 months ago

0.9.1

9 months ago

0.9.71

9 months ago

0.9.72

8 months ago

0.8.41

1 year ago

0.8.40

1 year ago

0.8.38

1 year ago

0.8.37

1 year ago

0.8.39

1 year ago

0.8.34

1 year ago

0.8.33

1 year ago

0.8.36

1 year ago

0.8.35

1 year ago

0.8.30

1 year ago

0.8.32

1 year ago

0.8.31

1 year ago

0.8.23

2 years ago

0.8.22

2 years ago

0.8.25

1 year ago

0.8.24

1 year ago

0.8.21

2 years ago

0.8.20

2 years ago

0.8.27

1 year ago

0.8.26

1 year ago

0.8.28

1 year ago

0.8.12

2 years ago

0.8.11

2 years ago

0.8.14

2 years ago

0.8.13

2 years ago

0.8.19

2 years ago

0.8.16

2 years ago

0.8.15

2 years ago

0.8.18

2 years ago

0.8.17

2 years ago

0.8.9

2 years ago

0.8.8

2 years ago

0.8.5

2 years ago

0.8.7

2 years ago

0.8.6

2 years ago

0.8.10

2 years ago

0.8.4

2 years ago

0.8.1

2 years ago

0.8.3

2 years ago

0.8.2

2 years ago

0.7.9

2 years ago

0.7.8

2 years ago

0.7.7

2 years ago

0.8.0

2 years ago

0.7.6

2 years ago

0.7.5

2 years ago

0.7.2

2 years ago

0.6.3

2 years ago

0.7.1

2 years ago

0.6.2

2 years ago

0.7.3

2 years ago

0.5.0

2 years ago

0.7.0

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.4.9

2 years ago

0.4.8

2 years ago

0.4.5

2 years ago

0.4.7

2 years ago

0.4.6

2 years ago

0.4.4

2 years ago

0.4.0

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.3.22

3 years ago

0.3.21

3 years ago

0.3.20

3 years ago

0.3.2

3 years ago

0.3.12

3 years ago

0.3.11

3 years ago

0.3.9

3 years ago

0.3.8

3 years ago

0.3.10

3 years ago

0.3.7

3 years ago

0.3.6

3 years ago

0.3.5

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago