2023-12-2

Migrated to Astro + vercel

Table of Contents

How it started

I started this site around 2016 with Wordpress + MySQL, but since that time I have been frustrated with adding and modifying pages and having too many settings for a single page to begin with.

One day, after thinking about moving to a new server for the first of several times, I decided it was time to get rid of Wordpress and the old-style MySQL + PHPMyAdmin.

It was December 2021, and I decided to build a React app with Azure Static App and Azure Function to develop my own version of Wordpress.

I stored the text in Azure CosmosDB, images and videos in Azure Blog Storage, got used to learning React from scratch, and finally completed and published the app at the end of 2022, one year later.

Why didn’t I choose AWS?

Why did I not choose AWS? The reason is simple. Azure is cheaper.

As a result, it only cost us about 300 yen per month. It can be said that we have so poor access that we can’t even earn that much with advertisements.

Another deciding factor was that Azure called me the day after I created my Azure account and politely explained the implementation to me.

However, as I soon found out, Azure’s documentation was the exact opposite of their friendly phone support. It was not because of the machine translation. The original text was confusing. The active directory has now even been renamed, and in the end it remained fuzzy in my brain until the very end.

Why a cloud app with React?

The reason why I spent a year learning useState and useEffect for a mere 40 pages of content is because I didn’t want to write PHP.

SQL is good. The language is mathematical and clean. But I can’t stand having to write PHP just to get the results into an application. The statements are not like any other language, yet there is no structure or functionality. A function app can take the place of dozens of lines of PHP with a single line. There is no reason to hesitate to use it.

Cloud apps here are Static Web Apps, or static apps in Azure, which will become popular around 2020. If combined with an API called a function app, you only need to pay for the time it runs. Since the site is a hobby by nature, it should not be associated with the pain of writing PHP or heavy billing.

So why stop with the cloud app?

The total amount of node packages installed during development is 1GB, and since there are packages for most of the functions I need, I end up doing npm i just to use the SNS icons because it’s easy. And package.json increases.

Just when I was wondering why I had to deal with such a large amount of code for a site of only 40 pages or so, Astro appeared. This rewrite is due to Astro and vercel. It’s the right website development environment that we earthlings have finally arrived at. The fact that I am writing a sentence with a simple addition of first.mdx in the repository is proof of this. Now I can write notes calmly for a while.

https://docs.astro.build/ja/getting-started/ https://docs.astro.build/ja/guides/integrations-guide/vercel/#why-astro-vercel

I will release the blog part of this site to GitHub in the near future. I am sure that Astro will soon leave for space, and the earth will start going round and round again. Before that.