My Ghost Journey: From Learning Japanese to a 100% Serverless Architecture with Cloudflare

Hey, Ghost community!

I wanted to share a personal project that has Ghost at its core, but is surrounded by a serverless architecture that turned into a really fun experiment.

It all started a few months ago when I set myself the challenge of learning Japanese :japan:. The problem was, I couldn’t find a platform with a unified, progressive study method. As an IT enthusiast, my first reaction was, ā€œI’ll build it myself.ā€ This led me to create my own platform, aprendejapones.es. My initial plan was just to use a simple Ghost blog for my notes.

…But I got carried away, and the project quickly escalated into a full-blown serverless laboratory, orchestrated with Cloudflare.

I’m sharing the stack in case it inspires anyone or just satisfies some technical curiosity.

Here’s a breakdown of the architecture:

1. The Core: Dockerized Ghost + Cloudflare Edge The foundation is a Ghost CMS blog, which I have running in a Docker container deployed on Azure. I also developed a custom theme from scratch. For extreme performance, all traffic is routed through Cloudflare, where very specific Cache Rules serve the content directly from the edge. Getting this to work smoothly with Ghost’s native behavior was quite tedious, but the TTFB I achieved is minimal!

2. SEO/Traffic Strategy with a Next.js ā€œSidecarā€ This is where I started experimenting. I created a secondary website with Next.js (deployed on Cloudflare Pages). With each build, it consumes the Ghost API and generates summary pages (indexes, topic lists, etc.) that link back to the full content. This way, I create quality internal backlinks and a new traffic channel without creating duplicate content, as it only displays short excerpts.

3. Custom AI for Studying (OpenAI GPT) I set up a Custom OpenAI GPT that is fed with my notes via a custom-built API. I can ask it questions about what I’ve studied, and it provides answers in real-time based solely on my blog’s content. It’s a game-changer for revision.

4. The Automation ā€˜Magic’: Cloudflare Workers This is where most of the automated logic lives:

  • Auto-Redeploy: A Worker listens for new posts in Ghost and automatically triggers a rebuild and deployment of the Next.js site on Cloudflare Pages.
  • Smart Cache Purge: Another Worker is responsible for purging the global Cloudflare cache, but only for the content that has actually changed.
  • Vocabulary API: For quizzes and exercises, a Worker serves vocabulary terms and definitions at lightning speed from Cloudflare KV.
  • Microservices with a Database: Several Workers act as a mini-backend, connecting to a Cloudflare D1 database to securely and efficiently manage specific web functionalities.

5. Social Media Distribution with Make.com To complete the cycle, my Workers send webhook notifications to Make.com. There, workflows use OpenAI to generate creative social media posts based on new blog articles and then publish them.

This project has been the perfect excuse to do a deep dive into serverless architectures and to push the boundaries of what Ghost and Cloudflare can do together.

I’d love to hear what you all think of this setup. Has anyone else experimented with such deep integrations around Ghost using Workers, D1, or Pages?

Any feedback, questions, or suggestions are more than welcome.

Cheers!