Skip to content

Nestjs monorepo project template with prisma database access

Notifications You must be signed in to change notification settings

ivashog/nest-prisma-monorepo-template

Repository files navigation

App-name ♻

Description

This repository build as monorepo and consist of ___ project:

  1. ...
  2. ...

Read more about project structure here.

Building with:

Node.js logo TypeScript logo NestJS logo PostgreSQL logo Prisma logo

Try it out

Installation

First of all, make sure you have installed the following software on your environment:

$ git clone [email protected]:SP-OKO/smart_citi/iot-backend.git
$ cd nest-prisma-monorepo-template
$ npm install

Configuration

Before the first running app configure your project environment variables:

Running the app

# Development mode
$ npm run start:dev

# Production mode
$ npm run build
$ npm run start:prod

more scripts view in package.json file.

Db migrations

Tests

WIP...

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

APIs docs

Database schema

Project structure tree

    ├─ apps                     - main project folder with monorepo apps (@see https://docs.nestjs.com/cli/monorepo#monorepo-mode)
    │  ├─ main-api              - main-api files in standard Nest api structure
    |  |  └─ ...                
    │  └─ service-x             - service-x files in standard Nest api structure
    |      └─ ...               
    ├─ dist                     - folder with compiled *.js files (has same structure with /apps, /libs)
    |   └─ ...                  
    ├─ docs                     - api documents and assets
    ├─ database                 - database management files
    │  ├─ _pgmigrations         - db migrations files
    │  ├─ _seeds                - db seeds files (custom implementations with prisma runner)
    |  └─ sql                   - sql files and scripts
    |  schema.prisma            - prisma schema file (https://www.prisma.io/docs/concepts/components/prisma-schema/)
    ├─ environment              - app environment files (with same folder structure as apps/)
    │  ├─ main-api              - folder with main-api env files
    |  |  .env                  - default main-api env file
    |  └─ service-x             - folder with service-x env files
    |     .env                  - default service-x env file
    |  .env                     - default project env file (with db config and other used in all apps)
    ├─ libs                     - own libs sharing between monorepo apps
    │  ├─ common                - lib with common modules? configs and general nestjs entities files
    |  └─ prisma                - custom prisma service wrapper
    └─ node_modules             - nodejs third-party libs and dependencies for current project
       └─ ...                   
    .eslintrc.js                - eslint config
    .gitignore                  - Git untracked files list
    .prettierrc                 - prettier configuration file
    .prettierignore             - prettier ignored files list
    nest-cli.json               - nest-cli configuration file
    ormconfig.example.js        - example typeorm configuration file, used for working with migrations CLI
    package.json                - npm manifest file
    package-lock.json           - autogenerated file using by npm
    README.md                   - project readme file
    tsconfig.build.json         - ts compiler build configuration
    tsconfig.json               - typescript compiler configuration

Support

Find bug? - Report it:

About

Nestjs monorepo project template with prisma database access

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published