Giter Club home page Giter Club logo

ack-nestjs-boilerplate's Introduction

Contributors Forks Stargazers Issues MIT License

NestJs NodeJs Typescript MongoDB JWT Jest Yarn Docker

ACK NestJs Boilerplate ๐Ÿ”ฅ ๐Ÿš€

This repo will representative of authentication service and authorization service

[ACK NestJs][ack] is a Http NestJs v10.x boilerplate. Best uses for backend service.

You can request feature or report bug with following this link

Table of contents

Important

Very limited documentation

  • There have been some breaking changes between v5 and v6.
  • The features will be relate with AWS / Amazon web service
  • Stateless Authorization
  • Must run MongoDB as aย replication set for database transactions.
  • If you want to implementย Google SSO. You must have google cloud console account, then create your own Credential to get the clientId and clientSecret.
  • If you want to implementย Apple SSO. You must have clientId and signInClientId.
  • If you change the environment value of APP_ENV to production, that will trigger.
    1. CorsMiddleware will implement config from src/configs/middleware.config.ts.
    2. Documentation will disable.
    3. Global prefix will remove. Before is /api.
  • For monitoring, this project will use sentry.io, and only send 500 or internal server error.

Todo

  • Refactor to version 6, more straightforward
  • Add message remaining
  • Refactor unit test
  • Update Documentation, add behaviors
  • Update Documentation, and include an diagram for easier comprehension
  • Add Redis
  • Move to stateful Authorization Token (security and ux reason)
  • Implement GraphQL, just an options for running ?

Prerequisites

We assume that everyone who comes here is programmer with intermediate knowledge and we also need to understand more before we begin in order to reduce the knowledge gap.

  1. Understand NestJs Fundamental, Main Framework. NodeJs Framework with support fully TypeScript.
  2. Understand Typescript Fundamental, Programming Language. It will help us to write and read the code.
  3. Understand ExpressJs Fundamental, NodeJs Base Framework. It will help us in understanding how the NestJs Framework works.
  4. Understand what and how database works, especially NoSql and MongoDB.
  5. Understand Repository Design Pattern or Data Access Object Design Pattern. It will help to read, and write the source code
  6. Understand The SOLID Principle and KISS Principle for better write the code.
  7. Optional. Understand Microservice Architecture, Clean Architecture, and/or Hexagonal Architecture. It can help you to understand more deep about this project.
  8. Optional. Understanding The Twelve Factor Apps. It can help to serve the project.
  9. Optional. Understanding Docker.

Build with

Describes which version.

Name Version
NestJs v10.x
NestJs Swagger v7.x
NodeJs v20.x
Typescript v5.x
Mongoose v10.x
MongoDB v7.x
Yarn v1.x
NPM v10.x
Docker v24.x
Docker Compose v2.x

Objective

  • Easy to maintenance
  • NestJs Habit
  • Component based / modular folder structure
  • Stateless authentication and authorization
  • Repository Design Pattern or Data Access Layer Design Pattern
  • Follow Community Guide Line
  • Follow The Twelve-Factor App
  • Adopt SOLID and KISS principle
  • Support for Microservice Architecture, Serverless Architecture, Clean Architecture, and/or Hexagonal Architecture

Features

Main Features

  • NestJs 10.x ๐Ÿฅณ
  • Typescript ๐Ÿš€
  • Production ready ๐Ÿ”ฅ
  • Repository Design Pattern (Multi Repository, can mix with other orm)
  • Swagger / OpenAPI 3 included
  • Authentication (Access Token, Refresh Token, API Key, Google SSO, Apple SSO)
  • Authorization, Role Management.
  • Support multi-language i18n ๐Ÿ—ฃ, can controllable with request header x-custom-lang
  • Request validation for all request params, query, dan body with class-validation
  • Serialization with class-transformer
  • Url Versioning, default version is 1
  • Server Side Pagination
  • Import and export data with CSV or Excel by using decorator
  • Sentry.io for Monitoring Tools

Database

  • MongoDB integrate by using mongoose ๐ŸŽ‰
  • Multi Database
  • Database Transaction
  • Database Soft Delete
  • Database Migration

Security

  • Apply helmet, cors, and throttler
  • Timeout awareness and can override โŒ›๏ธ

Setting

  • Support environment file
  • Centralize configuration ๐Ÿค–
  • Centralize response structure
  • Centralize exception filter
  • Setting from database ๐Ÿ—ฟ

Others

  • Support Docker installation
  • Support CI/CD (Eg: Github Action)
  • Husky GitHook for run linter before commit ๐Ÿถ
  • Linter with EsLint for Typescript

Third Party Integration

  • AWS S3
  • AWS SES
  • AWS EC2
  • AWC ECS (ongoing)
  • Sentry.io
  • Google SSO
  • Apple SSO

Installation

Installation will describe in difference doc. here.

Swagger

You can check The Swagger after running this project. Url localhost:3000/docs and don't for get to put x-api-key on header.

License

Distributed under MIT licensed.

Contribute

How to contribute in this repo

  1. Fork the repository
  2. Create your branch (git checkout -b my-branch)
  3. Commit any changes to your branch
  4. Push your changes to your remote branch
  5. Open a pull request

If your code behind commit with the original / main / master branch, please update your code and resolve the conflict.

Contact

Andre Christi kan

Github LinkedIn

ack-nestjs-boilerplate's People

Contributors

andrechristikan avatar kunalrawat425 avatar dependabot[bot] avatar psheon avatar aallithioo avatar admondtamang avatar ak2g avatar bipinparajuli avatar

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.