The Main Class

ShopeaseApplication

package com.shopease;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class ShopeaseApplication {

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

@SpringBootApplication = Three Annotations

AnnotationWhat it does
@SpringBootConfigurationmarks this class as a configuration class (a special @Configuration), so it can hold @Bean methods
@EnableAutoConfigurationturns on auto-configuration based on the classpath
@ComponentScanscans this package and sub-packages for @Component, @Service, @RestController ...

What SpringApplication.run Does

  1. Reads configuration (application.properties, environment variables, command-line arguments).
  2. Creates the ApplicationContext (the IoC container).
  3. Scans components and applies auto-configuration, creating all singleton beans.
  4. Starts the embedded Tomcat server on port 8080.
  5. Returns the context; the app now waits for HTTP requests.

Tip: Because it is a normal main method, you can run, debug and set breakpoints in the IDE like any Java program: click the green run icon next to main.