Code Monkey home page Code Monkey logo

nest_study's Introduction

nest_study

Nest.js 공부하는 레포

  1. 2023.07.05 - 2023.07.09
  • 기업 백엔드 사전과제를 하며 Nest.js 설치부터 백엔드 구축까지 처음 접해봄.
  • 모듈화된 아키텍처를 사용하며, 비동기 처리로 스트리밍, 웹소켓 구현에 용이할 것이라고 생각.
  • 해당 프로젝트를 통해 간단한 기능 구현 및 코드 리팩토링을 진행하므로써 Nest.js, typeORM 공부하고자 함.
  • DB 와 상호작용하기 전 로직을 Service or Controller 중 어디 작성하는 것이 일반적인 패턴인지 파악해야 함.

Service -> Controller -> Module 로 접근 제어

import { Injectable } from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';

@Injectable()
export class AuthService('access') {

  // 처리할 로직 + DB 와 상호작용을 하는 공간
}
@Controller('auth')
export class AuthController {
  constructor(private readonly authService: AuthService) {} // 의존성 주입

  // url 설정, authService 함수를 호출
}
// Module 단위로 프로젝트를 관리
@Module({
  imports:[],
  controllers: [AuthController],
  providers: [AuthService, UserService, JwtAccessGuard],
})
export class AuthModule {}
  1. 버전
  • Nest.js 8.2.8
  • TypeORM 0.2.41
  • TypeScript 4.5.5
  • Mysql 8.0

nest_study's People

Contributors

ju-yeon-k 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.