{"id":19831234,"url":"https://github.com/reactive-stack-js/reactive-stack-js-backend","last_synced_at":"2025-10-18T23:20:02.493Z","repository":{"id":39621627,"uuid":"374365989","full_name":"reactive-stack-js/reactive-stack-js-backend","owner":"reactive-stack-js","description":"reactive-stack-js rest backend","archived":false,"fork":false,"pushed_at":"2022-05-30T16:26:47.000Z","size":378,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-19T12:18:48.137Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://reactive-stack-js.github.io/reactive-stack-js-backend/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reactive-stack-js.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-06T13:21:57.000Z","updated_at":"2021-09-19T14:51:27.000Z","dependencies_parsed_at":"2022-08-28T01:40:42.294Z","dependency_job_id":null,"html_url":"https://github.com/reactive-stack-js/reactive-stack-js-backend","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/reactive-stack-js/reactive-stack-js-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactive-stack-js%2Freactive-stack-js-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactive-stack-js%2Freactive-stack-js-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactive-stack-js%2Freactive-stack-js-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactive-stack-js%2Freactive-stack-js-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reactive-stack-js","download_url":"https://codeload.github.com/reactive-stack-js/reactive-stack-js-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactive-stack-js%2Freactive-stack-js-backend/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260346877,"owners_count":22995151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T11:29:27.510Z","updated_at":"2025-10-18T23:19:57.456Z","avatar_url":"https://github.com/reactive-stack-js.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![reactive-stack-js](https://avatars0.githubusercontent.com/u/72337471?s=75)\n\n## ReactiveStack backend\nSee \u003ca href=\"https://github.com/reactive-stack-js\" target=\"_blank\"\u003ereactive-stack-js\u003c/a\u003e for more info.\n\n## TypeDoc Documentation\nSee the \u003ca href=\"https://reactive-stack-js.github.io/reactive-stack-js-backend/docs/\" target=\"_blank\"\u003eTypeDoc documentation\u003c/a\u003e.\n\n# Documentation\n\n### ReactiveStackClient\nThis is the main class.\n\nIt processes client subscription requests, creates appropriate stores and subscribes to them to observe changes.\n\nIt extends RxJS:Subject, so that any websocket instance can subscribe to it, in order to forward updates back to the client.\n\n### IConnectionManager\nDefines a Connection Manager interface to be implemented by the application using this library.\n\nThis implementation is required for the above ```ReactiveStackClient```. An instance of ```ReactiveStackClient``` is calling ```IConnectionManager``` methods accordingly.\n\n### DataMiddlewareMap\nThis is a map of all defined Data Middleware methods.\n\nA Data Middleware is tied to a store scope ```'count' | 'one' | 'many'``` and collection name and is used to modify an observed payload if necessary.\nFor example, if based on users access permissions a portion of the payload needs to be removed or replaced, etc.\n\n### initiateWorkers\nMethod that initiates all workers. Takes folder path as attribute.\n\n### initiateCronjobs\nMethod that initiates all cronjobs. Takes folder path as attribute.\n\n## MongoDB\n### MongoDBConnector\nA MongoDB database connector class, used to initialize the database collection which Mongoose will then use.\n\n### processModels\nThis method parses all models and adds them to the ```CollectionsModelsMap``` if they pass validation. The method takes the folder path for the models and an optional folder name(s) to exclude, for example ```mixins``` and similar.\n\n### CollectionsModelsMap\nThis is a map of all Mongoose models and related MongoDB collections. It is populated automatically during the execution of ```processModels```.\n\n### observableModel\nRequires 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.\n\n### observableDatabase\nRequires MongoDB 4.0+: This method returns an RxJS Subject that can be subscribed to and thus observe the entire MongoDB database.\n\n## Routes\n### processFastifyBlipp\nThis method stores all fastify routes into the ```RoutesMap``` in order to display them on request as a form of quick routes documentation.\n\nThis method is set as ```blippLog``` options attribute during fastify registration of the ```fastify-blipp``` plugin. Eg. ```server.register(fastifyBlipp, {blippLog: processFastifyBlipp});```.\n\n### RoutesMap\nThis is a map of all available routes. It is populated automatically during the execution of ```processFastifyBlipp```.\n\n### addFastifyRoutes\nThis method adds all routes to fastify automatically. It requires as parameters a fastify instance and routes folder path.\n\n### cleanRelativePath\nHelper metohd used in ```addFastifyRoutes``` to generate the route path from filename and file location relative to routes root folder.\n\n## Store\n### AStore\nAbstract class for ```CountStore```, ```DocumentStore``` and ```CollectionStore``` implementations.\n\n### EStoreType\nEnum for existing store types: ```COUNT | DOCUMENT | COLLECTION```.\n\n### CountStore\nCount store, observes a particular query and returns only an integer representing the count of response rows.\n\n### DocumentStore\nDocument store, observes a particular query and returns all response rows.\n\n### CollectionStore\nCollection store, observes a particular query and returns all response rows.\n\n### storeFactory\nStore factory method, creates an appropriate AStore instance based on passed subscription parameters.\n\n## Types\nThese types are self explanatory.\n- CronJobType\n- WorkerType\n- StoreScopeType\n- StoreSubscriptionConfigType\n- StoreSubscriptionUpdateType\n- ConnectionManagerRefreshType\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactive-stack-js%2Freactive-stack-js-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freactive-stack-js%2Freactive-stack-js-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactive-stack-js%2Freactive-stack-js-backend/lists"}