Shopcart is a modern, full‑featured e‑commerce web application built with Next.js App Router, TypeScript, Tailwind CSS v4, Zustand state management, and Sanity CMS as a headless backend.
It provides a complete shopping experience: product listing, filters, product details, cart, wishlist, orders, blog, and secure checkout powered by Stripe.
- Framework: Next.js
approuter (next@16) - Language: TypeScript
- Frontend Library: React (
react@19,react-dom@19) - Styling:
- Tailwind CSS v4
- CSS Modules / global styles (
app/globals.css) styled-componentsfor component‑level styling
- UI Components:
shadcn/uicomponent library- Custom UI system in
components/ui/* - Icons:
lucide-react,react-icons
- State Management: Zustand (
lib/store.ts) - Authentication: Clerk (
@clerk/nextjs) - Content & CMS:
- Sanity (
sanity,next-sanity) - Structured schemas for products, categories, brands, blogs, orders, addresses, etc.
- Sanity (
- Payments:
- Stripe (
stripe,lib/stripe.ts) - Checkout session via
actions/createCheckoutSession.ts
- Stripe (
- Utilities & UX:
dayjsfor date formattingreact-hot-toastfor notificationsclsx,class-variance-authority,tailwind-mergefor class compositionembla-carousel-react&motionfor carousels/animations
app/(client)/page.tsx– Home pageshop/page.tsx– Shop & product listingproduct/[slug]/page.tsx– Product detailscart/page.tsx– Cart pagewishlist/page.tsx– Wishlistorders/page.tsx– Orderssuccess/page.tsx– Checkout successdeal/page.tsx– Dealsblog/page.tsx&blog/[slug]/page.tsx– Blog index & detailbrand/[slug]/page.tsx– Brand‑specific productscategory/[slug]/page.tsx– Category‑specific productsapi/webhook/route.ts– Stripe webhook handler
studio/[[...tool]]/page.tsx– Embedded Sanity Studiolayout.tsx,not-found.tsx– App layout & 404
components/- Core UI:
NavBar,Footer,SideMenu,MobileMenu,SearchBar,SignIn, etc. - Commerce:
ProductCard,ProductGrid,AddtoCartButton,QuantityButtons,WishListProducts,OrdersComponent,OrderDetailDialog, etc. - Home:
home/HomeBanner,HomeCategories,ShopByBrands,LatestBlog, etc. - Shop filters:
shop/BrandList,CategoryList,PriceList - Shared UI primitives in
components/ui/*
- Core UI:
lib/store.ts– Global state with Zustandstripe.ts– Stripe server utilitiesutils.ts– helpers & utilities
sanity/schemaTypes/*– Sanity schemas for all entitiesqueries/*– Sanity GROQ querieslib/*– Sanity clients & image builders
- Modern storefront
- Home page with hero banner, featured categories, and brands
- Dedicated shop page with filters (brand, category, price)
- Product detail pages with rich content and characteristics
- Cart & Wishlist
- Add/remove items from cart and wishlist
- Quantity management and price calculations
- Empty cart state handling
- Orders & Checkout
- Stripe‑based checkout flow (
createCheckoutSession) - Order tracking & order list page
- Success page after payment
- Stripe‑based checkout flow (
- Content & Blog
- Blog listing and detail pages powered by Sanity
- Brand & category‑specific content
- Authentication & Access
- Clerk‑based authentication integration
- Protected user areas (orders, possibly wishlist/cart sync)
- Responsive UI
- Fully responsive layout with mobile menu & side navigation
- Accessible components built with
shadcn/ui
All UI screenshots are expected to be stored under public/app/<page-name>.<ext>.
Once you add the image files with these names, they will render directly in the README.
- Node.js
>= 18 - npm (or pnpm / yarn)
- A Stripe account & API keys
- A Sanity project (Project ID, dataset, tokens)
- A Clerk account and application keys
npm installCreate a .env.local file in the project root and configure values such as (adjust to your actual env names):
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key
NEXT_PUBLIC_SANITY_PROJECT_ID=your_sanity_project_id
NEXT_PUBLIC_SANITY_DATASET=production
SANITY_API_READ_TOKEN=your_sanity_read_token
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
NEXT_PUBLIC_APP_URL=http://localhost:3000Check the sanity/ and lib/stripe.ts files to align env variable names with your configuration.
npm run devOpen http://localhost:3000 in your browser to see the app.
npm run dev– Start the Next.js development servernpm run build– Create an optimized production buildnpm run start– Start the production servernpm run lint– Run ESLintnpm run typegen– Generate Sanity schema types
- Type Safety: TypeScript configuration via
tsconfig.json - Linting: ESLint with
eslint-config-next - Styling: Tailwind CSS v4 with
@tailwindcss/postcssandtw-animate-css
You can integrate additional tools like Playwright, Cypress, or Jest/RTL if you want more automated tests.
- The project is optimized for deployment on platforms that support Next.js, such as:
- Vercel
- Netlify
- Render / custom Node servers
- Make sure to configure your environment variables and Stripe webhooks in the hosting provider dashboard.
This project is licensed under the MIT License.
You are free to use this code for learning, personal, and commercial projects.
Attribution is appreciated but not required.












