How I Built My Blog The author describes rebuilding their personal blog using a complex technology stack including Next.js, React, and MDX, despite acknowledging it may seem like overkill for a blog. They chose MDX for content management because it allows embedding custom React components within Markdown, enabling interactive widgets in blog posts. The article explains their workflow of editing MDX files directly in VS Code and committing them as code, while noting the trade-off of needing to redeploy the entire app to fix typos. Over the past few months, I’ve been working on a brand new version of this blog. A couple of weeks ago, I flipped the switch Here’s a quick side-by-side: Blog Homepage Old Blog Homepage New From a design perspective, it hasn’t changed too much; I like to think that it’s a bit more refined, but the same general idea. Most of the interesting changes are under-the-hood, or hidden in the details. In this blog post, I want to share what the new stack looks like, and dig into some of those details Over the years, my blog has become a surprisingly complex application. It’s over 100,000 lines of code , not counting the content. Migrating everything over was a big project, but super educational. I’ll share my honest thoughts on all of the new technology I used for this blog. If you’re planning on starting a blog yourself, or are thinking about using some of the technologies I’m using, this post will hopefully be quite helpful Link to this heading the-core-stack-1 The core stack Let’s start with a quick list of the major technologies used by my blog: Next.js https://nextjs.org/ v15.0.0 beta React https://react.dev/ v19.0.0 beta MDX https://mdxjs.com/ v3.0.1 Linaria https://linaria.dev/ v6.1.0 Shiki https://shiki.style/ v1.17.7 Sandpack https://sandpack.codesandbox.io/ v2.13.8 React Spring https://react-spring.io/ v9.7.3 Framer Motion https://www.framer.com/motion/ v11.2.10 MongoDB https://www.mongodb.com/ v6.5.0 TypeScript https://www.typescriptlang.org/ v5.6.2 PartyKit https://www.partykit.io/ v0.0.108 This list probably seems like overkill for a blog, and a few people have asked me why I didn’t opt for a more “lightweight” alternative. There are a few reasons: - All of my blog posts are written using MDX, so I needed first-class MDX support. - My other main project, my course platform, uses Next.js. I wanted as little context-switching friction as possible. - I wanted to get a bit more experience with the latest React features, things like Server Components and Actions. If it wasn’t for reasons 2 and 3, I probably would have given Astro opens in new tab https://astro.build/ a shot. I’ve also been curious about Remix opens in new tab https://remix.run/ for a long time I think both are likely fantastic options. Link to this heading content-management-2 Content management I write blog posts using MDX. It’s probably the most critical part of the tech stack for me. If you’re not familiar with MDX, it’s essentially a combination of Markdown and JSX. You can think of it as a superset of Markdown that provides an additional superpower: the ability to include custom React elements within the content. With MDX, I can create interactive widgets and drop ‘em right in the middle of a blog post, like this: Taken from my blog post, An Interactive Guide to Flexbox /css/interactive-guide-to-flexbox/ . This ability is crucial for the sorts of content I create. I didn't want to be limited by the standard set of Markdown elements links, tables, lists… . With MDX, I can create my own elements It feels so much more powerful than traditional Markdown, or rich-text content stored in a CMS. You might be wondering: Why not go “full React”, and skip the Markdown part altogether? When I built the very first version of this blog, way back in 2017, that’s exactly what I did. Each blog post was a React component. There were two problems with this: - The writing experience was awful. Having to wrap each paragraph in a