<?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: Tuomas</title>
    <description>The latest articles on DEV Community by Tuomas (@munkkeli).</description>
    <link>https://dev.to/munkkeli</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%2F1275122%2F03cbfc26-ec09-4947-8f26-cde3552168ec.png</url>
      <title>DEV Community: Tuomas</title>
      <link>https://dev.to/munkkeli</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/munkkeli"/>
    <language>en</language>
    <item>
      <title>Easily Create Complex Stacks in Just a Few Clicks — New Release!</title>
      <dc:creator>Tuomas</dc:creator>
      <pubDate>Mon, 17 Mar 2025 14:06:52 +0000</pubDate>
      <link>https://dev.to/diploi/easily-create-complex-stacks-in-just-a-few-clicks-new-release-3gdl</link>
      <guid>https://dev.to/diploi/easily-create-complex-stacks-in-just-a-few-clicks-new-release-3gdl</guid>
      <description>&lt;p&gt;Previously, we wrote about our &lt;a href="https://dev.to/diploi/how-we-solved-infrastructure-as-code-2ldn"&gt;IaC implementation&lt;/a&gt;, and today we are proud to announce its public release. Our new Stack Builder is out for anyone to try out! 🎉 Head over to &lt;a href="https://diploi.com/" rel="noopener noreferrer"&gt;diploi.com&lt;/a&gt; to have a go with it.&lt;/p&gt;

&lt;p&gt;Here's a concise list of what this new update makes possible:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🖱️ Pick 'n' choose style UI for creating tech stacks&lt;/li&gt;
&lt;li&gt;🔌 Zero-config deployments for even the most challenging of stacks&lt;/li&gt;
&lt;li&gt;🪄 Automatic monorepo generation &amp;amp; configuration&lt;/li&gt;
&lt;li&gt;🔥 Automatic image generation for optimized production deployments&lt;/li&gt;
&lt;li&gt;🔧 Access to Dockerfiles for each component for full customizability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are in addition to what Diploi already offers, like our remote development environments with Cloud IDE &amp;amp; SSH support and automatic  SSL generation to name a few.&lt;/p&gt;

&lt;p&gt;Below is a deeper dive to some key highlights of this update. I'll also reveal a few behind the scenes details on how we implemented these features 😉, so keep reading if you are interested!&lt;/p&gt;




&lt;h2&gt;
  
  
  🏗️ Visual Stack Builder
&lt;/h2&gt;

&lt;p&gt;Before this update, we supported a list of pre-made stacks with services that could not be easily swapped out for others. Like a template with Next.js and PostgreSQL could not be easily changed to include Redis for example. The most common feedback we received (by far) was the lack of support for the exact stack someone was familiar with and wanted to use. So we set out to fix this issue (and the solution had to be magical 🪄).&lt;/p&gt;

&lt;p&gt;What we ended up implementing is a one of a kind tool for easily building the exact stack that your project needs while still remaining flexible once the project grows or changes in scope. Our Stack Builder combined with the IaC &lt;code&gt;diploi.yaml&lt;/code&gt; file allows you to change infrastructure on the fly, and because the file is committed to Git, even maintain different infrastructure on different branches 🤯!&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%2Fgdknw2pn28t6u3depqn2.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%2Fgdknw2pn28t6u3depqn2.png" alt="a selection of components with checkboxes, some are checked" width="800" height="541"&gt;&lt;/a&gt;&lt;/p&gt;
A visual list of components that can be easily included in the stack.



&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Once you have picked your ideal stack, here's what our system does behind the scenes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creates a monorepo with boilerplate code for each component&lt;/li&gt;
&lt;li&gt;Preconfigures GitHub actions to create optimized production builds&lt;/li&gt;
&lt;li&gt;Generates HELM charts to set up environments with&lt;/li&gt;
&lt;li&gt;Generates domains &amp;amp; SSL certificates for component endpoints&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👀 We also implemented an embedded version of the full stack builder on our &lt;a href="https://diploi.com/" rel="noopener noreferrer"&gt;diploi.com&lt;/a&gt; homepage. You can launch a stack directly from it without even creating an account. Give it a try if you are interested!&lt;/p&gt;




&lt;h2&gt;
  
  
  📝 Infrastructure as Code (IaC)
&lt;/h2&gt;

&lt;p&gt;I won't go into too much detail here, as you can check out the &lt;a href="https://dev.to/diploi/how-we-solved-infrastructure-as-code-2ldn"&gt;IaC implementation&lt;/a&gt; blog post that goes into great detail about our IaC implementation.&lt;/p&gt;

&lt;p&gt;I do want to give an example of the &lt;code&gt;diploi.yaml&lt;/code&gt; file here to give you an idea of what our Stack Builder actually generates as an output.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;diploiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1.0&lt;/span&gt;
&lt;span class="na"&gt;components&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Next.js&lt;/span&gt;
    &lt;span class="na"&gt;identifier&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;next&lt;/span&gt;
    &lt;span class="na"&gt;package&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/diploi/component-nextjs#v0.0.1&lt;/span&gt;
    &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;include&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;postgres.*&lt;/span&gt;
&lt;span class="na"&gt;addons&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;PostgreSQL&lt;/span&gt;
    &lt;span class="na"&gt;identifier&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;postgres&lt;/span&gt;
    &lt;span class="na"&gt;package&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/diploi/addon-postgres#v17.0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
An example Diploi config produced from the visual component picker.


&lt;p&gt; &lt;/p&gt;

&lt;p&gt;This file is committed to your repository, and can be changed at any time. It makes managing your infrastructure as easy as installing an NPM package.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚙️ GitHub Actions
&lt;/h2&gt;

&lt;p&gt;While giving our users the freedom to edit their stacks the way they liked, we still wanted to give them the most optimized production environments possible, which means building optimized Docker images.&lt;/p&gt;

&lt;p&gt;We wanted to use GitHub actions for this task as GitHub actions make it convenient to run CI/CD tasks (like building production ready images) right in the project repository, and a lot of developers like using them in their workflow.&lt;/p&gt;

&lt;p&gt;We created two custom GitHub actions to make this as easy for the user as possible:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A "Define Components" action that reads the &lt;code&gt;diploi.yaml&lt;/code&gt; file directly from the repository and builds a list of components that need to have images built&lt;/li&gt;
&lt;li&gt;A "Build" action that configures and builds a single component&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We then create a matrix step from the output of the Define Components action, which allows us to run the Build action for each of the components. This way we do not need to edit the GitHub actions file at all even when the components change!&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%2Fxkhbjggc5kr3jnknpfip.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%2Fxkhbjggc5kr3jnknpfip.png" alt="the GitHub actions page with an example two-step action open" width="661" height="433"&gt;&lt;/a&gt;&lt;/p&gt;
An example of our two GitHub actions working together to build all the component images for a single repository.



&lt;p&gt; &lt;/p&gt;

&lt;p&gt;We allow customizing the Dockerfiles for each of these components directly inside of the project repository, so you can tweak these builds to your liking.&lt;/p&gt;

&lt;p&gt;Both of these actions are actually open source, so check them out at our GitHub:&lt;br&gt;
👉 &lt;a href="https://github.com/diploi/action-components" rel="noopener noreferrer"&gt;diploi/action-components&lt;/a&gt;&lt;br&gt;
👉 &lt;a href="https://github.com/diploi/action-build" rel="noopener noreferrer"&gt;diploi/action-build&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;That's all we have for now! If you have any questions, feel free to leave a comment on this post 🙏.&lt;/p&gt;

&lt;p&gt;And check out our new Stack Builder directly on &lt;a href="https://diploi.com/" rel="noopener noreferrer"&gt;diploi.com&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>devops</category>
      <category>cloud</category>
      <category>startup</category>
    </item>
    <item>
      <title>How We Solved Infrastructure as Code</title>
      <dc:creator>Tuomas</dc:creator>
      <pubDate>Tue, 03 Dec 2024 09:23:38 +0000</pubDate>
      <link>https://dev.to/diploi/how-we-solved-infrastructure-as-code-2ldn</link>
      <guid>https://dev.to/diploi/how-we-solved-infrastructure-as-code-2ldn</guid>
      <description>&lt;p&gt;Infrastructure as Code (or IaC for short) has been gaining traction recently—and for good reason. It brings with it a ton of benefits, but can often be challenging to get started with. Many cloud services still lack support for it, forcing users to navigate a maze of control panels to make changes to their infra.&lt;/p&gt;

&lt;p&gt;At &lt;a href="https://diploi.com/" rel="noopener noreferrer"&gt;Diploi&lt;/a&gt;, we looked at existing solutions such as Terraform, Pulumi, AWS CloudFormation, and Azure ARM Templates but found that none fully aligned with our motto of providing a "magical development experience". While these tools are highly versatile and capable of handling almost any infrastructure configuration, they are often difficult to master and excessively verbose. Setting up a single service often requires creating multiple templates and configuration files.&lt;/p&gt;

&lt;p&gt;As that was not the developer experience we were looking for, we decided to build our own easy-to-use IaC solution.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is Infrastructure as Code?
&lt;/h2&gt;

&lt;p&gt;For developers, Infrastructure as Code (IaC) essentially means replacing cloud provider management dashboards with config files. These files contain everything necessary to replicate a specific environment, ensuring that the environment your code runs on is always set up correctly and consistently.&lt;/p&gt;

&lt;p&gt;Typically, your IaC definitions would specify the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Deployment Target&lt;/strong&gt;: Where your code will be deployed, such as AWS or Azure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Required Services&lt;/strong&gt;: The services needed to support your application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Virtual Machine Setup&lt;/strong&gt;: Configuring any necessary VMs and installing dependencies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network Configuration&lt;/strong&gt;: Setting up &amp;amp; securing the network. Provisioning domain names. Configuring DNS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Application Execution&lt;/strong&gt;: Deploying and running the application code.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Our Implementation
&lt;/h2&gt;

&lt;p&gt;We thought a lot about the best way to implement IaC into &lt;a href="https://diploi.com/" rel="noopener noreferrer"&gt;Diploi&lt;/a&gt;. Our solution had to be intuitive, developer-centric, and highly customizable.&lt;br&gt;
We settled on a &lt;strong&gt;component-based model&lt;/strong&gt; that allows users to easily configure their stack without making the config overly verbose. The more detailed config for a component, such as HELM charts and other setup files, are housed in dedicated GitHub repositories maintained by the component owners.&lt;br&gt;
However, users can also specify local path for a component, enabling custom components to be seamlessly inlined within the projects repository.&lt;br&gt;
This approach gives our users the best of both worlds: a simple, easy-to-use config combined with limitless customization options, including custom Docker files, HELM charts, and more.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;diploiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1.0&lt;/span&gt;
&lt;span class="na"&gt;components&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Next.js&lt;/span&gt;
    &lt;span class="na"&gt;identifier&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;next&lt;/span&gt;
    &lt;span class="na"&gt;package&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/diploi/component-nextjs#v0.0.1&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Local&lt;/span&gt;
    &lt;span class="na"&gt;identifier&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;local&lt;/span&gt;
    &lt;span class="na"&gt;package&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./local-package&lt;/span&gt;
&lt;span class="na"&gt;addons&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;PostgreSQL&lt;/span&gt;
    &lt;span class="na"&gt;identifier&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;postgres&lt;/span&gt;
    &lt;span class="na"&gt;package&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/diploi/addon-postgres#v17.0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
A simple Diploi config capable of replicating a complex environment.


&lt;p&gt; &lt;/p&gt;

&lt;p&gt;These simple config files, combined with our intuitive &lt;a href="https://dev.to/diploi/diploi-stack-builder-32n4"&gt;Stack Builder&lt;/a&gt;, create a developer experience within &lt;a href="https://diploi.com/" rel="noopener noreferrer"&gt;Diploi&lt;/a&gt; that is magical ✨ and unparalleled.&lt;/p&gt;




&lt;h2&gt;
  
  
  Benefits of Our Implementation
&lt;/h2&gt;

&lt;p&gt;Our implementation in &lt;a href="https://diploi.com/" rel="noopener noreferrer"&gt;Diploi&lt;/a&gt; comes with a long list of benefits, many of which are true for any IaC system. Here are some of the more interesting ones in a easily digestible list:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Versioning with Git 🌳

&lt;ul&gt;
&lt;li&gt;Maintain separate infra in different branches&lt;/li&gt;
&lt;li&gt;Diffs &amp;amp; blames for infra changes&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Self-Documenting Config Files 📝

&lt;ul&gt;
&lt;li&gt;View all infra components in a single file&lt;/li&gt;
&lt;li&gt;Clickable links to find information on each component&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Inlining Components 🏠

&lt;ul&gt;
&lt;li&gt;Include component config files directly in the local repository&lt;/li&gt;
&lt;li&gt;Permanent version pinning and customizations&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We’re still working on our system, so stay tuned for a more detailed explanation &lt;a href="https://dev.to/diploi/diploi-roadmap-for-2024-1nde"&gt;in the future&lt;/a&gt;. 😉&lt;/p&gt;




&lt;p&gt;By the way, we’re currently looking for developers to join our internal testing program. If you’re interested in trying out our version of IaC before its official release, leave a comment, and I’ll get in touch!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>devops</category>
      <category>cloud</category>
      <category>startup</category>
    </item>
    <item>
      <title>Diploi Stack Builder</title>
      <dc:creator>Tuomas</dc:creator>
      <pubDate>Wed, 06 Nov 2024 11:17:59 +0000</pubDate>
      <link>https://dev.to/diploi/diploi-stack-builder-32n4</link>
      <guid>https://dev.to/diploi/diploi-stack-builder-32n4</guid>
      <description>&lt;p&gt;In our &lt;a href="https://dev.to/diploi/diploi-roadmap-for-2024-1nde"&gt;previous blog post&lt;/a&gt; we opened up our future plans in the form of a roadmap. We also promised to write more detailed posts on each item, and this post is the first.   &lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Stack Builder?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://diploi.com/" rel="noopener noreferrer"&gt;Diploi&lt;/a&gt;, our tool to run development &amp;amp; production environments, needs to know the infrastructure for each environment. Until now, someone needed to manually create a template with example code, HELM charts, and everything else Diploi required in order to work. This was quite hard if you had never worked on HELM or Kubernetes before. We want to make it easy for everyone to build a custom tech stack in seconds, without previous knowledge of Kubernetes or Diploi.&lt;/p&gt;

&lt;p&gt;Enter the Stack Builder.&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%2Fmjldjyxj6qwr9byd1ssa.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%2Fmjldjyxj6qwr9byd1ssa.png" alt="Image description" width="800" height="667"&gt;&lt;/a&gt;   &lt;/p&gt;




&lt;h2&gt;
  
  
  How it Works
&lt;/h2&gt;

&lt;p&gt;When you open the builder, you'll get a list of official and community made stacks that are ready to use and include working example code. If you pick one of these pre-made stacks, you can still modify them with extra add-ons like databases and services.&lt;/p&gt;

&lt;p&gt;If you need more control, you can switch to a custom stack, where you may pick all the components yourself.&lt;br&gt;
For example, you could pick a stack with Node.js front-end and a Laravel backend with a PostgreSQL DB and a Redis cache. All pre-configured and ready to go with a few clicks.&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%2Fylspn3i8yyoskj1e2tve.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%2Fylspn3i8yyoskj1e2tve.png" alt="Image description" width="800" height="283"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you have made your selection, Diploi will build a monorepo for your with all the required code to get you started. With one click, you have a ready-to-go remote code environment with the stack you just built.   &lt;/p&gt;




&lt;h2&gt;
  
  
  How it Works on a Deeper Level
&lt;/h2&gt;

&lt;p&gt;As you create your stack, we compose a &lt;code&gt;diploi.yaml&lt;/code&gt; file for you. This will include all the components and add-ons for your stack, and some neat configuration to import &amp;amp; export env values and so on. This file can be updated in your code editor, and your infrastructure will automatically adapt to the changes. This means that environments in Diploi are fully configured as code.&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%2Ffmvlu1xmwsiv277x5ajp.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%2Ffmvlu1xmwsiv277x5ajp.png" alt="Image description" width="800" height="214"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we create the monorepo, we also include GitHub actions to build your components, HELM charts to run the internal Kubernetes cluster, setup the required packages for your development environment, and so on.   &lt;/p&gt;




&lt;h2&gt;
  
  
  When Can You Test It?
&lt;/h2&gt;

&lt;p&gt;We are currently working with a small internal testing group to iron out the experience. We aim to have a public beta up and running by the end of the year, so keep your eyes open!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>🗺️ Diploi Roadmap for 2024</title>
      <dc:creator>Tuomas</dc:creator>
      <pubDate>Thu, 03 Oct 2024 13:28:37 +0000</pubDate>
      <link>https://dev.to/diploi/diploi-roadmap-for-2024-1nde</link>
      <guid>https://dev.to/diploi/diploi-roadmap-for-2024-1nde</guid>
      <description>&lt;p&gt;We’ve been hard at work building &lt;a href="https://diploi.com/" rel="noopener noreferrer"&gt;Diploi&lt;/a&gt;, and now that &lt;a href="https://diploi.com/blog/diploi-received-pre-seed-funding" rel="noopener noreferrer"&gt;we got funded&lt;/a&gt; 🎉, the pace is only going to accelerate!&lt;/p&gt;

&lt;p&gt;Many of you have been asking for a roadmap, and we hear you!&lt;br&gt;
Below is a list of features, prioritized by importance, that will be coming in the near future. We will be publishing a dedicated article for each one, starting with the Stack Builder in the coming weeks.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. 🧰 Stack Builder
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A pick-and-choose-style tech stack builder&lt;/li&gt;
&lt;li&gt;Easily combine different components to create any stack&lt;/li&gt;
&lt;li&gt;Choose a pre-made stack with example code and add your own addons
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. 📝 Configuration-as-Code
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Share a Diploi project simply by sharing its repository&lt;/li&gt;
&lt;li&gt;Modify your entire infrastructure with code&lt;/li&gt;
&lt;li&gt;Easily maintain different infrastructure setups on different branches
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. 🌍 Community Stacks
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;One-click sharing of pre-made stacks with example code&lt;/li&gt;
&lt;li&gt;Access a constantly expanding library of community-made stacks for any occasion&lt;/li&gt;
&lt;li&gt;Get rewarded when your shared stacks are used by others
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. 🔮 Future
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Status monitoring, history and alerts&lt;/li&gt;
&lt;li&gt;Improved logging&lt;/li&gt;
&lt;li&gt;Cloud-agnostic deployments and self-hosting options
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;That’s a wrap for what's currently in our pipeline! 🙏 We can't wait to get these features in your hands. If you’d like to be part of a closed group of testers, let us know! We’re always looking for developers eager to try out new features.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Astro with PostgreSQL</title>
      <dc:creator>Tuomas</dc:creator>
      <pubDate>Tue, 27 Feb 2024 10:26:13 +0000</pubDate>
      <link>https://dev.to/diploi/astro-with-postgresql-1mpf</link>
      <guid>https://dev.to/diploi/astro-with-postgresql-1mpf</guid>
      <description>&lt;p&gt;&lt;a href="https://astro.build/" rel="noopener noreferrer"&gt;Astro&lt;/a&gt; is a simple yet powerful front-end framework for content-driven websites. The common way of building websites with Astro involves getting dynamic data from an external CMS or API. If you do not need a fully fledged CMS, but would still like to dynamically change some content on your Astro site, all you might need is a PostgreSQL database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;I will be using &lt;a href="https://diploi.com/" rel="noopener noreferrer"&gt;Diploi&lt;/a&gt; to bootstrap this project. Diploi comes with an Astro project and PostgreSQL DB pre-configured, so no setup required. Simply choose the "Astro" template when creating a new project.&lt;/p&gt;

&lt;p&gt;You can also follow the manual installation guide on the official Astro documentation. It can be found here: &lt;a href="https://docs.astro.build/en/install/auto/" rel="noopener noreferrer"&gt;https://docs.astro.build/en/install/auto/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In both cases, you will get an example project with a single demo page. We will continue from there.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connecting to a PostgreSQL DB
&lt;/h2&gt;

&lt;p&gt;Let's get our Astro page to talk with PostgreSQL. First thing we need to do is to install the &lt;a href="https://www.npmjs.com/package/pg" rel="noopener noreferrer"&gt;node-postgres&lt;/a&gt; (or "pg" for short) library from NPM. We will use this client to query our PostgreSQL DB.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

npm i pg
npm i &lt;span class="nt"&gt;--save-dev&lt;/span&gt; @types/pg


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If you do not plan on using TypeScript, you can leave out the &lt;code&gt;@types/pg&lt;/code&gt; package.&lt;/p&gt;

&lt;p&gt;The Diploi Astro template comes with an optional PostgreSQL database, with ENV variables pre-configured. If you are not using Diploi, you may specify different ENV variables, or handle the configuration is some other way.&lt;/p&gt;

&lt;p&gt;Here are the ENV variables Diploi gives us by default:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

POSTGRES_HOST
POSTGRES_PORT
POSTGRES_DB
POSTGRES_USER
POSTGRES_PASSWORD


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Create a &lt;code&gt;db.ts&lt;/code&gt; file in the &lt;code&gt;/src&lt;/code&gt; folder:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;pg&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Make sure we DO NOT "prerender" this function to allow the ENV variables to update on the fly&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;prerender&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;pg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;POSTGRES_HOST&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;POSTGRES_PORT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;database&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;POSTGRES_DB&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;POSTGRES_USER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;POSTGRES_PASSWORD&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This file will initialize our DB client, so we can use it in any Astro component!&lt;/p&gt;

&lt;p&gt;Let's create an example component that queries the current time from the DB. Create a &lt;code&gt;DB.astro&lt;/code&gt; file in the &lt;code&gt;/src/components&lt;/code&gt; directory:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

---
import { db } from '../db';

const { rows } = await db.query('SELECT NOW() as "time"');
---

&amp;lt;time&amp;gt;{rows[0].time}&amp;lt;/time&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This component will connect to the PotsgreSQL DB, query the current time with &lt;code&gt;NOW()&lt;/code&gt;, and finally render it on the page!&lt;/p&gt;

&lt;p&gt;Try it out by adding it to the &lt;code&gt;/src/pages/index.astro&lt;/code&gt; page. At the top, import the component with:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;DB&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../components/DB.astro&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And then include it anywhere on the page with:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;

&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;DB&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Wherever you placed you component, you should see a timestamp that updates on each page load!&lt;/p&gt;

&lt;h3&gt;
  
  
  That's It?
&lt;/h3&gt;

&lt;p&gt;You can see how simple it is to talk to the DB directly, no HTTP API needed! This way you could use your PostgreSQL DB as a simple CMS, or just have some information easily changeable without code changes.&lt;/p&gt;

&lt;p&gt;This data is not as dynamic as it may seem though. In development mode, Astro will query this data every time the page is loaded. In production, however, Astro will create a static build that will not query the DB on every page load. It only queries it once when the production build is made. If you do need the data to be updated dynamically, you can do so by enabling the fairly new SSR support in Astro.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enabling SSR in Astro
&lt;/h2&gt;

&lt;p&gt;SSR, or server-side rendering, means on-demand rendering on the server when a page is requested. This means that Astro will not build a static HTML version of your entire site, but acts more like a PHP server that builds the page on-demand when a user visits it.&lt;/p&gt;

&lt;p&gt;On Diploi, the only change you have to make is a single line in your &lt;code&gt;index.astro&lt;/code&gt; page:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;prerender&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fpmiehhnid91l30139l6w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fpmiehhnid91l30139l6w.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By exporting this line right after any &lt;code&gt;import&lt;/code&gt; statements, we tell Astro to opt this page out of static rendering, and to render it on demand whenever a client requests it.&lt;/p&gt;

&lt;p&gt;If you are not using Diploi, you will have to configure an SSR adapter for your Astro project. You will find a guide to do so in the official Astro documentation at &lt;a href="https://docs.astro.build/en/guides/server-side-rendering/" rel="noopener noreferrer"&gt;https://docs.astro.build/en/guides/server-side-rendering/&lt;/a&gt;..&lt;/p&gt;

&lt;h2&gt;
  
  
  Diploi?
&lt;/h2&gt;

&lt;p&gt;I have mentioned &lt;a href="https://diploi.com/" rel="noopener noreferrer"&gt;Diploi&lt;/a&gt; quite a few times in this blog post. Diploi is a single SaaS service for managing, developing and hosting your full application. We have been building Diploi for a while now, and would love for you to have a go (for free of course)!&lt;/p&gt;

&lt;p&gt;Trying new frameworks is as-easy-as clicking a single button on Diploi, so you can focus on the fun parts, not the setup.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://diploi.com/launch/astro" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdiploi.com%2Flaunch-template-button.svg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check us out at &lt;a href="https://diploi.com" rel="noopener noreferrer"&gt;https://diploi.com/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>astro</category>
      <category>postgres</category>
      <category>diploi</category>
    </item>
  </channel>
</rss>
