Code generation with AI is a powerful way to accelerate development. Unlike other tools that rely solely on text prompts, Qlerify uses your Domain Model as the foundation for code generation. Think of the Domain Model as a blueprint—it ensures you maintain control while producing high-quality, structured code.
With Qlerify, you can choose the architecture that best suits your project. Need microservices, event-driven architecture, or serverless? Why not try them all and see which one works best for your needs!
Code generation with AI helps teams to:
Before generating code, you need to create a Domain Model. This model represents the core structure and logic of your application. You can build it using techniques like Event Storming, Event Modeling, or Domain-Driven Design. For more details on these methods, check out our articles; links are available in the page footer.
Once completed, your Domain Model might look like this. (The Domain Model tab is located under the workflow diagram.)
Next, split your Domain Model into one or more Bounded Contexts. A Bounded Context is an independent, deployable unit that contains a set of related commands and entities. This step ensures that your code is modular and scalable.
To assign Bounded Contexts to entities, click on "Select Bounded Context" in the Domain Model and either create a new bounded context or choose an existing one from the list. After completion, a Bounded Context in your Domain Model might look like this. Note the name of the Bounded Context in the top left and the two buttons immediately next to it. The first button is for viewing the Domain Model, and the second is for code generation.
Once your Bounded Contexts are defined, you can generate code for each one independently. Click the "Code Generation" button (the second button at the top left of the Bounded Context view). Here, you can select:
Click the 'Code Generation' button (the second button at the top left of the Bounded Context view).
Qlerify will suggest a prompt for code generation based on your Domain Model and selected options. You can review and refine this prompt by clicking "Customize Specification". The specification is in YAML format but is passed to the AI as text.
After making any necessary adjustments, click "Generate API". First, the file structure will be generated, followed by the individual files.
After generating the code, review the output to ensure it meets your requirements. Qlerify allows you to export the generated files and integrate them into your existing repository. From there, you can build, test, and deploy your application.
By generating code with a Domain Model as a base, the team can maintain control over the design and architecture of the solution. The generated code can be based on existing Entities or Data Models.
If you haven't tried code generation in Qlerify yet, now is the perfect time to explore its capabilities and boost your development workflow! To sign up for a Qlerify account, click on the link in the footer.