Directory Convention - dnd-side-project/dnd-9th-1-backend GitHub Wiki

πŸ“‹ Directory Convention

  • domain
    • Entity, Enum, Repositoryλ₯Ό κ΄€λ¦¬ν•œλ‹€.
  • dto
    • μš”μ²­,응닡에 μ‚¬μš©λ˜λŠ” DTO듀을 κ΄€λ¦¬ν•œλ‹€.
  • presentation
    • ν΄λΌμ΄μ–ΈνŠΈμ™€μ˜ 톡신을 λ‹΄λ‹Ήν•˜λŠ” Controllerλ₯Ό κ΄€λ¦¬ν•œλ‹€.
  • applicaiton
    • λΉ„μ¦ˆλ‹ˆμŠ€ λ‘œμ§μ„ λ‹΄λ‹Ήν•˜λŠ” Serviceλ₯Ό κ΄€λ¦¬ν•œλ‹€.
  • global
    • 전체적인 ν”„λ‘œκ·Έλž¨μ— 영ν–₯을 μ£ΌλŠ” μ„€μ • 파일 등을 ν¬ν•¨ν•œλ‹€.
    • 역할에 따라 νŒ¨ν‚€μ§€λ‘œ κ΅¬λΆ„ν•œλ‹€. (util, config, constant …)
dnd
β”œβ”€β”€ main
|    | 
|    β”œβ”€β”€ user
|    |    β”œβ”€β”€ domain
|    |    |     β”œβ”€β”€ User.class
|    |    |     β”œβ”€β”€ UserStatus.class    
|    |    |     └── UserRepository.class
|    |    |
|    |    |── dto
|    |    |    β”œβ”€β”€ request  
|    |    |    |      └── UserRequest.class   
|    |    |    └── response
|    |    |           └── UserResponse.class
|    |    |
|    |    β”œβ”€β”€ presentation
|    |    |       └── UserController.class
|    |    |
|    |    └── application
|    |            └── UserService.class
|    |    
|    └──  global
|          β”œβ”€β”€ config
|          |      └── WebConfig.class
|          β”œβ”€β”€ util
|          |
|          β”œβ”€β”€ response
|          |     β”œβ”€β”€ ApiResponse.class
|          |     └── ErrorResponse.class
|          |
|          └── error 
|                β”œβ”€β”€ ErrorCode.class 
|                └── ControllerAdvice.class
β”œβ”€β”€ resource
β”‚Β Β     β”œβ”€β”€ static
β”‚Β Β     β”œβ”€β”€ templates
β”‚Β Β     β”œβ”€β”€ application.yml
β”‚      └── application-dev.properties
β”‚      
└── DndApplication.class