DEV Community

Shelner
Shelner

Posted on

Recommend Forlder structure for Spring Boot

src/ └── main/ ├── java/ │ └── com/ │ └── yourcompany/ │ └── yourapp/ │ ├── YourAppApplication.java # Main class (entry point) │ │ │ ├── config/ # Configuration classes (e.g. WebSecurityConfig) │ ├── controller/ # REST Controllers (@RestController) │ ├── dto/ # Data Transfer Objects │ ├── entity/ # JPA Entities (@Entity) │ ├── exception/ # Custom exceptions & handlers │ ├── repository/ # Spring Data Repositories (@Repository) │ ├── service/ # Business logic layer (@Service) │ └── util/ # Utility/helper classes │ └── resources/ ├── application.yml # Configuration file (or .properties) ├── static/ # Static assets (HTML, CSS, JS if needed) ├── templates/ # Thymeleaf or other templates (if needed) └── db/ └── migration/ # Flyway or Liquibase SQL migrations 
Enter fullscreen mode Exit fullscreen mode
cd src/main/java/com/yourcompany/yourapp/ mkdir -p {config,controller,dto,entity,exception,repository,service,util} 
Enter fullscreen mode Exit fullscreen mode

Top comments (0)