Spring Boot has long been the standard for creating backend applications in Java. Its strength lies in its simplicity and speed: you can get a working REST API up and running in just a few minutes. In this article, we will figure out how to take the first step.
REST API is a way of communication between the client and the server through HTTP requests. A few examples:
GET /users— get a list of usersPOST /users— create a new userDELETE /users/1— remove user with ID = 1
Step 1. Create a project
The fastest way to start is through Spring Initializr:
Specify the language — Java.
Choose the dependency: Spring Web.
Download and open the project in IDE (IntelliJ IDEA, Eclipse or VS Code).
Step 2. First controller
In the src/main/java folder, create a class:
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloController {
@GetMapping("/hello")
public String hello() {
return "Hi, this is my first REST API!";
}
}
What's going on?
@RestController— the class is responsible for REST requests.@GetMapping("/hello")— processes a GET request at/hello.The method returns a string, and it is displayed in the browser.

Step 3. Launch the application
The project already has a class with the annotation @SpringBootApplication. We run it. We go to http://localhost:8080/hello in the browser — and we see the response from the API. 🎉
Step 4. Working with data
Let's add a list of users:
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
public class UserController {
@GetMapping("/users")
public List<String> getUsers() {
return List.of("Alice", "Bob", "Eva");
}
}
Now when we request /users we will get JSON:
["Alice", "Bob", "Eva"]
What's next?
Add
POST,PUT,DELETEmethods.Connect the database (Spring Data JPA).
Configure tests and documentation (e.g., Swagger).
Conclusion
Spring Boot allows you to quickly deploy a REST API: from the first request to working with data — just a few lines of code. Once you have mastered the basics, you can build full-fledged services, from training projects to microservices.
To feel confident in Java and Spring Boot, it is important to understand the basics of programming. In the application Code you can learn Python, JavaScript, Lua and other languages, take courses and get a certificate. This is a great starting point for moving to serious backend frameworks.
And we also have an active Telegram channel, where we discuss cool ideas, share experiences and analyze tasks together — learning becomes not only useful, but also fun.
