The java-springboot-restapi-stack is a stack for bulding REST API applications with Java and Spring Boot following some best practices.
The default template of this stack uses those technologies:
- Java +17
- Spring Boot
- Spring Web
- Spring Actuator
- SpringDoc OpenAPI
- Spring Testing and jUnit 5
- Bean Validation
If you need more features you can apply as many plugins as you want.
The following steps show how to import the stack and create an application using the java-springboot-restapi stack.
- First, import the stack:
stk import stack https://github.com/zup-academy/java-springboot-restapi-stack
- Now, verify if the stack was imported correctly:
stk list stack | grep java-springboot
- Create your application and answer all the questions:
stk create app <app_name> -t java-springboot-restapi-stack/default-template
-
Import the application as a Maven project into your IDE and start coding;
-
Now it's time to run the application. Inside its directory, build and run it:
./mvnw spring-boot:run
Nice! You're ready for production I guess š„³
See here the benefits and how to use the Java Spring Boot REST API Stack template
If you want to enable the use of technologies to access Relational Database, Security through Oauth2 with Keycloack and create HTTP clients, you can use the following Plugins:
-
Java Spring Data JPA Plugin: Enable the use of key persistence-related technologies for relational databases for high performance.
-
Java Spring Security OAuth2 Resource Server Plugin: Enable authentication and authorization capability with Spring Security OAuth2 Resource Server.
-
Java Spring Open Feign Plugin: Build HTTP Clients declaratively with Spring Cloud Open Feign.
-
Java Spring Kafka Plugin: Enable the ability to use Apache Kafka in your Spring Boot Application.
-
Java Spring AWS SQS Plugin: Enables the ability to use AWS SQS in your Spring Boot Application.
-
Java Spring AWS SNS Plugin: Enables the ability to use AWS SNS in your Spring Boot Application.
-
Java Spring AWS S3 Plugin: Enables the ability to use AWS S3 in your Spring Boot Application.
You can create a new application using all these plugins through one single command:
stk create application <app_name> --stackfile java-springboot-restapi-stack/default
If you need any help, please open an issue on Stack's Github repository.