GithubHelp home page GithubHelp logo

kakasoo / nestjs-template Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 145 KB

언제든지 프로젝트를 바로 시작할 수 있도록 세팅해둔 템플릿입니다.

JavaScript 5.36% TypeScript 92.02% HTML 2.63%

nestjs-template's Introduction

README.md

nestjs 초기 세팅

  • nestjs 설치
  • resource, auth, decorators, guards, interceptors, settings로 src 폴더 구조 정리
    • resource에는 각 API에 필요한 리소스 별 정리
    • auth는 auth module과 service를,
    • decorators
    • guards 에는 guard들과 각 전략을 저장할 strategies 폴더
    • interceptors
    • settings
  • swagger 사용, settings에 함수 형태로 만든 다음 main.ts에서 호출
  • morgan 사용 / url 경로는 api 호출 시만 사용되도록 조정
    • custom한 Logger를 사용하여 winston에 이용
  • tsconfig
    • include에는 src/ 경로를 추가하고,
    • rootDir로 ./src를 지정
  • npm run build 가 정상 동작하는지 테스트
  • typeorm config
    • configuration 때문에라도, useFactory를 사용해 작성한다.
  • repository
  • passport-local
  • cors : cross origin을 허용하는 미들웨어
  • helmet : 웹 취약성으로부터 앱 보호를 위한 미들웨어
  • csurf : 사이트 요청 위조를 방지하기 위한 미들웨어, 세션 사용 시에만.
  • throttler : 무차별 대입 공격 방지를 위한 미들웨어
  • static 폴더 설정
    • static 내부에 index.html을 socket.io 용도로 설정
    • 클라이언트 분리 시에는 cors 설정에 유의할 것
  • socket 통신을 위해 src/gateways 폴더 생성

nestjs-template's People

Contributors

kakasoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.