Code Monkey home page Code Monkey logo

lemon-core's Introduction

codecov npm version GitHub version

lemon-core

Lemon Core Bootloader for Serverless Micro-Service

  • Support multiple event sources with single lambda function as below figure.

  • Fully support typescript types (80%).

  • Support Data Synchronization to Elasticsearch from DynomoDB via DynamoStream.

Architecture

Basic MicroService Architecutre with API + SNS + SQS.

  • NextHandler: basic controller method to handle user service

  • NextDecoder: mapper from httpMethod + id + cmd to NextHandler

  • NextContext: initial requester's context with identity.

Protocol Service

  • support inter-communication between micro services

  • execute(): synchronized call via lambda execution by API Handler.

  • notifiy(): async call by SNS handler w/ lambda callback.

  • enqueue(): async call by SQS handler w/ lambda callback.

  • broadcast(): publish message via SNS, and handled by Notification handler.

import $engine, { ProtocolParam, ProtocolService, CallbackParam } from 'lemon-core';
// use the internal instance from $engine.
const service: ProtocolService = $engine.cores.protocol.service;
const protocol: ProtocolParam = service.fromURL(context, 'api://lemon-hello-api/hello/echo', param, body);
const callback: CallbackParam = { type: 'hooks', id: `${id}` };
// queue protocol in 30 seconds delayed.
const queueId = await service.enqueue(protocol, callback, 30);

Usage

  1. install lemon-core module (>= 2.1.0).
$ npm install lemon-core --save

TODO - TBD in detail.

Contribution

Plz, request PR.

See CODE_OF_CONDUCT

LICENSE

MIT - (C) 2019 LemonCloud Co Ltd. - All Rights Reserved.


VERSION INFO

Version Description
3.2.7 cleanup log message in AWSS3Service, and optimized.
3.2.6 improve listObjects() in AWSS3Service w/ prefix.
3.2.5 improve doReportError in lambda-web-handler.
3.2.4 updated with [email protected].
3.2.3 support ES7.10, and improve sync to elastic.
3.2.1 improve getIdentityId() w/ env:LOCAL_ACCOUNT.
3.2.0 upgrade all packages, and clear audit fix.
3.1.2 refactoring with [email protected] for shared types.
3.1.1 support ManagerProxy, AbstractProxy and $ES6. (x-lemon-identity as WebToken)
3.1.0 upgrade typescript^4.6.2, and optimized.
3.0.2 support helpers like $T.
3.0.0 improve search-client with @elastic/[email protected] to support AWS OpenSearch 1.1 (compartible with ES6.2).
2.2.20 improve an extra feature from aws-s3-service to 'lemon-images-api'
2.2.19 improve search filtering feature for ES6 autocomplete search.
2.2.18 support $U.jwt(passcode).encode(...) w/ npm.
2.2.16 hot-fix utf8 encoding of json in AWS.S3.
2.2.15 hot-fix Cannot read property 'setIndex' of null in Dynamo.
2.2.14 support CacheService, and support appending entry into list in Dynamo.
2.2.13 improve LambdaWEBHandler to support custom web-response including headers.
2.2.12 improve AWSS3Service to use pure JS image library because of AWS compatibility issue.
2.2.11 improve AWSS3Service by adding handy method and metadata+tag handling
2.2.10 improve Access-Control-Allow-Origin w/ Access-Control-Allow-Credentials: true.
2.2.9 support content-type:application/x-www-form-urlencoded form data.
2.2.6 improve search, and support cookie in NextContext.
2.2.5 support Access-Control-Allow-Headers for CORS.
2.2.3 support x-lemon-language header in identity.
2.2.0 support AbstractManager for the template of model managers.
2.1.17 support filter() in DynamoStream.
2.1.16 improve lock() w/ 404 error, and .aggregations in QueryResult.
2.1.14 support hash param for MocksAPIService.
2.1.13 support HttpStorage, $U.crypto2, and /favicon.ico.
2.1.12 support userAgent in NextContext.
2.1.11 improve syncToElastic6, and DynamoScanService.
2.1.10 support loadProfile(), and lookup-id style.
2.1.8 improve express of request-context.
2.1.7 improve TypedStorageService w/ save().
2.1.5 support GeneralAPIController along w/ UniqueFieldManager.
2.1.3 support asNextIdentityAccess() for access identity.
2.1.2 support ProxyStorageService for shared common storage.
2.1.1 support enqueue() with delayed-seconds.
2.1.0 support ProtocolService for inter communication of micro-services.
2.0.10 support to display the current name/version by GET /.
2.0.9 improve Elastic6Service + Elastic6QueryService.
2.0.8 improve APIService w/ mocks data.
2.0.7 improve StorageService along w/ dummy-storage-service.
2.0.6 support CoreWEBController, and lambda.cores.web.addController(...)
2.0.5 support APIService, and fix engine.initialize()
2.0.3 support StorageService along with DynamoStorageService
2.0.0 improve lemon-engine, and support typescript fully.
1.2.15 improve doReportError with error message
1.2.12 support doReportMetric() for saving metric data.

lemon-core's People

Contributors

dependabot[bot] avatar juno-lemoncloud avatar lemonalbert avatar louis-lemon avatar mindyd08 avatar steve-lemon avatar tim-lemon avatar tyler9410 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lemon-core's Issues

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.