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 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
| Layer | Technology |
|---|---|
| Framework | Astro 6 — static HTML, islands of interactivity |
| UI | React 19 — only where you need it |
| Styling | Tailwind CSS v4 — zero-config Vite plugin |
| Backend | Medusa v2 — headless commerce engine |
| Payments | Stripe — secure checkout |
| State | Nanostores — tiny, framework-agnostic stores |
| Forms | React Hook Form + Zod validation |
| Deployment | Cloudflare 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
| Route | Description |
|---|---|
| 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
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.

