Git Product home page Git Product logo

island's Introduction

This is a branch for preparing release 1.0 - check the milestone

island v1.0

An opinionated, full-stacked Microservices framework for node, powered by TypeScript.

Build Status NPM version Dependency Status Coverage Status Test Coverage Code Climate Issue Count

import * as island from 'island';
import * as keeper from 'island-keeper';
import { EndpointController } from './controller/endpoint.controller';
import { EventController } from './controller/event.controller';

const serviceName = 'hawaii';

class HawaiiIslet extends island.Islet {
  main() {
    const islandKeeper = keeper.IslandKeeper.getInst();
    islandKeeper.init('consul', 'island');
    islandKeeper.setServiceName(serviceName);

    const amqpChannelPoolAdapter = new island.AmqpChannelPoolAdapter({url: 'amqp://rabbitmq:5672'});
    this.registerAdapter('amqpChannelPool', amqpChannelPoolAdapter);
    const rpcAdapter = new island.RPCAdapter({amqpChannelPoolAdapter, serviceName});
    rpcAdapter.registerController(EndpointController);
    this.registerAdapter('rpc', rpcAdapter);

    const eventAdapter = new island.EventAdapter({amqpChannelPoolAdapter, serviceName});
    eventAdapter.registerController(EventController);
    this.registerAdapter('event', eventAdapter);
  }
}

island.Islet.run(HawaiiIslet);

Table of Contents

Installation

$ npm install island --save

Features

  • Free from service discovery
  • Support various types of communication
    • RPC(strong link between islands)
    • Event(weak link between islands)
    • Push messaging(to user) via socket.io
  • Ensure that each island gets proper parameters
  • Track communications per each request
  • Chain contexts with UUID per each request

v1.0

Changes

  • Loggers is no longer a part of island -> island-loggers #14
  • Di is no longer a part of island -> island-di #16
  • @endpoint decorator now provides 4 more methods #28
    • @endpoint('GET /test') still works
    • @endpoint.get('/test') - You can omit the GET method
    • @endpoint.post('/test') - You can omit the POST method
    • @endpoint.put('/test') - You can omit the PUT method
    • @endpoint.del('/test') - You can omit the DEL method

Breaking Changes

Building

In order to build the island, ensure that you have Git and Node.js installed.

Clone a copy of the repo:

$ git clone https://github.com/spearhead-ea/island.git

Change to the island directory:

$ cd island

Install prerequisites and dev dependencies:

$ npm install -g gulp typescript
$ npm install

Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm install
$ RABBITMQ_HOST=localhost npm test

Environment Variables

Environment Notes
NODE_ENV When development, allows APIs which has options.developmentOnly
HOSTNAME TraceLog uses this as a name of node
ISLAND_RPC_EXEC_TIMEOUT_MS Timeout during execution (Defaults to 25000)
ISLAND_RPC_WAIT_TIMEOUT_MS Timeout during call (Defaults to 60000)
ISLAND_LOGGER_LEVEL Logger level of category island
ISLAND_TRACEMQ_HOST MQ(formatted by amqp URI) for TraceLog. If omitted it doesn't log
ISLAND_TRACEMQ_QUEUE A queue name to log TraceLog

Milestones

For details on our planned features and future direction please refer to our milestones

People

The original author of island is Wonshik Kim

The current lead maintainer is Kei Son

List of all contributors

License

MIT

island's People

Contributors

heycalmdown avatar wokim avatar tedlines avatar frogred8 avatar 0ams avatar crierr 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.