Web Analytics

nx-serverless

⭐ 146 stars English by sudokar

nx-serverless-monorepo

serverless esbuild npm peer dependency version (scoped) code style: prettier GitHub license Percentage of issues still open PRs Welcome Maintained

TypeScript GitHub Actions

A monrepo style, modern boilerplate or template project for Serverless framework using Nx monorepo toolkit 🛠 and aws-nodejs-typescript serverless template

Table of contents

Whats Included

Template Layout

.
├── stacks/    # stack for each serverless configuration/template and its associated files
├── libs/      # shared libraries
├── tools/
├── README.md
├── jest.config.js
├── jest.preset.js
├── nx.json
├── package.json
├── serverless.base.ts  # base configuration for serverless
├── tsconfig.base.json
├── workspace.json
├── .editorconfig
├── .eslintrc.json
├── .gitignore
├── .husky              # git hooks
├── .nvmrc
├── .prettierignore
├── .prettierrc

Prerequisites

> :warning: Version: lts/iron (v20). If you're using nvm, run nvm use to ensure you're using the same Node version in local and in your lambda's runtime.

> On your preferred code editor, Install plugins for the above list of tools

Usage

Depending on your preferred package manager, follow the instructions below to build and deploy serverless stack(s).

``shell yarn install `
  • Generate a new stack
`shell nx g serverless `

> Run with -d or --dry-run flag for dry run

`shell nx g @nx/node:lib --skipBabelrc --tags lib `

> Run with -d or --dry-run flag for dry run

`shell nx run :build --stage= `

  • To package stack affected by a change
`shell nx affected:build --stage= `
  • To package all stacks
`shell nx run-many --target=build --stage= `

  • Deploy stack to cloud
  • To deploy a single stack
`shell nx run :deploy --stage= `
  • To deploy the stack affected by a change
`shell nx affected:deploy --stage= `

  • To deploy all stacks
`shell nx run-many --target=deploy --all --stage= `

  • Remove stack from cloud
  • To remove a single stack
`shell nx run :remove --stage= `
  • To remove stack affected by a change
`shell nx affected:remove --stage= `

  • To remove all stacks
`shell nx run-many --target=remove --all --stage= `

  • Run tests
  • To run tests in a single stack
`shell nx run :test --stage= `
  • To run tests affected by a change
`shell nx affected:test --stage= `

  • To run tests in all stacks
`shell nx run-many --target=test --all --stage= `

`shell nx run :serve --stage= `

  • Understand your workspace
` nx dep-graph ``

Further help

Nx Cloud

##### Computation Memoization in the Cloud

​ Nx Cloud pairs with Nx in order to enable you to build and test code more rapidly, by up to 10 times.

​ Visit Nx Cloud to learn more and enable it

Contribution

Found an issue? feel free to raise an issue with information to reproduce.

Pull requests are welcome to improve.

Support

Like the template?

Click to Buy Me A Coffee

Or, Add a star :star: to the repository

Maintainer

This template is authored and maintained by sudokar

License

MIT

--- Tranlated By Open Ai Tx | Last indexed: 2026-05-27 ---