Stijn Dekker

AI built my own CMS

monitor.png

Once again, I built my own Content Management System / Static Site Generator for this "open collection of personal notes". This time I got help from Cursor, an AI-powered IDE.

And I think I just might keep what we have created.

From handcrafting to Handcrafting

The day I discovered I could move an entire chat window with the <marquee> tag in the "Amstel Chatbox," as a kid, I became fascinated with HTML. I built my first websites using Microsoft Frontpage and Macromedia Dreamweaver and after a while I began hand-coding clean HTML and CSS.

When people asked me to build websites for them, I quickly realized I needed a tool that allowed them to update their own digital content. After completing a number of WordPress projects, I landed a job at a non-profit organization that used Drupal for content management. Over time, I learned to both love and hate maintaining and developing sites with this open source CMS framework.

For my personal place on the (indie) web, I tried setting up a Drupal blog. However, Drupal never seemed to fit comfortably. Its admin interface, complicated file structure, and fine-grained user and permissions system always felt excessive for something a simple "collection of public notes" or a blog. WordPress, on the other hand, felt bulky and overly commercial. So, I returned to completely "handcrafting" my website, using simple HTML and CSS — just like in the old days. After posting a few articles, I decided to automate a bit using basic PHP to include recurring components like the header and footer.

And along came AI

Since the public release of OpenAI's ChatGPT, I’ve been fascinated by the ability of large language models (LLM) to rapidly generate code. It brought back to me the magical feeling I had with that first <marquee> and <blink> tags from the nineties. Just a couple of words to make something happen inside that humming machine in front of me.

It inspired me to build a simple static site generator. However, copying and pasting snippets by hand quickly became time-consuming. Moreover, the AI’s lack of understanding of the relationships between various functions led to frequent errors. What had initially seemed like an easy-to-use command-line tool became a frustrating and cumbersome project. Debugging the messy codebase grew tedious, and eventually, I abandoned personal blogging for a while.

Then I discovered Cursor AI — an IDE with integrations for differen LLM's like Claude 3.5 and ChatGPT built into its interface. This tool provides the codebase you are working on as context for the prompts you write. As a result, the LLMs have a detailed understanding of the relationships between files and functions. The prompts mostly return working code and solutions to tasks — and they respond well to feedback! With my rudimentary programming and (a bit more advanced) debugging skills, I managed to rebuild my idea for a file-based CMS with static site generation.

The result is a fully working CMS/SSG prototype. It cost me just a couple of my quiet evenings during my christmas holiday. I’ve named it "Phublish". It works quite well for me and I tested it with nearly a thousand posts and that still builds fast, so if figured it might work for others too. Therefore* I’ve released it under an open-source license.

You can find it all on Github. I'd love to hear some feedback!

*) I think this should be the standard for nearly AI-generated code, as we are building with the collective knowledge of the world.