Skip to content

awe-templates/nestjs-typeorm-mysql-starter-template

 
 

Repository files navigation

NestJS TypeORM MySQL Starter Template

NestJS TypeORM MySQL Starter Template

This is a simple starter template for NestJS projects. It includes only basic configs, TypeORM, MySQL and PNPM.

📦 Installation

Setup .env File

Copy .env.example file and rename as .env. Then you can specify your configs.

pnpm install

Running the app

# development
pnpm run start

# watch mode
pnpm run start:dev

# production mode
pnpm run start:prod

Test

# unit tests
pnpm run test

# e2e tests
pnpm run test:e2e

# test coverage
pnpm run test:cov

Example Commands

NestJS

Create a module

nest g mo app/modules/<module-name>

Create a controller

nest g co app/modules/<module-name>/<controller-name>

Create a service

nest g s app/modules/<module-name>/<service-name>

Create a pipe

nest g pi app/modules/<module-name>/<pipe-name>

Create a model

nest g cl app/shared/<model-name>

TypeORM

# create migration
npm run typeorm:direct migration:create src/database/migrations/Create<table-name>Table

# run migrations
npm run typeorm migration:run

# revert migrations
npm run typeorm migration:revert

# show status of migrations
npm run typeorm migration:show

# drop all migrations
npm run typeorm schema:drop

About

Simple NestJS starter template

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 90.1%
  • JavaScript 9.9%