Broadleaf Microservices
  • v1.0.0-latest-prod

Getting Started with Broadleaf Microservices

Overview

Broadleaf Commerce offers two distinct journey paths for developers looking to experience and work with Broadleaf Microservices.

Choose the path that aligns with your development goals and explore the power of Broadleaf Microservices!

Frontend or Storefront Developer Path

As a frontend or storefront commerce developer, you can take advantage of Broadleaf’s free dedicated provisioned demo environment on Broadleaf Cloud. Here’s what this path entails:

  • Dedicated Hosted Instance: You’ll have your own dedicated storefront and an administration console.

  • Out-of-the-Box Commerce APIs: Broadleaf exposes out-of-the-box commerce APIs that you can use to interact with your dedicated storefront. Frontend developers can leverage your own Open API interface to explore and query your dedicated instance.

  • Catalog Management: Upload your own catalog, create promotions, and manage discounts—all within your own dedicated instance.

  • Commerce Features: Perform typical commerce functions like add to cart, checkout, and order management directly on your dedicated environment.

  • Ideal Starting Learning Path: This path is perfect for developers who want to experience Broadleaf APIs and capabilities without the need to set up and run a full backend commerce API ecosystem locally.

If you’re interested in this path, sign up for your own dedicated instance here. When your demo is provisioned, we recommend following the Broadleaf Microservices API Tutorial to learn how to use and make the most out of your own dedicated instance!

Full-Stack and Backend Commerce API Developer Path

If you’re a full-stack or backend commerce API developer, Broadleaf provides a comprehensive developer experience that allows you to run the entire microservices ecosystem on your local machine. Here’s what this path offers:

  • Local Development Environment: Run all 30+ Java and Spring microservices locally.

  • Accelerator Projects & Supporting Services: Launch various supporting containers that supplement the full commerce journey, such as an accelerator storefront and an admin console built in React.

  • Full Extensibility: Broadleaf is unique in that you have full extensibility options to make the platform your own. give you a hands-on look at core framework concepts and key extension patterns.

  • Ideal Project Starting Point: This path provides a good foundational starting point to begin building customizations for your specific commerce implementation.

  • Free Developer Evaluation Credentials: Sign up for free limited-term developer evaluation credentials.

  • Minimum System Requirements: Before signing up, ensure that your system meets the recommended requirements for running the full-stack locally.

The rest of this guide is focused on the things that are needed to support a full-stack and backend commerce API developer experience. If you’re interested in learning about the extensibility of the platform and are looking to run the full stack locally, keep on reading!

What Do I Need?

Below you will find prerequisites and instructions to support a full-stack and backend commerce API developer learning path:

Credentials

In order to get started running Broadleaf Microservices locally, you will need to obtain a few resources and credentials before working through the installation instructions outlined below.

Note

If you already have an Enterprise License, proceed with the instructions below. If you do not have an Enterprise License, you can request free limited term developer evaluation credentials here. For more information about Broadleaf’s Enterprise Licenses reach out to us.

Broadleaf licensed clients get access to Broadleaf’s Docker Registry, Maven Nexus, and NPM Repository in order to build and run these starter projects. Once you have obtained these credentials, you will need to configure them appropriately (which will be outlined in the relevant sections below).

Evaluation Credentials vs Enterprise License Credentials

If you’ve signed up for a free developer evaluation trial (https://www.broadleafcommerce.com/developer-evaluation), you should receive an email with getting started instructions that include a username, password, and an expiration date.

You should be aware that there are slightly different "Getting Started" steps that are only applicable to Evaluation Credentials. As you are following any of the getting started guides on this portal, make sure to pay attention to any instructions that callout different steps needed for "Evaluation Credential Holders".

Tip
a list of all the differentiated steps between Enterprise License Credentials vs Evaluation Credentials can be found on this page
How do I know if I have evaluation credentials?

You have evaluation credentials if:

A Developer Machine

Running the full microservices stack locally (which includes running multiple Docker containers and JVM applications) requires a modern-day developer machine (x86 and ARM systems are both supported) with the following setup:

Recommended System Specs:

  • OS Support: MacOS, Windows, Linux

  • 10-core CPU (8-core minimum)

  • 32 GB Memory (16 GB minimum)

Tip
See the Docker section below for recommended docker configuration

An Integrated Developer Environment (IDE)

We also recommend that you have an IDE(s) setup that can support Java and Spring development from a backend commerce API perspective and React/Next.js application development from a frontend consumer experience perspective. Popular choices that we recommend include IntelliJ IDEA and Visual Studio Code.

Java

You will need Java 17 installed on your machine to support the latest release trains. We recommend Adoptium Eclipse Temurin. See more details about supported Java versions here.

Release Train Java Compatibility

< 1.8.1

Java 11

>= 1.8.1 & < 2.x

Java 11 or 17

>= 2.x

Java 17

Docker

In order to run the supporting services (e.g. Zookeeper, SOLR, Kafka, etc…​) that underpin the Broadleaf ecosystem, you will need to have Docker Engine & Docker Compose installed locally.

Tip
Docker Desktop for both Mac and Windows already includes compose along with other docker apps.

Once you have docker installed, you will want to authenticate with Broadleaf’s docker registry enabling you to pull down Broadleaf container images.

For Enterprise License Holders:

docker login repository.broadleafcommerce.com:5001

For Evaluation Credential Holders:

docker login https://evaluation.docker.blcdemo.com

When prompted, type in the username and password you were provisioned.

You’ll want to configure your Docker settings above the defaults. A good rule of thumb is to allow Docker to consume around 3/4 of your system resources if necessary. Otherwise, docker may start shutting down some of your containers due to insufficient resources.

Tip
See the docs for Docker for Windows or Docker for Mac to control these settings. For certain Windows users running certain versions of docker, this may mean creating a .wslconfig file (https://docs.microsoft.com/en-us/windows/wsl/wsl-config#example-wslconfig-file)

Below are example screenshots showcasing various docker configurations on different machine types:

Docker Local Configuration Screenshot

OpenSSL

OpenSSL is used to perform cryptographic operations during project generation and is responsible for several key security artifacts.

Certain systems already have openssl installed and available on your PATH. You can verify this by running the following on your command line. You should validate that the command is found and a valid version is installed (e.g. LibreSSL for MacOS or OpenSSL for Windows etc…​):

openssl version

If the openssl command is not found and present on your system, one of the easiest ways to get OpenSSL installed is by including it during a git installation: Install Git

Otherwise, you may install OpenSSL directly using whatever method makes the most sense.

Note
You may need to add the directory containing the OpenSSL executable to your PATH.

In the end, you should be able to execute this command and see similar results. We have primarily tested with versions >= 3.1.x, and your mileage may vary with earlier versions.

> openssl version
OpenSSL 3.1.4 24 Oct 2023 (Library: OpenSSL 3.1.4 24 Oct 2023)

Below are examples screenshots showcasing installation of OpenSSL via Git and updating your PATH environment variables on a Windows Machine:

OpenSSL Windows Installation Screenshot
Tip
If installing OpenSSL via Git on Windows, the installation process typically installs the executable in the following directory: C:\Program Files\Git\usr\bin\openssl.exe

How Do I Get Started?

Now that you have your machine setup, how do you get the microservices ecosystem running? The quickest way to get started will be to generate a project using Broadleaf’s Project Intializr: https://start.broadleafcommerce.com.

Note
We recommend reading about some project changes and enhancements that have been introduced with Broadleaf Initialzr (especially if you have experience working with older versions of Broadleaf Microservices).

Generate a Broadleaf Manifest

  1. Go to start.broadleafcommerce.com

  2. Pick the Broadleaf Release Train that you would like your project to target. If you are unsure or this is your fist time evaluating Broadleaf, pick the latest stable version.

  3. Choose a Flex Package Deployment Option. If this is your fist time evaluating Broadleaf, we recommend choosing the Mono (also called the one) Flex Package option.

  4. Configure a Group and Package Name specific to your company or implementation (e.g. com.mycompany.microservices)

  5. Choose dependencies for your specific implementation. We recommend Postgres , Kafka, and the Config Server as good default starting points.

  6. If you know what commerce microservices you wish to extend and customize, pick them here. If you are unsure or this is the first time evaluating Broadleaf, we recommend that you just skip this section as you can easily modify your project later.

  7. If you are just evaluating Broadleaf, we recommend checking the box that Enables Demo Data

  8. Click Generate to download a zip file to your local machine.

  9. Unzip the downloaded file and review the HELP.md file included in the manifest project. Follow the instructions to generate, build, and run the suite of Broadleaf Microservices on your machine.

Tip
once you have your choices made on the Initializr, you can also click "Explore" to preview the manifest project output

High Level Topology Diagram

The following diagram illustrates the topology of all the resources and components that make up the full suite of Broadleaf Microservices once everything is deployed and running.

Topology Example Diagram

The overall topology can be broken down into a few functional tiers:

  • Gateways - the reference architecture provides 2 example proxy gateways: one for requests to back-office/internal applications and APIs called the admingateway, and another to route requests to a consumer experience/storefront frontend and related APIs called the commercegateway

  • Frontend Applications - these are reference Node.js/React applications that provide interfaces to interact with the headless commerce APIs. These applications include a backoffice admin console intended for merchandisers, content managers, vendors, CSRs, etc…​ an Open API UI which provides a useful interface for developers to understand how to use and consume the out-of-box commerce APIs, and finally an example storefront accelerator that is used to demonstrate how to create a best-practice consumer-facing storefront application

  • Headless Commerce APIs - these represent the core Broadleaf microservices that provide a lot of commerce functionality across the different services. These core services can be bundled into different Flex Packages based on business needs and overall deployment intentions

  • Supporting Services - Broadleaf is designed to support a variety of different supporting architecture components. The framework is built on top of different abstraction frameworks allowing you to choose things like a relational database as well as a messaging broker. Our recommended defaults include Postgres and Kafka as an example.

Additional Development and Learning Paths

There are multiple ways to experience working with the framework.

  1. Core Broadleaf Framework Concepts: Below you will find links to core framework concepts that are important to be familiar with. Using these core concepts, you can support a variety of different business models, use cases, and industry verticals.

  2. General Learning Resources: Resources that outline and describe important Broadleaf Concepts and Features:

  3. From a Frontend Development Perspective: Here are a few resources catered to frontend developers and to those developers looking to create a consumer facing storefront experience

  4. From a Backend API Development Perspective: As a backend developer, here are a few resources catered to debugging and customizing the core Spring/Java commerce APIs:

  5. From an Operational Perspective: Here are resources catered to infrastructure and DevOps: