Integration Module 2.0 for Medusa is outRead the announcement

Astro Storefront for Cloudflare Workers

by Digity Studio

A storefront for Medusa v2 built with Astro, React, and Tailwind CSS v4 and deployed to Cloudflare Workers. Product pages, the catalog, and the landing page are generated at build time, and Medusa webhooks trigger a redeploy when products change. The cart, the navigation, and the multi-step checkout with Stripe load as React islands, and stock is refreshed in the browser. The repository holds the storefront only, so you run your own Medusa backend.

Astro Storefront for Cloudflare Workers
Built by
Digity Studio
Type

Astro Medusa Storefront

A blazing-fast, open-source ecommerce storefront built with Astro, React, and Medusa v2 — deployed to the edge on Cloudflare Workers.

Static-first architecture. Interactive where it matters. Zero compromise on performance.

Tech Stack

LayerTechnology
FrameworkAstro 6 — static HTML, islands of interactivity
UIReact 19 — only where you need it
StylingTailwind CSS v4 — zero-config Vite plugin
BackendMedusa v2 — headless commerce engine
PaymentsStripe — secure checkout
StateNanostores — tiny, framework-agnostic stores
FormsReact Hook Form + Zod validation
DeploymentCloudflare Workers — edge-first

Architecture

Static where possible, dynamic where necessary:

  • Product pages, store listing, and landing page are statically generated at build time
  • Medusa webhooks trigger a re-deploy when products are created, updated, or deleted — keeping static pages in sync
  • Product variant availability is refreshed client-side to prevent stale inventory data
  • Cart, checkout, and navigation hydrate as interactive React islands
  • Middleware handles region detection and country-based routing
  • Cart state persists client-side via Nanostores +

Pages

RouteDescription
Landing page
Product catalog
Product detail with image carousel
Shopping cart
Multi-step checkout (address, shipping, payment)
Order confirmation

All routes are prefixed with an ISO-2 country code for region-based pricing and shipping.

Getting Started

Prerequisites

Setup

Fill in your :

Make sure your Medusa backend has CORS configured to allow requests from your storefront origin.

Development

Production

Project Structure

Key Design Decisions

  • Islands architecture — React only loads for interactive components (cart, nav, checkout). Everything else ships as zero-JS static HTML.
  • Real-time inventory checks — Product variant stock data is fetched client-side on page load, ensuring accurate availability even though pages are statically generated.
  • Edge deployment — Cloudflare Workers adapter means your storefront runs close to your customers, everywhere.
  • Tailwind v4 — No config file. Theme customization lives in CSS with . Powered by the Vite plugin.
  • Region-aware routing — Country code in the URL drives pricing, currency, and available shipping options — all resolved via Medusa regions.

License

MIT

Author

Michal Bystryk — digity.studio · LinkedIn

Work with me

Need a custom storefront, a Medusa integration, or help shipping an ecommerce project? I build them at digity.studio — get in touch.