Here’s a complete beginner-friendly guide to create a simple Spring Boot application step-by-step — using only annotations, no XML, and designed for learning key Spring Boot concepts like:
@SpringBootApplication
@RestController
@GetMapping
@Autowired with @Service
✅ Project: springboot-helloapp
This app exposes an API:
GET http://localhost:8080/hello
Response:
🔧 Step-by-Step Setup
🔹 Step 1: Go to Spring Initializr
🌐 Visit: https://start.spring.io
Fill these:
Add Dependencies:
✅ Spring Web
Then click "Generate"
Unzip the project and open it in VSCode or IntelliJ
🔹 Step 2: Project Structure
src/
└── main/
├── java/
│ └── com.example.springboothelloapp/
│ ├── SpringbootHelloappApplication.java
│ ├── controller/HelloController.java
│ └── service/HelloService.java
└── resources/
└── application.properties
🔹 Step 3: Main Application Class
📄 SpringbootHelloappApplication.java
🔹 Step 4: Create HelloService
📄 service/HelloService.java
🔹 Step 5: Create HelloController
📄 controller/HelloController.java
🔹 Step 6: Run the App
In terminal:
Or in VSCode/IntelliJ:
Right-click → Run SpringbootHelloappApplication.main()
🔹 Step 7: Test the Endpoint
Go to:
http://localhost:8080/hello
Response: