Beagle v1.7 is no longer actively maintained. The documented version you are viewing may contain deprecated functionality. For up-to-date documentation, see the latest version .
Before you get started, you must know that the steps below are for JVM languages.
For other languages, your server needs to serve JSON following our API. Also, check out our cache and platform specification mechanisms, which you may wish to implement as the clients already support them.
Before you integrate Beagle to your application to run it on the backend, it’s important to check out if you have installed all the current versions of the following programs:
If you already have updated all the programs above, then just go to the following instructions.
When you create a micro-service, it’s recommend to use your team’s established mechanisms. If that’s not your case, you can just follow the configurations below.
For a simple setup, you can choose between 2 frameworks to create your BFF:
A modern, JVM-based, full-stack framework for building modular, easily testable micro-service and serverless applications.
Spring makes programming Java quicker, easier, and safer for everybody. Spring’s focus on speed, simplicity, and productivity has made it the world’s most popular Java framework.
Once you choose the framework you’ll work with, proceed with the configurations below:
As described on Micronaut’s quick start, create your application through a CLI tool with this command:
$ mn create app bff --build maven --lang kotlin
This will create an executable Micronaut project using Kotlin and Maven in a directory called bff
. Open this project on the chosen IDE and follow the following steps to set the dependencies.
If you want to use Micronaut 2.0, you can use the new website, very similar to Spring.
Java 8
(compatible with this version);Junit
like the unit tests library.Use Spring’s Initializr to create a project for your micro-service. Click the following link, Spring Initializr for Beagle Spring Starter, to get recommended settings.
GENERATE
to download a zip file containing your project.Lastly, you have to add the dependency for the Beagle starter to your backend. In that case, the framework you chose will define the dependency’s name (artifactId
) should be done.
Click on the tab of the framework you’re using and follow the steps to continue the configuration.
This starter also configures version 1.3.3 of**micronaut-runtime
**module in your BFF
To follow this requirement, you just have to add the dependency below to your pom.xml
.
<dependency>
<groupId>br.com.zup.beagle</groupId>
<artifactId>beagle-micronaut-starter</artifactId>
<version>${beagle.version}</version>
</dependency>
For projects configured with Gradle, just add the starter dependency in your build.gradle
or build.gradle.kts
file.
dependencies {
implementation("br.com.zup.beagle:beagle-micronaut-starter:${beagle.version}")
}
This starter also configures version 2.2.5 of**spring-boot-starter-web
**module in your BFF
To follow this requirement, you just have to add the dependency below to your pom.xml
.
<dependency>
<groupId>br.com.zup.beagle</groupId>
<artifactId>beagle-spring-starter</artifactId>
<version>${beagle.version}</version>
</dependency>
For projects configured with Gradle, just add the starter dependency in your build.gradle
or build.gradle.kts
file.
dependencies {
implementation("br.com.zup.beagle:beagle-spring-starter:${beagle.version}")
}
Insert the Beagle’s release version on the place of${beagle.version}
, in other words, put the Beagle’s version highlighted in blue badge above without the v character
.
For example:
-ext.beagle.version = "1.5.1"
Remember to always check if you’re using the latest version of Beagle. To see this information, you just have to pass your mouse above the version number. After that, sync your machine.
Well done, your initial configuration is ready to be used!
You can check a screen or server-driven component to test the BFF.
Spring Boot has a known problem involving WebMvcConfigurationSupport
. Its presence replaces other configurations, including the ones in Beagle’s Spring Starter.
In case you face a similar problem, we suggest you replace it forWebMvcConfigurer.
To see more about it, access this issue on Github.
The annotation@EnableWebMvc
causes the same problem, which means that you should replace it.
You can see more of how to use Beagle on the backend or how to test a BFF with server-driven components.
On this section, you made Beagle’s initial installation on your application!
Now, to keep configuring Beagle:
👉Go to initial configurations to enable the use of Beagle on your Web project.
👉 If you want to go straight to practice, access our tutorial to create a projeto from zero.
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.