Skip to content

bcgov/nr-nodejs-sample

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Donate us Support us Follow us on Twitter

Description

Nest framework TypeScript starter repository.

Project setup

$ npm install

Compile and run the project

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Run tests

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Deployment

When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the deployment documentation for more information.

If you are looking for a cloud-based platform to deploy your NestJS application, check out Mau, our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps:

$ npm install -g mau
$ mau deploy

With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.

Resources

Check out a few resources that may come in handy when working with NestJS:

  • Visit the NestJS Documentation to learn more about the framework.
  • For questions and support, please visit our Discord channel.
  • To dive deeper and get more hands-on experience, check out our official video courses.
  • Deploy your application to AWS with the help of NestJS Mau in just a few clicks.
  • Visualize your application graph and interact with the NestJS application in real-time using NestJS Devtools.
  • Need help with your project (part-time to full-time)? Check out our official enterprise support.
  • To stay in the loop and get updates, follow us on X and LinkedIn.
  • Looking for a job, or have a job to offer? Check out our official Jobs board.

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

Working With the Polaris Pipeline

This repository uses the Polaris Pipeline to build and deploy.

Management on Packages

The Polaris Pipeline also generates jobs to manage unnecessary packages during developments period:

  • Delete PR package when PR merged
  • Only keep top {number} non-release packages

Refer to nr-polaris-docs for more information about how to use the Polaris Pipeline.

Resources

NRM Architecture Confluence: GitHub Repository Best Practices

Setting Up Your Build Environment

Use the env.sh script to initialize your build or development runtime environment.

Refer to nr-polaris-docs for more information on how env.sh sets up the build environment.

Usage

source env.sh [mode] [path] [--skip-vault]

Parameters:

  • mode: build (default) or local
    • build mode: Setup for builds
    • local mode: Setup for local development runtime
  • path: Directory containing catalog-info.yaml (default: current directory)
  • --skip-vault: Skip Vault authentication (for offline/CI scenarios)

Examples

# Load build environment
source env.sh

# Load local development runtime environment
source env.sh local

# Skip Vault authentication
source env.sh build --skip-vault

Setting the Artifact Version

The pom.xml uses a VERSION environment variable and the ${revision} property for the project version (see https://maven.apache.org/guides/mini/guide-maven-ci-friendly.html).

A profile named version-from-env activates automatically when the VERSION environment variable is present and sets ${revision} to its value.

When the environment variable is absent, the POM uses the hardcoded value in the properties section.

The Flatten Maven Plugin is used for install / deploy as described in the official Maven CI Friendly guide.

Context Version resolved
Local build — no env var, no env.sh Maven builds with version UNSET (clearly invalid, won't be mistaken for a real release)
Local build — after source env.sh .env-build.sh reads the base version from VERSION file (unless VERSION is already set in the shell)
CI/CD — branch or PR "Set VERSION" step computes <base>-<pr-or-branch>-SNAPSHOT and writes it to $GITHUB_ENV; env.sh sees it already set and skips the fallback
CI/CD — tag v1.2.3 "Set VERSION" step strips the v prefix and writes VERSION=1.2.3 to $GITHUB_ENV

To build with a specific version locally:

export VERSION=1.2.0-SNAPSHOT
source env.sh build --skip-vault
./mvnw clean package

Or as a one-liner (no shell modification):

VERSION=1.2.0-SNAPSHOT ./mvnw clean package

To bump the base development version, update only the VERSION file — .env-build.sh and the pipeline both derive from it automatically.

Local Development Runtime Environment

Use the env.sh script to initialize with the local mode to setup the environment to run your application locally on your development machine.

source env.sh local ...

Refer to nr-polaris-docs for more information on how env.sh sets up the local development runtime environment and how to customize the environment.

About

No description, website, or topics provided.

Resources

License

Unknown, Apache-2.0 licenses found

Licenses found

Unknown
LICENSE
Apache-2.0
LICENSE.md

Stars

Watchers

Forks

Packages

 
 
 

Contributors