<?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>Forem: electrocnic</title>
    <description>The latest articles on Forem by electrocnic (@electrocnic).</description>
    <link>https://forem.com/electrocnic</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%2F86431%2F489c2631-7c6c-4f4e-9229-97a09719e8c9.jpeg</url>
      <title>Forem: electrocnic</title>
      <link>https://forem.com/electrocnic</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/electrocnic"/>
    <language>en</language>
    <item>
      <title>Vue3 (Vite) + Django 5 DevOps Boilerplate Template for Gitlab CI/CD</title>
      <dc:creator>electrocnic</dc:creator>
      <pubDate>Mon, 01 Jan 2024 14:35:08 +0000</pubDate>
      <link>https://forem.com/electrocnic/vue3-vite-django-5-devops-boilerplate-template-for-gitlab-cicd-4jol</link>
      <guid>https://forem.com/electrocnic/vue3-vite-django-5-devops-boilerplate-template-for-gitlab-cicd-4jol</guid>
      <description>&lt;p&gt;A few years ago, I already published a short article about a Vue+Django boilerplate template for Gitlab CI/CD.&lt;br&gt;
&lt;a href="https://dev.to/electrocnic/vue-django-development-and-continuous-integration-and-continuous-deployment-ci-cd-for-vue-django-4e31"&gt;https://dev.to/electrocnic/vue-django-development-and-continuous-integration-and-continuous-deployment-ci-cd-for-vue-django-4e31&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This template is all about the DevOps behind your Webapp: Tooling and versioning for the development, debugging and automated testing and deployment. Including SEO stuff like prerender, or nginx configuration for https and even a test domain deployment where you can test your production-ready website on the server, without really releasing it yet.&lt;/p&gt;

&lt;p&gt;I updated this Gitlab project to Vue3+Vite+pinia (instead of webpack and vuex), Django 5 and made it a bit less cloaky, utilizing Docker's multistage builds and the new Docker buildx (which is used automatically now on gitlab runners anyways, but made sure that the pipeline still works).&lt;/p&gt;

&lt;p&gt;The pipeline is configured in a way, that base docker images are cached and only rebuilt if base dependencies change. My pipe runs through in about 15 minutes, and the website is deployed.&lt;/p&gt;

&lt;p&gt;The initial setup and understanding of the repo will take a while. 2 hours is a good amount of time, needed to setup a working fork with your own deploy server and your own domains for your app.&lt;/p&gt;

&lt;p&gt;In fact, I had the feeling, that no tutorial ever really talked in depth about the immense workload and knowledge needed for the DevOps setup behind a simple WebApp. It feels like this is 90% of the effort for a small static Vue Website, and probably still 50% of the effort for a middle sized Website with Backend features.&lt;/p&gt;

&lt;p&gt;The difficulty comes from the need to be able to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Develop:

&lt;ul&gt;
&lt;li&gt;On Windows locally&lt;/li&gt;
&lt;li&gt;On Linux locally&lt;/li&gt;
&lt;li&gt;On Windows in Docker&lt;/li&gt;
&lt;li&gt;On Linux in Docker&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Test and Debug locally and on the production server (once served via nginx and https and through the nginx proxy so):&lt;/li&gt;
&lt;li&gt;so you are able to host multiple different apps on the same server but with different domains&lt;/li&gt;
&lt;li&gt;Test in CI/CD&lt;/li&gt;
&lt;li&gt;Test a test-deployment manually, without interfering with the currently hosted production app.&lt;/li&gt;
&lt;li&gt;Deploy automatically.&lt;/li&gt;
&lt;li&gt;Have a reproducible build over years, by fixating all dependencies (now even fixated python, npm, pdm, node versions to be able to rebuild an outdated app after years (hopefully)).&lt;/li&gt;
&lt;li&gt;Have SEO features: Crawlers use the content which they get in the first response of the website. An SPA application like commonly made with Vue will deliver an empty page in the first few milliseconds until Vue injects the actual content live. The crawlers would therefore not index the pages correctly. Prerender is utilized for that. Crawlers will get a statically prerendered version of the website, to index it properly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tests are currently deactivated in this repository, I think the experienced user will have no troubles to reactivate and adapt them to their needs on their own.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gitlab.com/electrocnic/vue3-django-ci-cd-boilerplate"&gt;https://gitlab.com/electrocnic/vue3-django-ci-cd-boilerplate&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Vue Django Development and Continuous Integration and Continuous Deployment (CI/CD for Vue+Django)</title>
      <dc:creator>electrocnic</dc:creator>
      <pubDate>Wed, 11 Mar 2020 21:50:16 +0000</pubDate>
      <link>https://forem.com/electrocnic/vue-django-development-and-continuous-integration-and-continuous-deployment-ci-cd-for-vue-django-4e31</link>
      <guid>https://forem.com/electrocnic/vue-django-development-and-continuous-integration-and-continuous-deployment-ci-cd-for-vue-django-4e31</guid>
      <description>&lt;p&gt;So I made a gitlab repo which has some basic code for a Vue frontend and a Django backend. CI/CD is the focus of this setup. If you are looking for a way to be able to develop such an app on your local machine, but still deploy it regularly with docker, isolated from your local machine, and maybe also run tests on a gitlab CI pipeline, you might be interested in my repo: &lt;a href="https://gitlab.com/electrocnic/vue-django-ci-cd-boilerplate"&gt;https://gitlab.com/electrocnic/vue-django-ci-cd-boilerplate&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is for users who are just starting with a new project.&lt;/p&gt;

&lt;p&gt;It has still quite some room for improvements, for example, the secrets could be passed with the new docker feature --secret.&lt;/p&gt;

&lt;p&gt;Also, it needs the privileged mode and produces quite large docker images in quite a lot of build-time. This could be improved.&lt;/p&gt;

&lt;p&gt;If you are fine with that though, you can fork it, experiment with it, have fun with it. However, I do not guarantee for anything, this is just a project for my personal requirements, but I thought, it could be helpful for others as well.&lt;/p&gt;

&lt;p&gt;The app supports to deploy multiple different apps on the same server, when they are all based on this boilerplate template.&lt;/p&gt;

&lt;p&gt;It is based on &lt;a href="https://github.com/NdagiStanley/vue-django"&gt;https://github.com/NdagiStanley/vue-django&lt;/a&gt; and makes use of some third-party repos like &lt;a href="https://github.com/nginx-proxy/nginx-proxy"&gt;https://github.com/nginx-proxy/nginx-proxy&lt;/a&gt; and &lt;a href="https://github.com/nginx-proxy/docker-letsencrypt-nginx-proxy-companion"&gt;https://github.com/nginx-proxy/docker-letsencrypt-nginx-proxy-companion&lt;/a&gt; and &lt;a href="https://github.com/zenhack/simp_le"&gt;https://github.com/zenhack/simp_le&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first-time setup of your own gitlab ci/cd pipeline after you forked it, will take approximately 1 hour, due to the fidely work with the variables in the gitlab settings and badge-links.&lt;/p&gt;

&lt;p&gt;Have fun!&lt;/p&gt;

</description>
      <category>vue</category>
      <category>django</category>
      <category>ci</category>
      <category>cd</category>
    </item>
  </channel>
</rss>
