Skip to content
@nestjs-mod

NestJS-mod

A collection of utilities for unifying NestJS applications and modules.

NestJS-mod Logo

A collection of utilities for unifying NestJS applications and modules.

NPM Version Package License NPM Downloads Release to NPM Telegram Group Discord

Description

NestJS is a great framework and you can do great things with it, but often when developing a large number of applications within the same organization, we end up with different application architectures, file structures, and a lot of duplicate code.

The NestJS-mod collection of utilities are designed to unify applications and modules, and also introduce new logical options for dividing responsibilities between modules (Core, Feature, Integration, System, Infrastructure).

Since all parts of the application are unified, you can create a report on the entire project infrastructure.

Getting started

Create new application

Commands for create empty NestJS-mod application

# Create empty nx project
npx --yes create-nx-workspace@19.5.3 --name=project-name --preset=apps --interactive=false --ci=skip

# Go to created project
cd project-name

# Install all need main dev-dependencies
npm install --save-dev @nestjs-mod/schematics@latest

# Create NestJS-mod application
./node_modules/.bin/nx g @nestjs-mod/schematics:application --directory=apps/app-name --name=app-name --projectNameAndRootFormat=as-provided --strict=true

Start created application

# Prepare all files
npm run manual:prepare

# Start application in dev mode
npm run serve:dev:app-name

# Build and start application in prod mode

## Build
npm run build:prod:app-name

## Start
npm run start:prod:app-name

Create new library

Commands for create empty NestJS-mod library

# Create NestJS-mod library
./node_modules/.bin/nx g @nestjs-mod/schematics:library feature-name --buildable --publishable --directory=libs/feature-name --simpleName=true --projectNameAndRootFormat=as-provided --strict=true

Add created library to apps/app-name/src/main.ts

// Example without options
bootstrapNestApplication({
  ...
  modules: {
    feature: [FeatureName.forRoot()],
  }
});

// Example with options
bootstrapNestApplication({
  ...
  modules: {
    feature: [FeatureName.forRoot({
      configuration: { optionsName: 'options name' },
    })],
  }
});


// By default, in the example, the application looks for env by the key `APP_NAME_ENV_NAME`, but you can override it, for example:
bootstrapNestApplication({
  ...
  modules: {
    feature: [FeatureName.forRoot({
      environments: { envName: 'env name' },
    })],
  }
});

Create an infrastructure report

You can generate a report for all modules and their configurations.

# Generate markdown report
npm run docs:infrastructure

After which the file INFRASTRUCTURE.MD appear in the application folder apps/app-name.

Links

Questions

For questions and support please use the official Telegram group or Discord. The issue list of this repo is exclusively for bug reports and feature requests.

Stay in touch

License

MIT

Pinned Loading

  1. nestjs-mod nestjs-mod Public

    A collection of utilities for unifying NestJS applications and modules

    TypeScript 6 1

  2. nestjs-mod-contrib nestjs-mod-contrib Public

    Contrib repository for the NestJS-mod

    TypeScript 5 2

  3. nestjs-mod-example nestjs-mod-example Public

    Example application built with @nestjs-mod/schematics

    TypeScript

  4. typescript-starter typescript-starter Public

    About NestJS-mod TypeScript starter ☕

    TypeScript

Repositories

Showing 8 of 8 repositories
  • nestjs-mod-fullstack Public

    Boilerplate for creating a fullstack application on NestJS and Angular

    nestjs-mod/nestjs-mod-fullstack’s past year of commit activity
    TypeScript 1 0 1 0 Updated Nov 7, 2024
  • nestjs-mod Public

    A collection of utilities for unifying NestJS applications and modules

    nestjs-mod/nestjs-mod’s past year of commit activity
    TypeScript 6 MIT 1 0 0 Updated Nov 3, 2024
  • nestjs-mod-contrib Public

    Contrib repository for the NestJS-mod

    nestjs-mod/nestjs-mod-contrib’s past year of commit activity
    TypeScript 5 MIT 2 0 0 Updated Nov 3, 2024
  • nestjs-mod-example Public

    Example application built with @nestjs-mod/schematics

    nestjs-mod/nestjs-mod-example’s past year of commit activity
    TypeScript 0 0 0 0 Updated Sep 19, 2024
  • nestjs-mod.com Public

    The official website https://nestjs-mod.com 🏆

    nestjs-mod/nestjs-mod.com’s past year of commit activity
    HTML 1 MIT 0 0 0 Updated Aug 15, 2024
  • .github Public
    nestjs-mod/.github’s past year of commit activity
    0 0 0 0 Updated Aug 15, 2024
  • nestjs-mod-media Public

    Repository with tests and resources for publications in the media.

    nestjs-mod/nestjs-mod-media’s past year of commit activity
    HTML 0 0 0 0 Updated Aug 8, 2024
  • typescript-starter Public

    About NestJS-mod TypeScript starter ☕

    nestjs-mod/typescript-starter’s past year of commit activity
    TypeScript 0 0 0 0 Updated May 4, 2024

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…