New rebel blog

New rebel blog

tech

So, I decided to create a new, simplified version of my webpage. It may sound ridiculous, because as a software engineer specialized in frontend and UI this page should be full of shiny, new things, fancy animations etc. Kinda like my previous web page, I think I'll keep it under old.dawiid.io subdomain, because I still like it. So, why simplified and why I'm getting rid of page I like? Two things:

  • I wanted to focus more on content and needed some nice editor and cms where I can easily create and edit posts using markdown, couldn't find any matching my needs and decided to create a very simple, yet powerful custom solution. I think I'll open source it soon.
  • I'm getting tired of cloud providers. Furthermore, Ilooked at my billings, and I've been spending too much on simple solutions! Before, I used some DigitalOcean app, but later, when I wanted to add some cache for images, it turned out that I need database or file system. Of course, you have no access to fs, why would application need access to fs in 2024? So, database. Sure, you can add some db for extra money. I thought maybe I'll move to Supabase, since I like Postgres and Supabase products are pretty nice. I quickly started developing this new blog on supa, I used image server to serve blog assets. But, when time of deploy came, it also came out that in Supabase, you must have at least pro plan to be able to use image server. Yet more money, weee! And of course when you need backup, another cache etc. you must pay more and more money.

Here I am, mad at cloud providers, decided to simplify all of this shit show. I thought - what do you need for simple blog with online editor? File system. This blog operates only on files. Posts are mdx files, so I can even render React components inside of them, posts are organized in directories, in each post directory you will find mdx file and all its assets like images, videos or audio. Images were tricky, first I wanted to use remix-image package, later it came out that it is a bit outdated and probably abandoned (dangling issues, no updates for ~2 years), it also uses database, and I was already in this mindset that I want to keep it stupid simple (KISS). Now images are handled by my custom image endpoint that is universal and can do some resizing, parsing and formatting. Cache for images is also based on file system, once generated image will be later saved as a file and won't be generated again. Cache does not use any db, actually some consistency and naming convention was enough. Files in cache are named like width_x_height_quality_..._originalName.format so later I can match them easily with params. I bought some VPS with SSD disk, so R/W operations are relatively fast. And let's be honest, I'm not building another Google, I will not handle massive loads of users, so I actually don't need fancy CDN's, caching near user (besides browser cache) and all that stuff.

Digression: I think in IT industry we follow hype too much. We use Docker, Kubernetes, Next.js, Service Workers, all that cloud services like S3, SQS etc. just to set up simple webpage. Later I see people saying that IT is overwhelming, sure it is, but we are doing it to ourselfs. Of course, it is also fueled by companies and their greed, but I'll cover it in separated post.

Maybe I'll say it out loud, just to keep it clear. I'm not saying cloud is bad, I'm saying that we use things without thinking. We don't think about needs, we do not estimate, we do not plan. We just use. Instead of focusing on real value, people tend to focus on tech stack too much and they design unstable giants.

Okay, let's get back to the topic. I covered images and simple posts solutions, I also broke some rules of frontend world - I decided to create more global styles. I have some css modules for encapsulation and convenience, but the vast majority of styles looks like this:

:root {
	--font-size-body1: 1em; 
	/* some other variables */
}

p, li {
	font-size: var(--font-size-body1);
	/* other styles */
}

h1 {
	/* other styles */
}

.card {
	/* other styles */
}

It helped me in admin panel, because content I design and preview there looks exactly like how it will look on the front page without any additional effort.

Styles encapsulation is good in bigger systems, where you use 3-party UI components or collaborate with a lot of people, to avoid collisions. In small projects like mine, I have more profits from global styles.

Okay, I'm saying a lot about what did I wrong (on purpose), or why I wanted to simplify things, but does this blog have something interesting? Integration with AI, but not for post content! I like my mistakes, and my style, it makes it original even if it is not ideal, I also don't something (AI) to disturb me with its own ideas while I'm writing. With my ADHD it is more like flow killer than something really helpful. So, no AI for post writing process, but there is AI for tedious jobs like writing description for OG tags (what you can see in social media when you share my posts), generating tags, summarization, there is automatic og image generation etc. In future, I want to add integration with social media, since I'm not using them daily, I would like to be able to post something on my blog and later automatically post it on my sm accounts, without the need to breaking my social media rehab.

Also, this is an important part behind this blog. I wanted to have some space to share my thoughts, but away from sm crowd and big tech platforms. I like to host my own content.

Images

I also decided that all post cover images on blog will be main. Maybe it will be motivating to dust off my camera. As for now I'll use older photos, without any special corelation with post topic and photo. Kinda like O'Reily and their book covers.

Final words

I think I forgot about some things I wanted to write here, but still I think there are a plenty of reasons, broken rules and ideas I wrote about. I call it rebel blog - let it be my field to experiment and play with technologies, without the glamour and infliction today's tech requires.