Canopy & Clay: Botanical Storefront & Interactive Client Cart
An artisanal botanical storefront engineered with Next.js static edge rendering and zero-latency client-side shopping cart state.
Performance
100/100 Vitals
UX Architecture
Instant Cart
Infrastructure
$0 / Month
Monstera Plant
Cart (1 Item) • $48
Most e-commerce storefronts suffer from a fundamental engineering flaw: every time a customer clicks "Add to Bag" or changes a filter, the browser triggers a blocking server round-trip.
For Canopy & Clay, an artisanal plant and ceramics storefront, the goal was to eliminate this friction entirely. I engineered a static-first e-commerce architecture that renders product catalogs in sub-100ms and processes shopping cart interactions directly in client-side browser memory.
The E-Commerce Performance Crisis
Traditional platforms like Shopify or WooCommerce rely on dynamic server rendering for product catalogs. While flexible, this introduces several critical performance liabilities:
- Time to First Byte (TTFB): Dynamic servers must query a database for every page request, adding 500ms to 2,000ms of initial delay.
- Layout Shifts (CLS): Heavy third-party apps and late-loading tracking scripts cause content to jump around as the page renders.
- Mobile Connection Latency: On spotty 4G/5G mobile connections, server round-trips for simple cart updates cause user frustration and abandoned sessions.
"If an e-commerce site takes longer than two seconds to react, over 50% of mobile shoppers bounce before seeing your checkout page."
Client-Side State Architecture
Rather than sending a POST request to a server when a user clicks "Add to Bag", Canopy & Clay uses an optimized React context store with browser storage persistence.
By managing cart state locally, I ensured the interface reacts instantly at a solid 60fps.
// Client-Side Cart State with Browser Storage Persistence
export function CartProvider({ children }: { children: React.ReactNode }) {
const [cart, setCart] = useState<CartItem[]>(() => {
if (typeof window === "undefined") return [];
const saved = localStorage.getItem("canopy_cart");
return saved ? JSON.parse(saved) : [];
});
const addToCart = (product: Product) => {
setCart((prev) => {
const existing = prev.find((item) => item.id === product.id);
const updated = existing
? prev.map((item) => item.id === product.id ? { ...item, qty: item.qty + 1 } : item)
: [...prev, { ...product, qty: 1 }];
localStorage.setItem("canopy_cart", JSON.stringify(updated));
return updated;
});
};
return (
<CartContext.Provider value={{ cart, addToCart }}>
{children}
</CartContext.Provider>
);
}
Static Edge Delivery & Pluggable Backends
To guarantee sub-100ms page loads globally, the product catalog is compiled into static HTML during the automated build process and deployed to Cloudflare's edge network.
- Instant UI Response: The cart drawer slides out instantly with zero network latency.
- Offline Persistence: Items remain in the user's cart even if they temporarily lose internet connection or refresh the page.
- Pluggable Headless Backend: The static catalog and client state can be wired to any headless checkout engine (Shopify Storefront API, Swell, or Stripe) with zero changes to the front-end design system.
Google Core Web Vitals
100 / 100
Zero dynamic server queries ensure perfect mobile performance and instant indexing by Google's web crawlers.
Business Impact & ROI
By eliminating dynamic server dependencies, Canopy & Clay achieves $0/month in hosting overhead while offering an experience that rivals multi-million-dollar custom native apps.
Whether viewed on a desktop monitor in New York or a smartphone on 4G in Tokyo, the storefront delivers an immaculate, frictionless shopping experience built to convert.
Need a similar architecture?
Let's discuss how to engineer a custom system for your business.