Baldu Raridades
Cap and streetwear e-commerce — Next.js + Sanity CMS, with Asaas payments (PIX/Card) and Melhor Envio shipping.
Front-end
- Next.js 16
- React 19
- TypeScript
- Tailwind v4
- Zustand
- React Compiler
CMS
- Sanity Studio v5
- next-sanity
- GROQ
- Webhooks
Payments & Shipping
- Asaas (PIX/Cartão)
- Webhook Asaas
- Melhor Envio
Full-screen for best quality.
Context
Baldu Raridades is a cap and streetwear e-commerce. The store covers catalog, cart, shipping rates via Melhor Envio and checkout with PIX and card through Asaas, plus an order tracking page.
Sanity CMS acts as both database and admin panel. Products, orders and stock live in Sanity; Next.js Route Handlers wrap everything that requires secrets — Asaas charge creation, freight quotes, order persistence and stock decrement.
Two webhooks close the loop: the Sanity one revalidates the catalog on demand after every product edit, and the Asaas one reacts to payment events (confirmation, overdue, refund) by confirming or cancelling the order and decrementing stock idempotently. Secrets live exclusively in Route Handlers — never on the client.
Technical decisions
CMS · Sanity instead of back-end + database
A traditional e-commerce stacks an API, a database (Postgres), an authenticated admin, image storage and a CDN. For a catalog store, that is development and maintenance cost with no return.
Sanity delivers all of it at once: schemas versioned in code, GROQ reads, and the Studio as the panel where the client uploads products with photos . The server persists the order and decrements stock when the Asaas webhook confirms the payment. What the CMS shouldn’t touch (checkout, webhooks, secrets) remains back-end, just inside Next instead of a separate project.