Astro on Cloudflare 🚀


I recently discovered the Astro web framework and love working with it. I’m just building static websites for now, but it has the potential for those to evolve into full-stack applications with various integrations. It’s a great framework to prototype with and then continue using as your application dependencies grow.

Check out Astro DB, a fully managed SQL database service they recently released!

For this website, I ran npm create astro@latest and selected the blog template. I modified that to suit my style and started a base template for myself. I’m going to migrate a few websites over to it, then release the template as an open source project with whatever Astro components I create.

I’ve noticed the lack of component libraries for Astro, which is another project I would like to work on. While it’s possible to use various UI frameworks within the same Astro project, I have the desire to build fully customizable Astro components using pure HTML, CSS, and JavaScript.

There are only two projects that I’ve been able to find with Astro-only components:

AgnosticUI appears to be working on Astro support, which is great! However, check out everything available for React. My goal is to help develop and maintain resources for the growing Astro community.

Content management

Astro content collections make it simple to use a text editor with Markdown to author content for your website. Working by myself, that’s all I really need.

For future use with clients, I have my eye on Keystatic and KeystoneJS, both open source and created by Thinkmill. Each CMS requires a server-side rendering (SSR) adapter for the Astro project.

KeystoneJS requires a database, which I’ll test out with Astro DB and maybe Cloudflare D1.

Astro has many other CMS options available.

Cloudflare Pages

Since I use Cloudflare for domain names and DNS services, it made sense to try Cloudflare Pages for hosting my domains. It works similar to Netlify, Render, or Vercel, by deploying projects from GitHub.

Both Astro and Cloudflare support this deployment, with the ability to enable dynamic content with Workers. It’s worth noting, that means developing specifically for Cloudflare’s platform, although most providers are like that.

However, Astro supports many deployment options to suit your use case and preferences.

While I’m just getting started with it, I think Cloudflare works great for sites built with Astro!

Let’s see how far we can scale with them. 🚀