I created my own blog platform with Next.js, GitHub Issues and OpenAI in 2 days
Tags: nextjs, react, webdev, typescript
Published: 2023-01-02 16:59:23

---
title: I created my own blog platform with Next.js, GitHub Issues and OpenAI in 2 days
published: true
description: 
tags: nextjs, react, webdev, typescript
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fcejc7p2ge9lf8ltux1v.jpg
---

## What happened?
Those who know me (or have been following me for a while) know that I love writing. I find it a liberating experience, and it has enormously helped me sort and then consolidate thoughts in my head for years. I am okay with it if no one reads my content; for me, this is more of a _learning in-public_ exercise, and somehow I consider my blog posts as personal rants sometimes! Yes, [I write a lot](https://dev.to/peibolsang), to the extent that I have compiled years' worth of personal notes while I worked on an incredibly challenging cloud product and published them as a book (go check out [Building Software Platforms!](https://leanpub.com/software-platforms))

For a while now, I have been considering running my own blog as an investment in my personal branding. Note that I said "running," not "hosting." As you know, I am a firm believer in SaaS, frontend cloud platforms, serverless, and everything that distills the spirit of treating software as a liability. In part because I am a terribly bad programmer 😇.

I find modern blogging platforms very compelling, but as I said, I wanted to double down on my personal branding without entering into too much development and maintenance costs. It's a sound tradeoff for someone like me, isn't it? [I considered some options in the past using GitHub Gists](https://twitter.com/peibolsang/status/1387894516108103681?s=20&t=GYPC-f0Tt-sr7iSz4dH9lA) but it was [this post from Swyx that really triggered my curiosity](https://twitter.com/swyx/status/1480356418817753088?s=20&t=GYPC-f0Tt-sr7iSz4dH9lA). Yes, using GitHub issues as a CMS and building a small frontend on top sounds like an endeavor I can afford!

## How did I do it?
First of all, being a terribly bad programmer as I am, I wanted to minimize damage and use a stack that maximizes the developer experience. For me, a good developer experience provides the tools that create spaces for you to focus on fixing the business problem at hand. It's not about magic tools that do hundred of things. That's why the following stack fits the bill for me:

-  **GitHub Issues as CMS** 📚. GitHub's Issue management system gives me all I need to create and manage content behind the scenes. I am very familiar with it, and it's easy to use, widely adopted, and has an out-of-the-box API with a good free tier. It's just perfect!
-  **Next.js with the Blog template** ✍🏻. My new blog site is leaning heavily on this template, and I only added a few new types, components, and UI functionality to fetch data from GitHub through its API, such as issues (as posts), comments, and reactions. Of course, it's a statically generated site, but I have used [Incremental Site Regeneration](https://nextjs.org/docs/basic-features/data-fetching/incremental-static-regeneration), so new issues created in GitHub Issues show up as blog posts after a very short while. It's just perfect **and lightning fast**
- **Typescript** 💻. I feel very comfortable programming with types. I think it forces you into a kind of healthy DDD thinking and way of programming.
- **Vercel as frontend platform** 🚀. [Nothing to add, you know I am in love with Vercel](https://peibolsang.vercel.app/posts/2)
- **OpenAI** 🤖.

Wait, OpenAI? For what? Well, building the whole new site took me about two (2) days. Seriously. It may not sound like a lot to you, but it's a remarkable achievement for someone like me who does not code daily. I have used it extensively to customize the app created from the Next.js template, and ChatGPT helped me immensely to write Tailwind, Typescript, and other Next.js code when I hit a wall. This was one of the main reasons I wanted to build my own site: with this tool, I felt capable of doing something like this in a reasonable time for the first time in a while.

But there is more. Do you see the post excerpts on the landing page? **I have used OpenAI API to generate these summaries of my blog posts and add them as excerpts**. I am just testing this feature, and I believe this is going to work for a while until OpenAI starts to charge me. At that moment, I will probably replace this functionality with a dumb excerpt generator.

## What's next?
I am super happy with the result and super proud of my work (or should I say AI's work?). I think this is a good MVP, but I can think of a few features down the road:

- Better responsiveness for certain pages
- Hashtags and search
- Dark mode
- .... 

And probably nothing else? This is a blog site, so I don't want features creeping over here. I want it to be fast, and I want it to be simple. And so far, this is what I have done. 

I think I'm going to give it a try for a long while!


_(Cover photo credits: Andrew Neel via Unsplash)_