Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/josephgoksu/prime-nestjs
A production-ready NestJS boilerplate using Typescript, Postgres, TypeORM, and Docker.
https://github.com/josephgoksu/prime-nestjs
nest nestjs nestjs-backend nestjs-best-practices nestjs-boilerplate nestjs-library nestjs-module nestjs-postgres nestjs-starter-template typeorm typescript
Last synced: 1 day ago
JSON representation
A production-ready NestJS boilerplate using Typescript, Postgres, TypeORM, and Docker.
- Host: GitHub
- URL: https://github.com/josephgoksu/prime-nestjs
- Owner: josephgoksu
- License: mit
- Created: 2021-09-25T08:59:13.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-08T07:59:50.000Z (9 months ago)
- Last Synced: 2024-12-14T19:07:13.009Z (9 days ago)
- Topics: nest, nestjs, nestjs-backend, nestjs-best-practices, nestjs-boilerplate, nestjs-library, nestjs-module, nestjs-postgres, nestjs-starter-template, typeorm, typescript
- Language: TypeScript
- Homepage:
- Size: 2.33 MB
- Stars: 384
- Watchers: 12
- Forks: 64
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# NestJS Boilerplate
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![GitHub issues](https://img.shields.io/github/issues/joeygoksu/prime-nestjs.svg)
[![Known Vulnerabilities](https://snyk.io/test/github/joeygoksu/prime-nestjs/badge.svg)](https://snyk.io/test/github/joeygoksu/prime-nestjs)
![GitHub stars](https://img.shields.io/github/stars/joeygoksu/prime-nestjs.svg?style=social&label=Star&maxAge=2592000)
## π Description
![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)
![Maintenance](https://img.shields.io/maintenance/yes/2023.svg)
![GitHub last commit](https://img.shields.io/github/last-commit/joeygoksu/prime-nestjs.svg)
![GitHub repo size](https://img.shields.io/github/repo-size/joeygoksu/prime-nestjs.svg)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/joeygoksu/prime-nestjs.svg)
![GitHub top language](https://img.shields.io/github/languages/top/joeygoksu/prime-nestjs.svg)
![GitHub language count](https://img.shields.io/github/languages/count/joeygoksu/prime-nestjs.svg)
![GitHub contributors](https://img.shields.io/github/contributors/joeygoksu/prime-nestjs.svg)
![GitHub commit activity the past week, 4 weeks, year](https://img.shields.io/github/commit-activity/y/joeygoksu/prime-nestjs.svg)
![GitHub commit activity the past week, 4 weeks, year](https://img.shields.io/github/commit-activity/m/joeygoksu/prime-nestjs.svg)
![GitHub commit activity the past week, 4 weeks, year](https://img.shields.io/github/commit-activity/w/joeygoksu/prime-nestjs.svg)
![GitHub package.json version](https://img.shields.io/github/package-json/v/joeygoksu/prime-nestjs.svg)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
bash ./setup.sh
```## Installation (Development)
```bash
$ npm install
```## Running the app
```bash
# development
$ npm run start# watch mode
$ npm run start:dev# production mode
$ npm run start:prod
```## Test
```bash
# 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:
```bash
openssl genrsa -out private_key.pem 2048
``````bash
# It needs be copied&pasted from terminal manually
awk 'NF {sub(/\r/, ""); printf"%s\\n",$0;}' private_key.pem
```2. Extract the public key from the key pair, which can be used in a certificate:
```bash
openssl rsa -in private_key.pem -outform PEM -pubout -out public_key.pem
``````bash
# 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](LICENSE.md) file for more information.
---
Made with β₯ by Joseph GΓΆksu
## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=josephgoksu/prime-nestjs&type=Timeline)](https://star-history.com/#josephgoksu/prime-nestjs&Timeline)