DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Microservices Testing: Key Strategies and Tools
  • Automatic Code Transformation With OpenRewrite
  • Building AI-Driven Intelligent Applications: A Hands-On Development Guide for Integrating GenAI Into Your Applications
  • Comparing SDLC With and Without AI/ML Integration

Trending

  • 7 Technology Waves I’ve Seen in 30 Years of Software — Will AI Be the Next Real Transformation?
  • 5 Common Security Pitfalls in Serverless Architectures
  • Chaos Engineering Has a Blind Spot. Agentic AI Lives in It.
  • Every Cache Miss Is a Tiny Tax on Your Performance
  1. DZone
  2. Software Design and Architecture
  3. Microservices
  4. From Prompt to Running Microservice: ServiceBricks Step-By-Step

From Prompt to Running Microservice: ServiceBricks Step-By-Step

Using ServiceBricks and this step-by-step guide, create modular microservices from scratch with artificial intelligence, source code generation, and a prompt.

By 
Danny Logsdon user avatar
Danny Logsdon
·
Dec. 24, 24 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
5.9K Views

Join the DZone community and get the full member experience.

Join For Free

Microservices have become a popular architectural style for building scalable and modular applications. However, setting up a microservice from scratch can still feel complicated, especially when juggling frameworks, templates, and version support. ServiceBricks aims to simplify this by allowing you to quickly generate fully functional, open-source microservices based on a simple prompt using artificial intelligence and source code generation. In this tutorial, we’ll walk through the entire process — from signing up to running your newly created microservice locally. 

Getting Started

Prerequisites

  • A web browser
  • Visual Studio 2022

Step 1: Register for an Account

Begin by registering for an account on the ServiceBricks.com website. Once you’ve signed up and logged in, you’ll have access to the platform’s microservice generation features and receive 10 free credits to evaluate the product.

Step 2: Create a New Microservice

After logging in:

  1. Locate and click the button to "Create Microservice."
  2. Enter a prompt or description of what you want your microservice to accomplish. For example, this could be “Create a microservice to manage a grocery list.”
  3. Click the "Generate" button.

Create a microservice screen

Step 3: Download the Generated Source Code

The generation process will create a tailored microservice solution for you. On the summary screen:

  1. Review the key details provided to ensure the microservice meets your requirements.
  2. Click the "Download Source Code" button. This will download a zip file that contains a complete solution containing multiple application projects including unit and integration tests for different .NET Core versions.

Models resultsRunning Your Microservice Locally

Once you have the source code, open the solution in Visual Studio 2022.

Step 1: Set the Startup Project

  • In the Solution Explorer, find the project for your chosen .NET Core version (e.g., WebAppNet8).
  • Right-click the project and select "Set as Startup Project."

Step 2: Run the Application

  • Once the startup project is set, click the "Start" button (or press F5) in Visual Studio.
  • Visual Studio will build and run the application. By default, it should start running at https://localhost:7000.

Step 3: Explore the Home Page Instructions

With the microservice running locally, the home page provides instructions on how to interact with your new microservice, as well as details on configuring storage providers or other backend services.

By default, the web application will use the InMemory database provider. To use any of the relational database providers, you will need to create migrations so that the database can be created.  

Step 4: Create Migrations for Relational Databases

Run the Batch File

Within the source code folder of your project, run the CreateMigrations.cmd file. This will:

  • Trigger a solution build.
  • Generate database migrations for the following providers:
    • Postgres
    • SQLite
    • SQL Server

Now that your microservice is up and running, you can begin experimenting by sending requests to the endpoints defined in your service. You can also modify the underlying code to add new features, integrate custom logic, or switch out the default storage provider.

Conclusion

By following these steps, you’ve seen how to take a prompt and transform it into a running microservice, ready for integration into a larger application ecosystem. You’ve learned how to register, generate code, download the source, run the application, and manage database migrations. With this solid starting point in place, you can now focus on refining and extending your service’s functionality, adjusting storage providers, and tailoring it to fit the unique requirements of your project.

Open source Relational database microservice Integration artificial intelligence

Opinions expressed by DZone contributors are their own.

Related

  • Microservices Testing: Key Strategies and Tools
  • Automatic Code Transformation With OpenRewrite
  • Building AI-Driven Intelligent Applications: A Hands-On Development Guide for Integrating GenAI Into Your Applications
  • Comparing SDLC With and Without AI/ML Integration

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook