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
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

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

  • Memory Leak Due to Time-Taking finalize() Method
  • Building a Real-Time Audio Transcription System With OpenAI’s Realtime API
  • Using Java Stream Gatherers To Improve Stateful Operations
  • Navigating Change Management: A Guide for Engineers
  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.4K 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
Oops! Something Went Wrong

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

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

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 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!