Skip to content
Tulos

Folder structure

Where everything lives in the project.

app/
  (client)/            storefront, cart, checkout result, account (/user)
  admin/               admin panel (orders, users, subscriptions)
  api/webhook/         Stripe webhook
  api/draft-mode/      Sanity draft preview on/off
  auth/                Clerk sign-in and sign-up pages
  studio/              embedded Sanity Studio
actions/               server actions (checkout, addresses, admin, search, ratings…)
components/            UI; components/ui holds the shadcn/ui primitives
constants/             navigation, footer links, FAQ text
hooks/                 sidebars and small React hooks
lib/                   site config, pricing, checkout, admin checks
sanity/                schemas, queries (sanity/helpers) and clients
store.ts               cart (Zustand, saved in the browser)
wishlistStore.ts       wishlist
compareStore.ts        compare list
seed.tar.gz            sample catalog for Sanity

Good places to start reading

  • app/(client)/(home)/page.tsx: the home page sections
  • sanity/helpers/index.ts: every catalog query
  • actions/checkout.actions.ts and lib/checkout.ts: the checkout flow
  • lib/site.ts: store name, URL and the optional AdSense ID
  • proxy.ts: which routes need a signed-in user