<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mohamed Mabrouk</title>
    <description>The latest articles on DEV Community by Mohamed Mabrouk (@mohamed_mabrouk_3b0bf0385).</description>
    <link>https://dev.to/mohamed_mabrouk_3b0bf0385</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3920490%2F96da23f9-6256-4647-95d5-e80eb9ec7a35.jpg</url>
      <title>DEV Community: Mohamed Mabrouk</title>
      <link>https://dev.to/mohamed_mabrouk_3b0bf0385</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mohamed_mabrouk_3b0bf0385"/>
    <language>en</language>
    <item>
      <title>Stop writing boilerplate: Building a Java CLI for Clean Architecture</title>
      <dc:creator>Mohamed Mabrouk</dc:creator>
      <pubDate>Fri, 08 May 2026 23:16:38 +0000</pubDate>
      <link>https://dev.to/mohamed_mabrouk_3b0bf0385/stop-writing-boilerplate-building-a-java-cli-for-clean-architecture-471m</link>
      <guid>https://dev.to/mohamed_mabrouk_3b0bf0385/stop-writing-boilerplate-building-a-java-cli-for-clean-architecture-471m</guid>
      <description>&lt;p&gt;Setting up a proper Spring Boot Clean Architecture is, frankly, a war crime against developer productivity.&lt;/p&gt;

&lt;p&gt;Before you can write a single line of business logic, you spend hours creating domain entities, use cases, controller interfaces, DTOs, and mapper configurations across 30+ different files. It's tedious, it's error-prone, and it leads to massive inconsistencies across engineering teams.&lt;/p&gt;

&lt;p&gt;Friction is the enemy of velocity. So, I decided to automate it.&lt;/p&gt;

&lt;h4&gt;
  
  
  Enter ArchiGen
&lt;/h4&gt;

&lt;p&gt;I built ArchiGen: a CLI tool that generates full Spring Boot Clean Architecture projects in less than 5 seconds.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhqxldul74ajmosvoshwa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhqxldul74ajmosvoshwa.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Why Pure Java and PicoCLI?
&lt;/h4&gt;

&lt;p&gt;When building developer tooling, speed and control are everything. I could have used a heavy framework or a scripting language, but I wanted a compiled, robust tool.&lt;/p&gt;

&lt;p&gt;I chose &lt;strong&gt;pure Java&lt;/strong&gt; combined with &lt;strong&gt;PicoCLI&lt;/strong&gt;. PicoCLI is incredibly lightweight and allows for the creation of elegant, UNIX-style command-line interfaces with minimal overhead.&lt;/p&gt;

&lt;h4&gt;
  
  
  How It Works Under the Hood
&lt;/h4&gt;

&lt;p&gt;To generate the boilerplate, ArchiGen doesn't just copy-paste empty text files. It uses FreeMarker, a powerful templating engine.&lt;/p&gt;

&lt;p&gt;When you run the command to generate a new microservice, ArchiGen takes your specific domain inputs, feeds them into **FreeMarker **templates, and dynamically builds out the entire layered architecture.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="c1"&gt;// A conceptual look at how ArchiGen processes templates&lt;/span&gt;
&lt;span class="nc"&gt;Template&lt;/span&gt; &lt;span class="n"&gt;template&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getTemplate&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"UseCase.ftl"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;Map&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Object&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;HashMap&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;();&lt;/span&gt;
&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;put&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"domainName"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;userInput&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getDomain&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;put&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"packageName"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;userInput&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getPackage&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
&lt;span class="nc"&gt;Writer&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileWriter&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;outputPath&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;span class="n"&gt;template&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;process&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  The Impact
&lt;/h4&gt;

&lt;p&gt;The result is instantaneous. What used to take an entire afternoon of scaffolding is now reduced to a single terminal command.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Velocity&lt;/strong&gt;: Microservice setup time drops from hours to &amp;lt;5 seconds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Standardization&lt;/strong&gt;: Every microservice generated across a team follows the exact same Clean Architecture folder structure. No more debating where the DTOs go.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Conclusion
&lt;/h4&gt;

&lt;p&gt;Good developers write code. Great developers build tools so they have to write less code. ArchiGen was an exercise in prioritizing Developer Experience (DX) and proving that automation is always worth the upfront investment.&lt;/p&gt;

&lt;p&gt;You can check out the CLI and the source code here: [&lt;a href="https://github.com/mohamedmabrouk09/archigen" rel="noopener noreferrer"&gt;https://github.com/mohamedmabrouk09/archigen&lt;/a&gt;]&lt;/p&gt;

</description>
      <category>java</category>
      <category>devops</category>
      <category>productivity</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>From 0 to Production in 48 Hours: Architecting SmartPager</title>
      <dc:creator>Mohamed Mabrouk</dc:creator>
      <pubDate>Fri, 08 May 2026 23:07:19 +0000</pubDate>
      <link>https://dev.to/mohamed_mabrouk_3b0bf0385/from-0-to-production-in-48-hours-architecting-smartpager-2h25</link>
      <guid>https://dev.to/mohamed_mabrouk_3b0bf0385/from-0-to-production-in-48-hours-architecting-smartpager-2h25</guid>
      <description>&lt;p&gt;There’s a famous saying in engineering: "Fast, Cheap, or Reliable. Pick two." But when you enter a 48-hour hackathon to build a distributed incident management system, you are forced to pick all three.&lt;/p&gt;

&lt;p&gt;This is the story of how my team and I built SmartPager from scratch, moving from a blank IDE to a production-grade alerting system in a single weekend.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Problem with Incident Management
&lt;/h4&gt;

&lt;p&gt;Incident management isn't just about sending an email when a server goes down. It's about concurrent event handling, real-time escalation, and ensuring that alerts trigger in sub-seconds. If the alerting system itself fails, it's useless. We needed a system that could handle failure scenarios gracefully.&lt;/p&gt;

&lt;h4&gt;
  
  
  Why Microservices?
&lt;/h4&gt;

&lt;p&gt;The easiest route in a hackathon is a monolith. But we wanted to build something that mirrored real-world production environments. We chose a microservices architecture using Spring Boot, sitting behind an Nginx reverse proxy, backed by PostgreSQL, with a React frontend.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Incident Service : Ingests and processes incoming simulated incidents.&lt;/li&gt;
&lt;li&gt;Notification Service: Handles the real-time routing and escalation of alerts.&lt;/li&gt;
&lt;li&gt;Auth &amp;amp; Gateway: Handles security and load distribution.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcqzn9a41v4srkfcbd88k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcqzn9a41v4srkfcbd88k.png" alt=" " width="776" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Engineering Under Pressure: The Trade-offs
&lt;/h4&gt;

&lt;p&gt;Senior engineering is about understanding trade-offs. With only 48 hours, we didn't have the luxury of spinning up an entire Kafka cluster for event streaming.&lt;/p&gt;

&lt;p&gt;Instead, we engineered an event-driven escalation system using lightweight Spring Boot event listeners and optimized PostgreSQL indexing to process the state of incidents. We prioritized &lt;strong&gt;low-latency alerting over perfect eventual consistency&lt;/strong&gt;, ensuring that when a simulated incident fired, the on-call engineer was notified in milliseconds.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Outcome
&lt;/h4&gt;

&lt;p&gt;When the judging phase arrived, we didn't just show them a PowerPoint. We bombarded the system with 100+ concurrent simulated incidents.&lt;/p&gt;

&lt;p&gt;SmartPager didn't flinch. The distributed nodes handled the ingestion, the event-driven escalation triggered perfectly, and we achieved sub-second alert latency.&lt;/p&gt;

&lt;h4&gt;
  
  
  Conclusion
&lt;/h4&gt;

&lt;p&gt;Building SmartPager taught me that system resilience isn't something you add at the end of a project; it's a feature you have to architect from minute one. You don't need infinite time to build distributed systems—you just need a solid architecture and the discipline to stick to it.&lt;/p&gt;

&lt;p&gt;You can check out the source code for SmartPager here : [&lt;a href="https://github.com/mohamedmabrouk09/incident-microservices" rel="noopener noreferrer"&gt;https://github.com/mohamedmabrouk09/incident-microservices&lt;/a&gt;]&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>microservices</category>
      <category>springboot</category>
      <category>java</category>
    </item>
  </channel>
</rss>
