2Ruk / nestjs-study

nestjs-study
0 stars 0 forks source link

[Week1 - StudyTodo] 단어 조사 #5

Closed 2Ruk closed 8 months ago

2Ruk commented 8 months ago
hyun9360 commented 8 months ago

링크 : https://inexpensive-roll-28e.notion.site/1-d71caa16fb43491ea788d15cf42ec68e

2Ruk commented 8 months ago

링크: https://www.notion.so/keep-me-in-mind/NestJS-Study-Week-1-cc025842503c4b488e499a5aff16cb50?pvs=4

graph LR
        A_Client(Client)
    A(Request)
    B(Middleware)
    C(Guards)
    D(pre-Interceptors)
    E(Pipes)
    Controller(Controller)
    Service(Service)
        Repository(Repository)
    H(post-Interceptor)
    I(Exception filters)
    J(Response)

subgraph Logic
    direction TB
        Controller --> Service 
        Service --> Repository 
        Repository  --> DB[(Database)] 
        DB[(Database)]  --> Repository
        Repository --> Service 
        Service --> Controller

end

subgraph Input
        A_Client --> A
    A --> B
    B --> C
    C --> D
    D --> E
end 

subgraph Response
    H --> I
    I --> J --> ClientResponse
end

subgraph LifeCycle
    Input --> Controller
    Logic
    Controller --> Response
end

style LifeCycle fill:#AAA
style Input fill:#30A8E6
style Logic fill:#E67630
style Response fill:#30E6AD
graph TB

    subgraph clusterMiddleware
        B1(Globally bound middleware)
        B2(Module bound middleware)
    end

    subgraph clusterGuards
        C1(Global guards)
        C2(Controller guards)
        C3(Route guards)
    end

    subgraph clusterInterceptors
        D1(Global interceptors)
        D2(Controller interceptors)
        D3(Route interceptors)
        H1(Route interceptors)
        H2(Controller interceptors)
        H3(Global interceptors)
    end

    subgraph clusterPipes
        E1(Global pipes)
        E2(Controller pipes)
        E3(Route pipes)
        E4(Route parameter pipes)
    end

    subgraph clusterExceptionFilters
        I1(Route exception filters)
        I2(Controller exception filters)
        I3(Global exception filters)
    end
iambom commented 8 months ago

https://iambom.notion.site/Week1-StudyTodo-afe9bfe5d852444699b6ffe4aaf2c0be?pvs=4

justinaus commented 8 months ago

https://polite-cosmonaut-07d.notion.site/b500b7ddfbc0409da057bc92097680c1?pvs=4

DaHoon06 commented 8 months ago

https://github.com/2Ruk/nestjs-study/pull/8

HONG33333 commented 8 months ago

https://flat-galley-d45.notion.site/1-66b6e6cb32b64d5086e10497203ec74f?pvs=4

2Ruk commented 8 months ago

@justinaus 문서 정리 너무 잘 해주셨네요!!! 최고입니다!!

  1. Service에 대한 고찰 -> exception 처리 부분이 맞습니다!
  2. Entity 에 대한 고찰 ->
    • synchronize: true / false에 따라 table, column등이 자동 생성되는데 테이블 드랍이 되는 경우는 많이 못 본거 같습니다. ( 컬럼이 생성되고, 컬럼이 날아가는 경우를 봤는데 주로 타입이 달라질 때 그랬어요 -> 그래서 production에서는 요걸 쓰기도 해요 typeorm migration: https://orkhan.gitbook.io/typeorm/docs/migrations )
  3. delete/remove(HardDelete) 자체를 잘 안쓰긴해요! ( softdelete를 많이함니다! )

2Ruk commented 8 months ago

@HONG33333 삼님도 훌룡하게 정리를 잘 해주셨군요!! Provider에 대한 궁금증 - 모듈에 등록하면 nest가 알아서 객체들끼리 이어줌..? 에 대해서는 한 Module 범위 내에서만 보장이 됩니다! Module에서 construct에서 사용하는 provider ( Repository나 다른 Service등 )은 Provider 혹은 다른 Module에서 export 로 공급될 때 해당 Module을 import할때만 공급을 받을 수 있습니다!

  1. 다른 Module을 import 해서 사용 ( 이때, export: [ ] 에 들어있어야함)
  2. Provider에 사용하고 싶은 Injectable을 공급