{"id":25519664,"url":"https://github.com/aligent/serverless-aws-nodejs-service-template","last_synced_at":"2025-04-11T00:33:12.104Z","repository":{"id":37834434,"uuid":"288359706","full_name":"aligent/serverless-aws-nodejs-service-template","owner":"aligent","description":"AWS Template for creating microservices","archived":false,"fork":false,"pushed_at":"2025-03-25T00:33:31.000Z","size":6265,"stargazers_count":8,"open_issues_count":14,"forks_count":4,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-04-02T23:46:09.895Z","etag":null,"topics":["serverless"],"latest_commit_sha":null,"homepage":null,"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/aligent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-18T05:05:17.000Z","updated_at":"2025-03-24T06:02:13.000Z","dependencies_parsed_at":"2024-01-31T01:32:05.601Z","dependency_job_id":"a9245fcb-3fba-42f7-9c03-6213b753d675","html_url":"https://github.com/aligent/serverless-aws-nodejs-service-template","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aligent%2Fserverless-aws-nodejs-service-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aligent%2Fserverless-aws-nodejs-service-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aligent%2Fserverless-aws-nodejs-service-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aligent%2Fserverless-aws-nodejs-service-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aligent","download_url":"https://codeload.github.com/aligent/serverless-aws-nodejs-service-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322773,"owners_count":21084336,"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":["serverless"],"created_at":"2025-02-19T17:29:19.557Z","updated_at":"2025-04-11T00:33:12.096Z","avatar_url":"https://github.com/aligent.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aligent AWS microservices template using Typescript and Serverless Framework\n\nA template for developing a suite of AWS microservices using Typescript and [Serverless Framework](https://www.serverless.com/framework/docs).\n\nThe monorepo workspace is managed using [Nx.](https://nx.dev)\n\n## Development\n\n### Setup\n\n1. Update application name in `package.json`. It's recommend to have the name in the format of: `@\u003cbrand-name\u003e-int/integrations`. Eg: `@aligent-int/integrations`\n\n2. Update brand name in `nx.json`. The naming convention for this is: `\u003cbrand-name\u003e-int`. Just be mindful about the length of service name. Eg: `alg-int`\n\n3. Install dependencies: `yarn install`\n\n### Working with services\n\nServices are generated by our `@aligent/serverless-plugin`. It supports generating services based on our predefined template and some executors as described below.\n\n#### Service generator (for generating new service)\n\n- To generate a service, use the command:\n\n  ```bash\n  npx nx g service \u003cservice-name\u003e\n  # The command above is equivalent to 'npx nx g service \u003cservice-name\u003e general'\n  ```\n\n- To generate a `notification` service, use the command:\n  ```bash\n  npx nx g service \u003cservice-name\u003e notification\n  ```\n\n#### Service executors\n\nOur service executors are `lint`, `test`, `typecheck`, `build`, `deploy` and `remove`. Executor can be executed using the command in the format:\n\n`npx nx run \u003cservice-name\u003e:\u003cexecutor\u003e -- --\u003coptions\u003e` or `npx nx \u003cexecutor\u003e \u003cservice-name\u003e -- --\u003coptions\u003e`\n\n- To deploy a service to AWS:\n\n  `npx nx deploy \u003cservice-name\u003e -- -s \u003cstage-name\u003e --aws-profile \u003cprofile-name\u003e --verbose`\n\n- To remove a service from AWS:\n\n  `npx nx run \u003cservice-name\u003e:remove -- -s \u003cstage-name\u003e --aws-profile \u003cprofile-name\u003e --verbose`\n\n### Working with libraries\n\nLibraries are generated by `@nx/js` plugin. For more information, check out their [document](https://nx.dev/packages/js).\n\n#### Generate a shared library\n\n`npx nx g library \u003clibrary-name\u003e`\n\nShared library will need to have the `check-types` command added manually to ensure proper type checking. This is because the the `@nx/js` plugin does not add it by default.\n\nTODO: Check if this is required\n\n```json\n\"check-types\": {\n    \"executor\": \"nx:run-commands\",\n    \"options\": {\n        \"cwd\": \"{projectRoot}\",\n        \"color\": true,\n        \"command\": \"tsc --noEmit --pretty\"\n    },\n}\n```\n\n### Generate an API Client\n\n`npx nx g client \u003cclient-name\u003e`\n\nClients are generated by our `@aligent/openapi-plugin`. This plugin will generate typed API utilities to build an external API Client based on a local or remote OpenAPI Specification (3.0.0+) schema file (.json .yaml)\n\nFor more detailed documentation on using the plugin see the plugin README [here](./tools/openapi-plugin/README.md)\n\n### General Nx. commands\n\nBelow are some example of general Nx. commands. For more information, check out their [document](https://nx.dev/packages/nx/documents).\n\n- Remove a service or library:\n\n  `npx nx g rm \u003cproject-name\u003e`\n\n- To run executors (`lint`, `test`, `format`, etc..) for all the projects:\n\n  `npx nx run-many -t \u003clist-of-executors-separated-by-space-or-comma\u003e`\n\n- To run executors for only affected projects:\n\n  `npx nx affected -t \u003clist-of-executors-separated-by-space-or-comma\u003e`\n\n## Notes:\n\n- The `tsconfig.base.json` file extends [@aligent/ts-code-standard](https://bitbucket.org/aligent/ts-code-standards/src/main) package. Please note that there are settings which is not shown in that file but still applied. For more information on those settings, visit https://github.com/tsconfig/bases.\n\n- Following `@aligent/ts-code-standard`, we switched to the new [Eslint's FlatConfig](https://eslint.org/blog/2022/08/new-config-system-part-2/). If you're using [VSCode's Eslint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint), turn on the `eslint.useFlatConfig` setting.\n\n## Maintenance\n\n### Upgrading NPM packages\n\nThe NPM packages in `devDependencies` in this repository has a complicated relationship with each other. Therefore, upgrading them should be handled with care.\n\n- All the `@nx` packages must be pinned at the same version with `nx` package to avoid conflict.\n\n  ```json\n    \"@nx/devkit\": \"17.3.0\",\n    \"@nx/esbuild\": \"17.3.0\",\n    \"@nx/eslint\": \"17.3.0\",\n    \"@nx/eslint-plugin\": \"17.3.0\",\n    \"@nx/js\": \"17.3.0\",\n    \"@nx/plugin\": \"17.3.0\",\n    \"@nx/vite\": \"17.3.0\",\n    \"@nx/workspace\": \"17.3.0\",\n    \"nx\": \"17.3.0\"\n  ```\n\n- All the packages that are in the same scope should be at the same version. For example:\n\n  ```json\n    \"@typescript-eslint/eslint-plugin\": \"^6.13.2\",\n    \"@typescript-eslint/parser\": \"^6.13.2\",\n  ```\n\n- `@nx/esbuild` lists `esbuild` as peerDependency. Double check the required version of `esbuild` in `package.json` of this [package](https://www.npmjs.com/package/@nx/esbuild?activeTab=code) before upgrading.\n- `eslint` and `prettier` are a peerDependencies of the following packages. Double check the required versions in `package.json` of these packages before upgrading.\n  - [@aligent/ts-code-standard](https://bitbucket.org/aligent/ts-code-standards/src/main/package.json)\n  - [eslint-plugin-import](https://www.npmjs.com/package/eslint-plugin-import?activeTab=code)\n- `@nx/vite` lists `vite` and `vitest` as peerDependencies. Double check the required version of `vite` and `vitest` in `package.json` of this [package](https://www.npmjs.com/package/@nx/vite?activeTab=code) before upgrading.\n  - `vitest`, `@vitest/coverage-v8` and `@vitest/ui` should be at the same version.\n\n## Under development\n\n- [-] Deployment pipeline -\u003e nodeJS container + pnpm\n- [x] Typescript compilation to check types (`tsc --noEmit`)\n- [x] Root client configuration (e.g. service name prefix)\n- [-] Base vite configuration -\u003e this works for service generator.\n- [ ] Importing code from internal libraries\n- [ ] Bespoke library generator -\u003e use same base vite configuration if we do this.\n- [ ] Develop workspace [preset](https://nx.dev/extending-nx/recipes/create-preset)\n- [x] Pre-commit hooks\n- [x] Add error notification service\n- [ ] Add step function metric configuration\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faligent%2Fserverless-aws-nodejs-service-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faligent%2Fserverless-aws-nodejs-service-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faligent%2Fserverless-aws-nodejs-service-template/lists"}