Code Monkey home page Code Monkey logo

prime-nestjs's Introduction

NestJS Boilerplate

All Contributors License: MIT GitHub issues Known Vulnerabilities GitHub stars

prime-nestjs

πŸ“– Description

Open Source Love Maintenance GitHub last commit GitHub repo size GitHub code size in bytes GitHub top language GitHub language count GitHub contributors GitHub commit activity the past week, 4 weeks, year GitHub commit activity the past week, 4 weeks, year GitHub commit activity the past week, 4 weeks, year GitHub package.json version

Introducing the NestJS boilerplate - a great way to get started on your next Node.js project! It's built using the latest version of NestJS, which is a powerful and flexible framework for creating efficient and scalable server-side applications. The boilerplate includes TypeScript, PostgreSQL, and JWT authentication right out of the box, so you don't have to worry about setting those up yourself.

Other awesome features include configuration support with Dotenv, RBAC and CBAC for authorization, TypeORM for interacting with databases, Swagger for API documentation, and Docker Compose for container orchestration. Plus, the boilerplate also comes with pre-configured linting tools and secure HTTP headers with Helmet.

Getting started is easy - just clone the repository, install the dependencies, and you're ready to start building your next great idea!

πŸš€ Features

  • πŸ“± NestJS β€” latest version
  • πŸŽ‰ TypeScript - Type checking
  • βš™οΈ Dotenv - Supports environment variables
  • πŸ— Authentication - JWT, RSA256
  • 🏬 Authorization - RBAC, CBAC
  • πŸͺ TypeORM - Database ORM
  • πŸͺ PostgreSQL - Open-Source Relational Database
  • 🧠 Configuration - Single config for all
  • πŸ“ƒ Swagger - API Documentation
  • 🐳 Docker Compose - Container Orchestration
  • πŸ” Helmet - secure HTTP headers
  • 😴 Insomnia - Insomnia config for endpoints
  • πŸ“ ESLint β€” Pluggable JavaScript linter
  • πŸ’– Prettier - Opinionated Code Formatter
  • ✨ Commitlint - Lint your conventional commits
  • πŸ•΅οΈβ€β™‚οΈ Code Scanning - Code scanning with CodeQL

Quick Setup (Production)

bash ./setup.sh

Installation (Development)

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Endpoints

  1. Install the insomnia app
  2. Import the endpoints.json file
  3. Enjoy

Generate SSL certificates

  1. Generate an RSA private key, of size 2048, and output it to a file named key.pem:
openssl genrsa -out private_key.pem 2048
# It needs be copied&pasted from terminal manually
awk 'NF {sub(/\r/, ""); printf"%s\\n",$0;}' private_key.pem
  1. Extract the public key from the key pair, which can be used in a certificate:
openssl rsa -in private_key.pem -outform PEM -pubout -out public_key.pem
# It needs be copied&pasted from terminal manually
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' public_key.pem

πŸ“ License

This project is licensed under the MIT License - see the LICENSE.md file for more information.



Joey Goksu

πŸ“–

Made with β™₯ by Joseph GΓΆksu

Star History

Star History Chart

prime-nestjs's People

Contributors

dependabot[bot] avatar josephgoksu avatar lollobene avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prime-nestjs's Issues

[BUG]

Describe the bug
Docker-Compose not installed when install docker compose

To Reproduce
Steps to reproduce the behaviour:

  1. run bash ./setup.sh

Environment (please complete the following information):

  • OS: Ubuntu 22.04
  • Docker version 20.10.22
  • Docker Compose version v2.14.1

[REQUEST] OpenTelemetry Integration

Is your feature request related to a problem? Please describe.
I want to Monitor the Application Performance. It will allow us to improve the codebase using traces and metrics.

Describe the solution you'd like
I would like to implement OpenTelemetry into the project.

Describe alternatives you've considered
As an alternative, we can use Apache-2.0 licenced APM tool. We don't have an alternative yet.

Additional context
https://opentelemetry.io/docs/instrumentation/js/getting-started/nodejs/

Cannot read properties of undefined (reading 'hashSync') [BUG]

Describe the bug
The bug happens when trying to create a new user through the /auth/register/ endpoint.

The error is in /src/auth/auth.service.ts:73:33
userDTO.password = bcryptjs.hashSync(body.password, 10);

Seems that bcryptjs is undefined

To Reproduce
Steps to reproduce the behaviour:

  1. install PostgreSQL docker container and configure it
  2. run ./setup.sh
  3. run 'npm run start'
  4. trigger http request using insomnia (or postman)
  5. See an error on the server console

Expected behaviour
The request should create a new user in the database

Screenshots
image

Environment (please complete the following information):

  • OS: macOS Ventura 13.1 (22C65)
  • Node: v16.18.1
  • npm: 8.19.2

Additional context
none

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.