Git Product home page Git Product logo

nest-template-prisma-ddd's Introduction

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 Support us

Description

I created this api to server as a template nest js with DDD.

Tools:

  • Nest
  • Prisma
  • Swagger

Installation

$ yarn install

Running prisma migration

Add envs in .env file

# Database
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_USER=postgres
DATABASE_PASS=root
DATABASE_NAME=nest_template_prisma
DATABASE_ROOT_PASSWORD=root
DATABASE_URL="postgresql://${DATABASE_USER}:${DATABASE_PASS}@${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}"
$ npx prisma dev

Running the app

Add envs in .env file

#APP
APP_NAME=nest-template-prisma-ddd
APP_PORT=3333
APP_VERSION=1.0.0

#JWT
JWT_SECRECT=DO-NOT-USE-THIS-VALUE
JWT_REFRESH_TOKEN_SECRECT=DO-NOT-USE-THIS-VALUE
# secunds
JWT_EXPIREIN=60
# development
$ yarn run start

# watch mode
$ yarn run start:dev

# production mode
$ yarn run start:prod

Test

Add envs in .env.test file

# Database
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_USER=postgres
DATABASE_PASS=root
DATABASE_NAME=test_nest_template_prisma
# unit tests
$ yarn run test

# e2e tests
$ yarn run test:e2e

# test coverage
$ yarn run test:cov

Build

# product build
$ yarn build

Docker

Add envs in .env file

#Docker
DOCKER_ENV=local
# compose
$ docker-compose up

# build dockerfile
$ docker build -t nest_template_api -f .docker/Dockerfile.{DOCKER_ENV} .

Swagger

Acesse o endereço: http://localhost:{PORT}/api/docs.

Structure


├─ 📁 prisma
├─ 📁 src
│  ├── 📁 configs
│  ├── 📁 core
│  │   ├─ 📁 domain
│  │   └─ 📁 logic
│  ├── 📁 domain
│  │   ├─ 📁 entities
│  │   ├─ 📁 services
│  │   ├─ 📁 use-cases
│  │   └─ 📁 values-objects
│  └── 📁 infra
│       ├─ 📁 database
│       │  ├─ 📁 prisma
│       │  └─ 📁 repositories
│       ├─ 📁 http
│       │  ├─ 📁 auth
│       │  ├─ 📁 controllers
│       │  ├─ 📁 services
│       │  └─ 📁 view-models
│       └─ 📁 logger
└─ 📁 teste

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.

nest-template-prisma-ddd's People

Contributors

dev-raul avatar raulgok avatar

Stargazers

Douglas Santiago Rodrigues avatar Michael Chierici avatar Artur avatar [Manolo] Manoel Carvalho avatar Lucas.dev avatar Igor avatar

Watchers

 avatar

Forkers

theneocarvalho

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.