All Projects → scalecube → scalecube-js

scalecube / scalecube-js

Licence: Apache-2.0 license
Toolkit for working in microservices/micro-frontends architecture.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to scalecube-js

Microfrontends
Micro-frontend Architecture in Action-微前端的那些事儿
Stars: ✭ 2,696 (+4179.37%)
Mutual labels:  micro-services, micro-frontends, microfrontends
fronts
A progressive micro frontends framework for building Web applications
Stars: ✭ 493 (+682.54%)
Mutual labels:  micro-frontends, microfrontends
micro-frontend-gateway
🌐 Micro Frontends PoC in Angular - GATEWAY
Stars: ✭ 26 (-58.73%)
Mutual labels:  micro-frontends, microfrontends
Qiankun
📦 🚀 Blazing fast, simple and complete solution for micro frontends.
Stars: ✭ 11,497 (+18149.21%)
Mutual labels:  micro-frontends, microfrontends
springboot-rsocketjwt-example
Example of using JWT with RSocket and Spring Boot
Stars: ✭ 26 (-58.73%)
Mutual labels:  rsocket
plastic-bag
An open source library to work with micro frontends.
Stars: ✭ 22 (-65.08%)
Mutual labels:  microfrontends
symbiote.js
Simple, light and very powerful library to create embedded components for any purpose, with a data flow management included.
Stars: ✭ 40 (-36.51%)
Mutual labels:  micro-frontends
ragu
🔪 A micro-frontend framework with Server Side Rendering.
Stars: ✭ 85 (+34.92%)
Mutual labels:  micro-frontends
spring-demo
Demo application for Netifi Proteus and RSocket. The guideline is available here ->
Stars: ✭ 24 (-61.9%)
Mutual labels:  rsocket
rallie
a library that helps users implement decentralized front-end micro service architecture
Stars: ✭ 285 (+352.38%)
Mutual labels:  microfrontends
lego
🚀 Web-components made lightweight & Future-Proof.
Stars: ✭ 69 (+9.52%)
Mutual labels:  microfrontends
moleculer-sc
API Gateway service for Moleculer framework using SocketCluster
Stars: ✭ 19 (-69.84%)
Mutual labels:  micro-services
TelephoneDirectory
microservices-> .net 6, golang - Docker, Ocelot, RabbitMq, MassTransit, mssql, postgresql, elasticsearch, kibana, jwt
Stars: ✭ 40 (-36.51%)
Mutual labels:  micro-services
spring-cloud-function-demo
Spring cloud function with RSocket
Stars: ✭ 23 (-63.49%)
Mutual labels:  rsocket
nut
🌰 A framework born for micro frontends
Stars: ✭ 101 (+60.32%)
Mutual labels:  microfrontends
tictactoe-microservices-example
An example of Spring Cloud Microservices application based on books (see Links section)
Stars: ✭ 23 (-63.49%)
Mutual labels:  reactive-microservices
netifi-quickstart-java
Project to assist you in getting started using Netifi.
Stars: ✭ 23 (-63.49%)
Mutual labels:  rsocket
admincraft
Admincraft is a vue admin application quick build tool
Stars: ✭ 36 (-42.86%)
Mutual labels:  micro-frontends
vue-mfe
✨ The easiest way to build a Vue.js micro front-end App.
Stars: ✭ 38 (-39.68%)
Mutual labels:  micro-frontends
a-feign-like-rsocket-client
@Mario5Gray had a great idea - a Feign for RSocket. So, here it is.
Stars: ✭ 20 (-68.25%)
Mutual labels:  rsocket

Scalecube-js

Scalecube is a toolkit for creating microservices/micro-frontends based systems.
what is scalecube-js | play with codesandbox | full documentation

Join the chat at https://gitter.im/scalecube-js/Lobby

Project Status

Scalecube v0.2.x is stable, the API will be supported until 1.1.2022.
We want to collect feedback from the community before releasing 1.x.x but we don't foresee any majors API change.
If you have any feedback please open issue or talk with us on gitter

quick start

If you are new to scalecube, it's recommended to read this introduction to scalecube.

Scalecube provide browser and NODE templates, configured and ready for use

Browser

yarn add @scalecube/browser or npm i @scalecube/browser

import { createMicroservice, ASYNC_MODEL_TYPES } from '@scalecube/browser';

Node

yarn add @scalecube/node or npm i @scalecube/node

import { createMicroservice, ASYNC_MODEL_TYPES } from '@scalecube/node';

Advanced

You can create your own customized setup, for more details: go to Microservice

Usage (Browser and node)

create a seed

// node - supported WS, WSS and TCP
export const MySeedAddress: 'ws://localhost:8000';
// Browser - under browser post message will be used as transport
export const MySeedAddress: 'seed';

// Create a service
createMicroservice({
   address : MySeedAddress
});

Create a service

// Create service definition
export const greetingServiceDefinition = {
  serviceName: 'GreetingService',
  methods: { 
    hello: {
      asyncModel: ASYNC_MODEL_TYPES.REQUEST_RESPONSE,
    }
  },
};
// Create a service
createMicroservice({
  services : [{
    definition: greetingServiceDefinition,
    reference: {
      hello : async (name) => `Hello ${name}`
    }, 
   }],
   seedAddress : MySeedAddress
});

Use a service

const microservice = createMicroservice({seedAddress : MySeedAddress})

// With proxy
const greetingService = microservice.createProxy({
    serviceDefinition: greetingServiceDefinition
});

greetingService.hello('ME').then(console.log) // Hello ME

*We let Scalecube choose our addresses for us, we know only the seed address.
After we connected to the seed we will see the whole cluster. In the browser we don't need to import modules, we can create multiple bundles, scalecube will discover the available services

*NOTICE For Node you have to set addresses, there isn't any default at the moment

Worker, Iframes and seperate bundles

You can use scalecube with multiple bundles even inside iframes and *Web Workers, scalecube will be able to find and invoke the services by the address and seedAddress (via Post Messages).

*NOTICE In order to use Web Workers you need to load scalecube before loading the Web Worker (scalecube extends Worker class)

Good

import from "@scalecube/browser";

new Worker(`assets/worker.js`, {
  type: "module"
});

Bad

new Worker(`assets/worker.js`, {
  type: "module"
});

Dependency Injection

You can pass a function instead of object as the reference, this function get createProxy and createServiceCall, which can help you invoke any service in the cluster. The function need to return object with all the service methods ([methodName]: function()).
In the example bellow, we are creating a new instance of a class, but you can do in anyway you want.

createMicroservice({
  seedAddress : MySeedAddress,
  services: [
    {
      definition: serviceB,
      reference: ({ createProxy, createServiceCall }) => {
        const greetingService = createProxy({serviceDefinition: greetingServiceDefinition });

        return new ServiceB(greetingService);
      }
    }    
  ]
})

For more examples go to examples or full documentation

Scalecube tools

Router,
Discovery,
Transport-browser,
Transport-nodejs,
Gateway,
Cluster-browser,
Cluster-nodejs.

Version

MAJOR version when you make incompatible API changes,

MINOR version when you add functionality in a backwards-compatible manner, and

PATCH version when you make backwards-compatible bug fixes.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].