Spring Boot simplifies application development by automatically configuring the application based on the dependencies present in the project. Internally, it starts the Spring container, performs component scanning, creates and manages beans, applies auto-configuration, and launches an embedded server when required. This allows developers to focus on business logic instead of extensive framework configuration.
High-Level Startup Flow
Application Starts
|
@SpringBootApplication
|
SpringApplication.run()
|
Create ApplicationContext
|
Component Scanning
|
Bean Creation
|
Auto-Configuration
|
Embedded Server Starts
|
Application Ready
Step 1: Application Startup
@SpringBootApplication
public class EmployeeApplication {
public static void main(String[] args) {
SpringApplication.run(
EmployeeApplication.class,
args);
}
}SpringApplication.run() performs the complete bootstrapping process.
Step 2: Create Application Context
Spring Boot creates an ApplicationContext.
It acts as the central container of the application.
Step 3: Component Scanning
@ComponentScan
@Service
public class EmployeeService {
}Spring automatically detects and registers this class as a bean.
Step 4: Bean Creation and Dependency Injection
Spring creates all discovered beans.
@Service
public class EmployeeService {
}
@Repository
public class EmployeeRepository {
}Spring automatically injects dependencies.
@Service
public class EmployeeService {
@Autowired
private EmployeeRepository repository;
}The container manages these relationships automatically.
Step 5: Auto-Configuration
@EnableAutoConfiguration
@SpringBootApplication
Then it automatically configures required components.
spring-boot-starter-data-jpa
and
mysql-connector-jwithout manual configuration.
Step 6: Load Configuration Properties
server.port=9090
spring.datasource.url=jdbc:mysql://localhost/testdbThese values are injected into the application during startup.
Step 7: Embedded Server Initialization
For web applications, Spring Boot automatically starts an embedded server.
spring-boot-starter-web
automatically includes Tomcat.
The server starts and begins listening for requests.
http://localhost:8080
Step 8: Request Handling
Client Request
|
DispatcherServlet
|
Controller
|
Service
|
Repository
|
Database
Spring MVC routes the request to the appropriate controller method.
Step 9: Actuator and Monitoring
If Spring Boot Actuator is included, additional monitoring features are enabled.
/actuator/health
/actuator/metrics
1. Creates ApplicationContext.
2. Scans all packages.
3. Creates beans.
4. Injects dependencies.
5. Configures database connection.
6. Starts Tomcat.
7. Makes REST APIs available.
All of this happens automatically with minimal configuration.
What Does @SpringBootApplication Do Internally?
@Configuration
@EnableAutoConfiguration
@ComponentScan
This single annotation triggers most of Spring Boot's startup process.
Benefits of Internal Architecture
A concise interview answer is
Internally, Spring Boot starts the application using SpringApplication.run(), creates the ApplicationContext, performs component scanning, creates and injects beans, applies auto-configuration based on project dependencies, loads configuration properties, and starts an embedded server such as Tomcat for web applications. This automation significantly reduces manual configuration and accelerates application development.
Last updated: 11 November 2026
Previous question: Why do we prefer Spring Boot over Spring?
Next question: What are Spring Boot starter dependencies?