{"id":13626586,"url":"https://github.com/lemoncloud-io/lemon-core","last_synced_at":"2025-04-29T10:30:45.708Z","repository":{"id":35055930,"uuid":"201387400","full_name":"lemoncloud-io/lemon-core","owner":"lemoncloud-io","description":"Shared library to build easily the micro-service with AWS Lambda + DynamoDB + ElasticSearch + SNS/SQS.","archived":false,"fork":false,"pushed_at":"2024-10-22T07:20:24.000Z","size":10272,"stargazers_count":12,"open_issues_count":4,"forks_count":3,"subscribers_count":9,"default_branch":"develop","last_synced_at":"2024-11-02T10:34:55.315Z","etag":null,"topics":["aws-lambda","aws-lambda-node","dynamodb","elasticsearch","lemoncloud","micro-service","micro-service-architecture","microservices-architecture","serverless","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lemoncloud-io.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-09T04:09:19.000Z","updated_at":"2024-10-22T07:19:11.000Z","dependencies_parsed_at":"2024-10-03T00:06:34.817Z","dependency_job_id":"b5d867ea-8023-4dd2-95c0-1d7ad4171724","html_url":"https://github.com/lemoncloud-io/lemon-core","commit_stats":{"total_commits":655,"total_committers":9,"mean_commits":72.77777777777777,"dds":0.2442748091603053,"last_synced_commit":"a8f99ac67c35132211c0fafd8956f3003558e186"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemoncloud-io%2Flemon-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemoncloud-io%2Flemon-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemoncloud-io%2Flemon-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemoncloud-io%2Flemon-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lemoncloud-io","download_url":"https://codeload.github.com/lemoncloud-io/lemon-core/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224160630,"owners_count":17266015,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-lambda","aws-lambda-node","dynamodb","elasticsearch","lemoncloud","micro-service","micro-service-architecture","microservices-architecture","serverless","typescript"],"created_at":"2024-08-01T21:02:24.380Z","updated_at":"2025-04-29T10:30:45.696Z","avatar_url":"https://github.com/lemoncloud-io.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"[![codecov](https://codecov.io/gh/lemoncloud-io/lemon-core/branch/master/graph/badge.svg)](https://codecov.io/gh/lemoncloud-io/lemon-core)\n[![npm version](https://badge.fury.io/js/lemon-core.svg)](https://badge.fury.io/js/lemon-core)\n[![GitHub version](https://badge.fury.io/gh/lemoncloud-io%2Flemon-core.svg)](https://badge.fury.io/gh/lemoncloud-io%2Flemon-core)\n\n\n# lemon-core\n\nLemon Core Bootloader for Serverless Micro-Service\n\n- Support `multiple` event sources with single lambda function as below figure.\n- Fully support `typescript` types (80%).\n- Support Data Synchronization to `Elasticsearch` from `DynomoDB` via `DynamoStream`.\n\n    ![](assets/2019-11-26-23-43-47.png)\n\n\n## Architecture\n\nBasic MicroService Architecutre with `API` + `SNS` + `SQS`.\n\n- `NextHandler`: basic controller method to handle user service\n- `NextDecoder`: mapper from `httpMethod + id + cmd` to `NextHandler`\n- `NextContext`: initial requester's context with `identity`.\n\n    ![](assets/lemon-core-ms-arch.png)\n\n\n### Protocol Service\n\n- support inter-communication between micro services\n- `execute()`: synchronized call via lambda execution by `API` Handler.\n- `notifiy()`: async call by `SNS` handler w/ lambda callback.\n- `enqueue()`: async call by `SQS` handler w/ lambda callback.\n- `broadcast()`: publish message via `SNS`, and handled by `Notification` handler.\n\n    ![](assets/lemon-protocol-flow.png)\n\n```ts\nimport $engine, { ProtocolParam, ProtocolService, CallbackParam } from 'lemon-core';\n// use the internal instance from $engine.\nconst service: ProtocolService = $engine.cores.protocol.service;\nconst protocol: ProtocolParam = service.fromURL(context, 'api://lemon-hello-api/hello/echo', param, body);\nconst callback: CallbackParam = { type: 'hooks', id: `${id}` };\n// queue protocol in 30 seconds delayed.\nconst queueId = await service.enqueue(protocol, callback, 30);\n```\n\n## Usage\n\n1. install `lemon-core` module (\u003e= 2.1.0).\n\n```sh\n$ npm install lemon-core --save\n```\n\nTODO - TBD in detail.\n\n\n\n## Contribution\n\nPlz, request PR. \n\nSee [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md)\n\n\n## LICENSE\n\n[MIT](LICENSE) - (C) 2019 LemonCloud Co Ltd. - All Rights Reserved.\n\n\n----------------\n# VERSION INFO #\n\n| Version   | Description\n|--         |--\n| 3.2.13    | improve `createSigV4Proxy()` to support the sig-v4 request to AWS.\n| 3.2.12    | improve `buildResponse()` to determin content-type of html.\n| 3.2.11    | updated `elastic6-service` to support `SearchProxy`.\n| 3.2.10    | updated `elastic6-service` to fix `400 ILLEGAL ARGUMENT` (script parsing).\n| 3.2.9     | improve `elastic6-service` w/ latest open-search.\n| 3.2.8     | updated `ttypescript^1.5.15`, and optimized.\n| 3.2.7     | cleanup log message in `AWSS3Service`, and optimized.\n| 3.2.6     | improve `listObjects()` in `AWSS3Service` w/ prefix.\n| 3.2.5     | improve `doReportError` in `lambda-web-handler`.\n| 3.2.4     | updated with `lemon-model@1.0.2`.\n| 3.2.3     | support `ES7.10`, and improve sync to elastic.\n| 3.2.1     | improve `getIdentityId()` w/ `env:LOCAL_ACCOUNT`.\n| 3.2.0     | upgrade all packages, and clear `audit fix`.\n| 3.1.2     | refactoring with `lemon-model@1.0.0` for shared types.\n| 3.1.1     | support `ManagerProxy`, `AbstractProxy` and `$ES6`. (`x-lemon-identity` as WebToken)\n| 3.1.0     | upgrade `typescript^4.6.2`, and optimized.\n| 3.0.2     | support `helpers` like `$T`.\n| 3.0.0     | improve search-client with `@elastic/elasticsearch@7.12` to support AWS `OpenSearch 1.1` (compartible with `ES6.2`).\n| 2.2.20    | improve an extra feature from `aws-s3-service` to 'lemon-images-api'\n| 2.2.19    | improve search filtering feature for `ES6 autocomplete search`.\n| 2.2.18    | support `$U.jwt(passcode).encode(...)` w/ `npm`.\n| 2.2.16    | hot-fix `utf8 encoding of json` in `AWS.S3`.\n| 2.2.15    | hot-fix `Cannot read property 'setIndex' of null` in `Dynamo`.\n| 2.2.14    | support `CacheService`, and support appending entry into list in `Dynamo`.\n| 2.2.13    | improve `LambdaWEBHandler` to support custom web-response including headers.\n| 2.2.12    | improve `AWSS3Service` to use pure JS image library because of AWS compatibility issue.\n| 2.2.11    | improve `AWSS3Service` by adding handy method and metadata+tag handling\n| 2.2.10    | improve `Access-Control-Allow-Origin` w/ `Access-Control-Allow-Credentials: true`.\n| 2.2.9     | support `content-type:application/x-www-form-urlencoded` form data.\n| 2.2.6     | improve `search`, and support `cookie` in NextContext.\n| 2.2.5     | support `Access-Control-Allow-Headers` for CORS.\n| 2.2.3     | support `x-lemon-language` header in identity.\n| 2.2.0     | support `AbstractManager` for the template of model managers.\n| 2.1.17    | support `filter()` in DynamoStream.\n| 2.1.16    | improve `lock()` w/ 404 error, and `.aggregations` in QueryResult.\n| 2.1.14    | support `hash` param for `MocksAPIService`.\n| 2.1.13    | support `HttpStorage`, `$U.crypto2`, and `/favicon.ico`.\n| 2.1.12    | support `userAgent` in NextContext.\n| 2.1.11    | improve `syncToElastic6`, and `DynamoScanService`.\n| 2.1.10    | support `loadProfile()`, and lookup-id style.\n| 2.1.8     | improve `express` of request-context.\n| 2.1.7     | improve `TypedStorageService` w/ `save()`.\n| 2.1.5     | support `GeneralAPIController` along w/ `UniqueFieldManager`.\n| 2.1.3     | support `asNextIdentityAccess()` for access identity.\n| 2.1.2     | support `ProxyStorageService` for shared common storage.\n| 2.1.1     | support `enqueue()` with delayed-seconds.\n| 2.1.0     | support `ProtocolService` for inter communication of micro-services.\n| 2.0.10    | support to display the current name/version by `GET /`.\n| 2.0.9     | improve `Elastic6Service` + `Elastic6QueryService`.\n| 2.0.8     | improve `APIService` w/ mocks data.\n| 2.0.7     | improve `StorageService` along w/ dummy-storage-service.\n| 2.0.6     | support `CoreWEBController`, and `lambda.cores.web.addController(...)`\n| 2.0.5     | support `APIService`, and fix `engine.initialize()`\n| 2.0.3     | support `StorageService` along with `DynamoStorageService`\n| 2.0.0     | improve `lemon-engine`, and support `typescript` fully.\n| 1.2.15    | improve `doReportError` with error message\n| 1.2.12    | support `doReportMetric()` for saving metric data.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemoncloud-io%2Flemon-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flemoncloud-io%2Flemon-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemoncloud-io%2Flemon-core/lists"}