Giter VIP home page Giter VIP logo

scalra's Introduction

(master) Build Status - master Build Status - dev (dev)

Scalra

node framework to prototype and scale API servers rapidly.

require('scalra')('curr');

SR.API.add('HelloWorld', {
	name: 'string'
}, function (args, onDone) {
	LOG.warn('HelloWorld called with: ' + args);	
	onDone(null, {hello: args.name});
});

var l_frontier = new SR.Frontier(37070);
l_frontier.init();

Then called at server:

SR.API.HelloWorld({name: 'John'}, function (err, result) {
	LOG.debug('positive test result: ');
	if (err) {
		return LOG.error(err);
	}
	LOG.warn(result);
});

Or at clients:

<html><head>
<script type="text/javascript" src="/lib/scalra.js"></script>
<script>

var onConnect = function () {

	SR.API.HelloWorld({name: 'world'}, function (err, result) {
		if (err) {
			return alert(err);
		}
		document.write('Hello: ' + result.hello);
		console.log(result);
	}); 
}

</script>
</head></html>

Or request from URL:

http://127.0.0.1:37070/event/HelloWorld?name=world

Installation

$ npm install scalra

see Installation Guide for full instructions to setup a Scalra system on empty systems.

Features

  • Write one API logic for any connection types (HTTP/HTTPS/websocket/socket)
  • Logic is called in the same style at both client and server
  • Shared sessions between HTTP and WebSocket requests
  • Publish / subscribe (pub/sub) as messaging layer
  • Auto-reload of modified logic scripts
  • Works out-of-box with MongoDB and Express
  • In-memory DataStore that access and update DB data simply as variables

see Release Notes on various changes / new features in each releases.

Docs & Community

Quick Start

Simply copy the demo project under /demo as your own project

$ npm install scalra
$ cp -R node_modules/scalra/demo /tmp/foo && cd /tmp/foo

Install dependencies:

$ npm install scalra

Start the server:

$ npm start

Verify server is up with:

http://127.0.0.1:37070/event/HelloWorld?name=world

Philosophy

Scalra is designed to allow server developers to focus on logic development instead of networking or server management issues. Once developed using the Scalra framework, the server's reliability, security, and scalability is automatically covered without having to worry about re-writing code when the service is under heavy workload.

Additional functionalities can be added with pluggable Scalra modules.

People

Scalra is created by Imonology Inc. [github]

License

AGPL-3.0

scalra's People

Contributors

sunnyworm avatar bluet avatar x3388638 avatar kenornotes avatar dependabot[bot] avatar snyk-bot avatar d-kakhiani avatar michael-wang avatar zxp86021 avatar syhu avatar kevin627627 avatar gmliao avatar oliwave avatar

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.