Specmatic Studio is a #NOCODE GUI interface that simplifies:
- API Contract Testing 🤝
- API Mocking 🧪
- API Resiliency Testing 🛡️
- Backward Compatibility Testing 🔄
- API Spec Generation 📄
- ...and more!
This demo project showcases how to contract test a Backend For Frontend (BFF) Service / API. We will also demonstrate how to isolate this BFF service from its dependencies—a HTTP Domain Service / API and another asynchronous service listening on Kafka—using API mocking. In the process, we will explore the ability to record API specifications using Specmatic Proxy and perform Backward Compatibility Testing as we make changes to API specifications.
Watch the demo video above or directly on YouTube. This video uses this very same repo to demonstrate the features described below. You can also use this repo to follow along with the video and learn about the various capabilities.
-
Clone the repository:
git clone https://github.com/specmatic/studio-demo
-
Navigate to the project directory:
cd studio-demo -
Start Studio along with the required App services:
docker compose up
These steps will bring up the following services in addition to Specmatic Studio itself:
- Order BFF Service / API
- Order Domain Service / API
Open Specmatic Studio in your browser:
open http://localhost:9000/_specmatic/studioClick on the hamburger icon on the left-hand side of the screen to reveal the API Spec browser. This demo setup is already preloaded with two API specifications:
- An OpenAPI spec (product_search_bff_v3.yaml) that describes the API exposed by the Order BFF service
- An AsyncAPI spec (kafka.yaml) that describes the API interface of the Kafka that the BFF service depends on
Since we need a Kafka broker running for the BFF, let's start a Specmatic KafkaMock using the AsyncAPI specification mentioned above. When you click on the file kafka.yaml, a screen will appear allowing you to start the Mock.
Now, you can jump right into running Contract Tests on the BFF service using the OpenAPI specification:
- Click on the OpenAPI spec
product_search_bff_v3to see an API overview. - At the top, you will see a
TESTbutton. - Enter the BFF service URL as
http://order-bff:8080(since the Order BFF service is running within Docker, we use the container name instead of localhost) and run the test.
You will now see the test report appear, and you can click on the details to drill down into the test results:
- Review the request and response
- Observe how the test name is based on the operations
🎉 Congratulations! You have successfully run an API Contract Test completely based on the OpenAPI spec without writing a single line of code.
Excited to learn more about what you can do? 🚀
- Record API specifications using the Proxy
- Simulate faults using the Mock server
- Generate spec-accurate examples to use as test and stub data
- Make sure API spec changes are backward compatible
- ...and much more!

