Coder Social home page Coder Social logo

zetapush

The next generation backend-as-a-service

NPM version Build Status

ZetaPush JavaScript SDK

This project is a monorep containing all source of @zetapush/* ecosytem

Installation

npm 6+

npm init @zetapush myproject
cd myproject

npm 5.x

npx @zetapush/create myproject
cd myproject

Deployment

Push your code on ZetaPush platform

npm run deploy

Development

Run your code on your local platform

npm run start

Default project structure

.
└──
  ├── front
  │  ├── index.html
  │  └── index.js
  ├── worker
  │  └── index.ts (api implementation)
  └── package.json

How it works?

Server side

Your server api in a plain old class defining your interface.

Example:

export default class Api {
  hello() {
    return `Hello World from JavaScript ${Date.now()}`;
  }
}

This code expose an API called hello which returns a string "Hello World from JavaScript" concatened with server timestamp.

You can use injected platform services with to following.

Dependency injection use injection-js

import { Injectable } from '@zetapush/core';
import { Stack } from '@zetapush/platform-legacy';

@Injectable()
export default class Api {
  constructor(private stack: Stack) {}
  push(item) {
    return this.stack.push({ stack: 'list', data: item });
  }
}

To consume an API in your front-end application you have to create a mapped method.

Client side

Register your API mapping class

const api = client.createProxyTaskService();

Invoke your remote API method

const message = await api.hello();

ZetaPush's Projects

cometd icon cometd

The CometD project, a scalable comet (server push) implementation for web messaging.

diagnostic icon diagnostic

Provide online diagnostic tools to test your connection

go icon go

Go client for ZetaPush

zetapush-js icon zetapush-js

ZetaPush Client for JavaScript Ecosytem (NodeJS and Browsers)

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.