J
JavaCraft
← Back

Spring Boot

Spring Boot Project Structure – Beginner Guide

Published: Nov 16, 2025 • 7 min read

When you create a Spring Boot project, the structure may look confusing at first. But once you understand the purpose of each folder, everything becomes clear.

1. Main folders


src/
 └── main/
      ├── java/
      └── resources/
  • java/ – all source code goes here
  • resources/ – config files, templates, static files

2. Layered structure


com.example.demo
 ├── controller
 ├── service
 ├── repository
 ├── model
 └── DemoApplication.java

This structure is recommended for **clean architecture**.

3. Application class


@SpringBootApplication
public class DemoApplication {
  public static void main(String[] args) {
    SpringApplication.run(DemoApplication.class, args);
  }
}

Conclusion

Once you learn the purpose of controllers, services, and repositories, building APIs becomes much easier. In the next posts, we’ll build projects step-by-step using this structure.