Coder Social home page Coder Social logo

nestjs-template's Introduction

โœจ NestJS project template

This is a NestJS template for initiate projects What is included?

  • TypeScript
  • Husky
  • Eslint
  • Prettier
  • Jest
  • PrismaJS
  • Class Transformer
  • Class Validator
  • Swagger ( User Branch )
  • Passport ( User Branch )
  • Bcrypt ( User Branch )

๐Ÿงฟ How to use

First you will need a docker postgresql database, for make it easer use docker-compose to run the docker-compose.yml file that will up a docker container with the already configured db

The default configurations is:

  database:
    image: postgres
    environment:
      POSTGRES_PASSWORD: 'docker'
      POSTGRES_USERNAME: 'postgres'
      POSTGRES_DB: 'nest-template'
    ports:
      - '5432:5432'

On the project root you can run:

docker-compose up -d

With the container up you can run the prisma command to migrate your database:

yarn prisma migrate dev

If everything is right you should have your project ready and to run it on development enviroment use:

yarn dev

For production first you should compile it with:

yarn build

Then to run the production enviroment use:

yarn start

๐Ÿ“• Customizing

If you whant to change the db name you should alter the postgresql url on .env and apply the same changes to the docker-compose.yml

# .env file
# Change the database name to dogDB

DATABASE_URL="postgresql://postgres:docker@localhost:5432/dogDB?schema=public"
# docker-compose.yml file
 environment:
      POSTGRES_PASSWORD: 'docker'
      POSTGRES_USERNAME: 'postgres'
      POSTGRES_DB: 'dogDB'
    ports:
...

๐Ÿ•น Other Setups

This template has others configurations that use the main branch as base, to access it just go for the branch that implements what you need and use as template when creating your repository or clone it.

  • User with clean architecture: feat/user
  • User with nestj without clean-architecture: feat/user-simple

๐Ÿ“‹ TODOs

  • Add mailer implementations to user branch

nestjs-template's People

Contributors

iryoda avatar dependabot[bot] avatar

Watchers

 avatar

Forkers

bitshift-org

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.