NestJS boilerplate 🎉
Home
  • English
  • Tiếng Việt
GitHub
Home
  • English
  • Tiếng Việt
GitHub
  • Setup & Development
  • Technologies
  • Architecture
  • API
  • Database
  • Security
  • Testing
  • Benchmarking
  • Deployment
  • Troubleshooting
  • FAQ
  • Convention

    • Naming cheatsheet
    • TypeScript Style Guide and Coding Conventions
    • Clean code Typescript
    • Branch conventions
    • Commit conventions
    • Linting & Formatting

Architecture

This document describes the architecture of the project.


  • .github/workflows
    • check-semantic-prs.yml
    • ci.yml
    • deploy-docs.yml
  • .husky
  • docs
    • .vuepress
  • src
    • api
    • background
    • common
      • dto
      • interfaces
      • types
    • config
    • constants
    • database
      • config (for database)
      • decorators (for database)
      • entities
      • migrations
      • seeds
      • data-source.ts
    • decorators
    • exceptions
    • filters
    • generated
    • guards
    • i18n
    • interceptors
    • libs
    • mail
    • shared
    • utils
    • app.module.ts
    • main.ts
  • test
  • .env
  • .gitignore
  • .prettierrc
  • commitlint.config.mjs
  • docker-compose.yml
  • docker-compose.local.yml
  • Dockerfile
  • eslint.config.mjs
  • jest.config.json
  • lint-staged.config.mjs
  • maildev.Dockefile
  • nest-cli.json
  • package.json
  • pnpm-lock.yaml
  • README.md
  • renovate.json
  • setup-jest.mjs
  • tsconfig.build.json
  • tsconfig.json

.github/workflows

Here you can create and store yml files for each github action.

check-semantic-prs.yml

Github action to check if the PR title is following the semantic commit message.

ci.yml

Github action to run the test and build the project.

deploy-docs.yml

Github action to deploy the documentation to the gh-pages branch.

.husky

Husky is a tool to prevent bad git commit, git push, and more. See the husky doc for more.

docs

Folder where we keep all our documentation files.

.vuepress

Folder where we keep all our vuepress configuration files. See the vuepress doc for more.

src

Where we keep all our source files.

api

background

common

Where we keep common typescript files, e.g. DTOs, interfaces, types.

dto

Where we keep all our DTOs.

interfaces

Where we keep all typescript interfaces.

types

Where we keep all typescript types.

config

Where we keep application configuration files.

constants

Where we keep all our constants.

database

Folder to store files which are connected only to database.

config (for database)

Folder to store database configuration files.

decorators (for database)

Folder to store database decorators.

entities

Folder to store application common entities

migrations

Folder to store application migrations which will be generated by typeorm.

seeds

Folder to store application seeds, it adds necessary data for the development.

data-source.ts

File to store the data source configuration for migrations.

decorators

This folder contains all global decorators.

exceptions

This folder contains all global exception classes.

filters

In this folder you can find app level filters.

generated

Typescript files generated by the code generator. E.g. i18n.generated.ts file generated by the nestjs-i18n package.

guards

You can store all guards here.

i18n

Internalization JSON files are storied here.

interceptors

Where we are keep interceptors.

libs

Where we keep all common modules. See NestJS modules documentation for more.

mail

Includes a mailer service, implement the logic to send emails, use nodemailer and handlebars for templating.

shared

Shared module with global singleton services.

utils

Where we keep all our utility functions.

app.module.ts

The root application module.

main.ts

test

Folder where we keep all our e2e test files.

.env

Environment variables which will load before app start and will be stored in process.env, (*) is a env name (local, development, test, staging, production)

.gitignore

Here you can store the files and folders that you want to ignore in the git repository.

.prettierrc

Prettier configuration file, see the prettier doc for more.

commitlint.config.mjs

Commitlint configuration file, see the commitlint doc for more.

docker-compose.yml

Docker compose configuration file for development, see the docker docs for more.

docker-compose.local.yml

Docker compose configuration file for local development.

Dockerfile

The basic Dockerfile configuration to build the app, see the docker docs for more.

eslint.config.mjs

Eslint configuration file, see the eslint doc & typescript-eslint for more.

jest.config.json

Jest configuration file, see the jest doc for more.

lint-staged.config.mjs

The configuration of the lint-staged, see the lint-staged doc for more.

maildev.Dockefile

Dockerfile for the maildev service. Used for development & testing.

nest-cli.json

Nestjs cli configuration file, see the nestjs doc for more.

package.json

Here you can store the configuration of the project.

pnpm-lock.yaml

pnpm lock file generated by pnpm.

README.md

Here you can store the description of the project.

renovate.json

Renovate configuration file, see the renovate doc for more.

setup-jest.mjs

Setup file for jest.

tsconfig.build.json

Here you can store the typescript configuration of the project for the build.

tsconfig.json

Here you can store the typescript configuration of the project.

Edit this page
Last Updated:
Contributors: Lâm Ngọc Khương
Prev
Technologies
Next
API