A modern, feature-rich e-commerce application built with Next.js 16, TypeScript, Sanity CMS, Clerk Authentication, and Stripe/Clerk Payments. This free version includes core e-commerce features with premium features available in the paid version.
- ποΈ Product Management - Complete product catalog with categories, brands, and search
- π Shopping Cart - Persistent cart with real-time updates
- π Wishlist - Save favorite products for later
- π€ User Authentication - Secure authentication via Clerk
- π¦ Order Management - Track orders and order history
- π³ Multiple Payment Methods - Stripe, Clerk, and Cash on Delivery
- π± Responsive Design - Mobile-first responsive UI
- π¨ Modern UI/UX - Built with Tailwind CSS and Framer Motion
- π Advanced Search & Filters - Filter by category, brand, price, and more
- β Product Reviews - Customer reviews and ratings
- π§ Email Notifications - Order confirmations and updates via Nodemailer
- π Advanced Analytics Dashboard - Comprehensive business insights
- π₯ Employee Management System - Multi-role employee portal
- π Review Management Tools - Moderate and manage customer reviews
- π¬ Subscription Management - Newsletter and email campaigns
- π Customer Insights & Reports - Detailed customer analytics
- π₯ Export Data to Excel/CSV - Export all data for analysis
- π¨ Custom Admin Branding - Customize admin panel
- π Priority Support & Updates - Fast support and early access to features
Before you begin, ensure you have the following installed:
git clone https://github.com/noorjsdivs/shopcartpro-yt
cd shopcartproChoose your preferred package manager:
# Using npm
npm install
# Using yarn
yarn install
# Using pnpm (recommended)
pnpm installCreate a .env file in the root directory and add the following variables:
# Base URL
NEXT_PUBLIC_BASE_URL=http://localhost:3000
# Sanity CMS Configuration
NEXT_PUBLIC_SANITY_PROJECT_ID=your_sanity_project_id
NEXT_PUBLIC_SANITY_DATASET=production
NEXT_PUBLIC_SANITY_API_VERSION=2024-11-09
SANITY_API_TOKEN=your_sanity_api_token
SANITY_API_READ_TOKEN=your_sanity_read_token
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key
# Stripe Payment Gateway
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
# Firebase (for notifications)
NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_firebase_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_firebase_storage_bucket
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_firebase_messaging_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_firebase_app_id
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=your_firebase_measurement_id
# Email Configuration (Nodemailer)
[email protected]
EMAIL_PASSWORD=your_app_password
# Admin Configuration
[email protected]
# Premium Version Link (Optional)
NEXT_PUBLIC_PAID_VERION=https://www.buymeacoffee.com/reactbd
# Company Information (Optional)
NEXT_PUBLIC_COMPANY_NAME=ShopCart
[email protected]
NEXT_PUBLIC_COMPANY_PHONE=+1 (555) 123-4567
NEXT_PUBLIC_COMPANY_ADDRESS=123 Business Street
NEXT_PUBLIC_COMPANY_CITY=New York, NY 10001, USA- Visit Sanity.io
- Create a free account or sign in
- Create a new project:
npm create sanity@latest -- --env=.env --create-project "ShopCart Pro" --dataset production - Get your credentials:
- Go to Sanity Management
- Select your project
- Navigate to API section
- Project ID: Copy from project settings
- API Tokens: Click "Add API token"
- Create token with Editor role for
SANITY_API_TOKEN - Create token with Viewer role for
SANITY_API_READ_TOKEN
- Create token with Editor role for
π Sanity Documentation
-
Visit Clerk.com
-
Sign up for a free account
-
Create a new application
-
Get your credentials from the API Keys section:
- Publishable Key β
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY - Secret Key β
CLERK_SECRET_KEY
- Publishable Key β
-
Configure Clerk:
- Go to User & Authentication β Email, Phone, Username
- Enable Email authentication
- Go to Paths and set:
- Sign-in URL:
/sign-in - Sign-up URL:
/sign-up - After sign-in URL:
/ - After sign-up URL:
/
- Sign-in URL:
π Clerk Documentation
-
Visit Stripe.com
-
Create a free account
-
Get your credentials from the Developers section:
- Go to API Keys
- Publishable Key β
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY - Secret Key β
STRIPE_SECRET_KEY
-
Set up Webhooks:
- Go to Developers β Webhooks
- Click Add endpoint
- Endpoint URL:
http://localhost:3000/api/webhooks/stripe(for local testing) - Select events:
checkout.session.completed,payment_intent.succeeded - Get Webhook Secret β
STRIPE_WEBHOOK_SECRET
-
Testing in Development:
- Install Stripe CLI: Stripe CLI Installation
- Run:
stripe listen --forward-to localhost:3000/api/webhooks/stripe
π Stripe Documentation
-
Visit Firebase Console
-
Create a new project
-
Add a web app to your project
-
Get your configuration from Project Settings β General:
- Copy all the config values to your
.envfile
- Copy all the config values to your
-
Enable Firestore Database:
- Go to Firestore Database
- Click Create Database
- Start in Production mode
-
Use your Gmail account or create a new one
-
Enable 2-Step Verification:
- Go to Google Account Security
- Enable 2-Step Verification
-
Generate App Password:
- Go to App Passwords
- Select Mail and Other (Custom name)
- Generate password
- Copy the 16-character password β
EMAIL_PASSWORD
-
Add credentials to
.env:[email protected] EMAIL_PASSWORD=your_16_char_app_password
Start the development server with Turbopack (faster):
# Using npm
npm run dev
# Using yarn
yarn dev
# Using pnpm
pnpm devThe application will be available at:
- Frontend: http://localhost:3000
- Sanity Studio: http://localhost:3000/studio
# Build the application
npm run build
# Start the production server
npm startshopcartpro/
βββ app/ # Next.js 16 App Router
β βββ (admin)/ # Admin Panel Routes
β β βββ admin/
β β βββ page.tsx # Admin Dashboard (Premium) β
β β βββ layout.tsx # Admin layout with navigation
β β βββ analytics/ # Analytics Dashboard (Premium) β
β β βββ reviews/ # Review Management (Premium) β
β β βββ subscriptions/ # Subscription Management (Premium) β
β β βββ employees/ # Employee Management
β β βββ products/ # Product Management
β β βββ orders/ # Order Management
β β βββ users/ # User Management
β β βββ account-requests/ # Account Requests
β β βββ notifications/ # Notification Center
β β βββ access-denied/ # Access Denied Page
β β
β βββ (auth)/ # Authentication Routes
β β βββ sign-in/
β β β βββ [[...sign-in]]/ # Clerk Sign In
β β βββ sign-up/
β β βββ [[...sign-up]]/ # Clerk Sign Up
β β
β βββ (client)/ # Client-Facing Routes
β β βββ page.tsx # Home Page
β β βββ layout.tsx # Client layout with header/footer
β β βββ shop/ # Shop All Products
β β βββ category/
β β β βββ page.tsx # All Categories
β β β βββ [slug]/ # Category Detail Page
β β βββ product/
β β β βββ page.tsx # All Products
β β β βββ [slug]/ # Product Detail Page
β β βββ brands/
β β β βββ page.tsx # All Brands
β β β βββ [slug]/ # Brand Detail Page
β β βββ blog/
β β β βββ page.tsx # All Blog Posts
β β β βββ [slug]/ # Blog Post Detail
β β βββ deal/ # Special Deals
β β βββ orders/ # Order Tracking
β β βββ dashboard/ # User Dashboard
β β β
β β βββ (public)/ # Public Pages
β β β βββ about/ # About Us
β β β βββ contact/ # Contact Us
β β β βββ privacy/ # Privacy Policy
β β β βββ terms/ # Terms & Conditions
β β β βββ faq/ # FAQ Page
β β β βββ faqs/ # FAQs Alternative
β β β βββ help/ # Help Center
β β β
β β βββ (user)/ # Protected User Routes
β β βββ cart/ # Shopping Cart
β β βββ checkout/ # Checkout Process
β β βββ wishlist/ # Wishlist
β β βββ success/ # Payment Success
β β βββ clerk-payment/ # Clerk Payment Page
β β βββ user/
β β βββ page.tsx # User Profile
β β βββ dashboard/ # User Dashboard
β β βββ profile/ # Edit Profile
β β βββ orders/ # Order History
β β β βββ [id]/ # Order Details
β β βββ notifications/ # User Notifications
β β βββ settings/ # Account Settings
β β βββ admin/ # User Admin Tools
β β βββ manage-users/ # Manage Users
β β βββ business-accounts/ # Business Accounts
β β βββ premium-accounts/ # Premium Accounts
β β
β βββ (employee)/ # Employee Portal (Premium) β
β β βββ employee/
β β βββ page.tsx # Shows Premium Upgrade Message
β β βββ layout.tsx # Employee layout (gated)
β β
β βββ api/ # API Routes
β β βββ checkout/
β β β βββ stripe/ # Stripe Checkout API
β β β β βββ complete/ # Stripe Payment Completion
β β β βββ clerk/ # Clerk Checkout API
β β β βββ complete/ # Clerk Payment Completion
β β βββ webhooks/
β β β βββ stripe/ # Stripe Webhook Handler
β β βββ orders/ # Order Management APIs
β β βββ products/ # Product APIs
β β βββ user/ # User APIs
β β βββ cart/ # Cart APIs
β β βββ wishlist/ # Wishlist APIs
β β βββ reviews/ # Review APIs
β β βββ email/ # Email Service APIs
β β βββ notifications/ # Notification APIs
β β
β βββ studio/ # Sanity CMS Studio
β β βββ [[...tool]]/
β β βββ page.tsx # Sanity Studio Editor
β β
β βββ layout.tsx # Root Layout
β βββ globals.css # Global Styles
β βββ not-found.tsx # 404 Page
β βββ robots.ts # Robots.txt Generator
β βββ sitemap.ts # Sitemap Generator
β
βββ components/ # React Components
β βββ admin/ # Admin Components
β β βββ AdminDashboardOverview.tsx
β β βββ AdminPremiumFeature.tsx # Premium Message Component
β β βββ AdminTopNavigation.tsx
β β βββ AnalyticsDashboard.tsx
β β βββ AdminReviews.tsx
β β βββ AdminSubscriptions.tsx
β β βββ EmployeeManagement.tsx
β β βββ EmployeeOrderManagement.tsx
β β βββ ...
β β
β βββ cart/ # Cart Components
β β βββ CartItem.tsx
β β βββ CartSummary.tsx
β β βββ ...
β β
β βββ checkout/ # Checkout Components
β β βββ CheckoutContent.tsx
β β βββ PaymentModal.tsx
β β βββ DirectPaymentModal.tsx
β β βββ ...
β β
β βββ employee/ # Employee Components (Premium)
β β βββ PaidFeatureMessage.tsx # Premium Upgrade Message
β β
β βββ product/ # Product Components
β β βββ ProductCard.tsx
β β βββ ProductGrid.tsx
β β βββ ProductDetails.tsx
β β βββ ProductReviews.tsx
β β βββ ...
β β
β βββ profile/ # User Profile Components
β β βββ ProfileForm.tsx
β β βββ OrderHistory.tsx
β β βββ ...
β β
β βββ ui/ # UI Components (shadcn/ui)
β β βββ button.tsx
β β βββ dialog.tsx
β β βββ input.tsx
β β βββ select.tsx
β β βββ ...
β β
β βββ PremiumFloatingButton.tsx # Premium Upgrade Button
β βββ Header.tsx
β βββ Footer.tsx
β βββ Container.tsx
β βββ ...
β
βββ actions/ # Server Actions
β βββ userActions.ts # User-related actions
β βββ orderActions.ts # Order-related actions
β βββ employeeActions.ts # Employee actions (for admin)
β βββ orderEmployeeActions.ts # Order employee actions
β βββ reviewActions.ts # Review actions
β βββ wishlistActions.ts # Wishlist actions
β βββ walletActions.ts # Wallet actions
β βββ emailUserActions.ts # Email actions
β βββ ...
β
βββ lib/ # Utility Functions
β βββ sanityClient.ts # Sanity client setup
β βββ adminUtils.ts # Admin utility functions
β βββ orderStatus.ts # Order status management
β βββ emailImageUtils.ts # Email utilities
β βββ notificationService.ts # Notification service
β βββ firebase.ts # Firebase configuration
β βββ ...
β
βββ sanity/ # Sanity CMS Configuration
β βββ schemaTypes/ # Content schemas
β β βββ productType.ts
β β βββ categoryType.ts
β β βββ orderType.ts
β β βββ reviewType.ts
β β βββ ...
β βββ lib/
β β βββ client.ts # Sanity client
β β βββ image.ts # Image utilities
β βββ env.ts # Sanity environment config
β
βββ types/ # TypeScript Definitions
β βββ product.ts
β βββ order.ts
β βββ user.ts
β βββ employee.ts
β βββ ...
β
βββ hooks/ # Custom React Hooks
β βββ useCart.ts
β βββ useWishlist.ts
β βββ useOrderPlacement.ts
β βββ ...
β
βββ config/ # Configuration Files
β βββ contact.ts # Contact information config
β
βββ constants/ # Constants
β βββ index.ts
β
βββ public/ # Static Assets
β βββ preview.png # App preview image
β βββ ...
β
βββ .env # Environment Variables (git-ignored)
βββ next.config.ts # Next.js Configuration
βββ tailwind.config.ts # Tailwind CSS Configuration
βββ tsconfig.json # TypeScript Configuration
βββ sanity.config.ts # Sanity Studio Configuration
βββ package.json # Dependencies & Scripts
Note: Routes marked with β show premium upgrade messages in the free version.
- URL: http://localhost:3000
- Features: Browse products, add to cart, checkout, order tracking
- URL: http://localhost:3000/admin
- Default Access: Set your email in
NEXT_PUBLIC_ADMIN_EMAIL - Features: Manage products, orders, users, notifications
- URL: http://localhost:3000/studio
- Features: Content management, product creation, image uploads
- URL: http://localhost:3000/employee
- Note: Shows upgrade message in free version
# Development with Turbopack
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Run ESLint
npm run lint
# Generate Sanity TypeScript types
npm run typegen- Open
.envfile - Set your email as admin:
- Sign in to the application with this email
- Access admin panel at
/admin
Update the company information in .env:
NEXT_PUBLIC_COMPANY_NAME=Your Company Name
[email protected]
NEXT_PUBLIC_COMPANY_PHONE=+1 (555) 123-4567
NEXT_PUBLIC_COMPANY_ADDRESS=Your Business Address
NEXT_PUBLIC_COMPANY_CITY=Your City, State ZIPIf you have sample data to populate your store:
# Import data to Sanity
npx sanity@latest dataset import seed.tar.gz| Technology | Version | Purpose | Documentation |
|---|---|---|---|
| Next.js | 16.0.1 | React framework | Docs |
| React | 19.1.1 | UI library | Docs |
| TypeScript | 5.7.3 | Type safety | Docs |
| Tailwind CSS | 4.1.16 | Styling | Docs |
| Sanity | 4.12.0 | CMS | Docs |
| Clerk | 6.34.1 | Authentication | Docs |
| Stripe | 19.2.0 | Payments | Docs |
| Framer Motion | 12.23.19 | Animations | Docs |
| Zustand | 5.0.8 | State management | Docs |
| Firebase | 12.5.0 | Notifications | Docs |
| Nodemailer | 7.0.10 | Email service | Docs |
1. Sanity Studio not loading
# Regenerate Sanity types
npm run typegen2. Stripe webhook not working locally
# Install Stripe CLI and forward webhooks
stripe listen --forward-to localhost:3000/api/webhooks/stripe3. Clerk authentication errors
- Verify your Clerk keys are correct
- Check that redirect URLs match your configuration
- Ensure your domain is added in Clerk dashboard
4. Environment variables not loading
- Restart the development server after changing
.env - Make sure variable names are correct (no typos)
- Check that sensitive variables don't have quotes
5. Build errors
# Clear Next.js cache
rm -rf .next
npm run build- Push your code to GitHub
- Visit Vercel
- Import your repository
- Add all environment variables from
.env - Update
NEXT_PUBLIC_BASE_URLto your domain - Deploy!
- Update Clerk redirect URLs with your production domain
- Update Stripe webhook endpoint to
https://yourdomain.com/api/webhooks/stripe - Configure CORS in Sanity dashboard for your domain
- Set production environment variables in Vercel dashboard
This is a commercial product licensed under ReactBD Technologies.
Free Version: Includes core e-commerce features Paid Version: Includes all premium features and priority support
Need help? Here's how to get support:
- π§ Email: [email protected]
- π Website: ReactBD.com
- π¬ Premium Support: Available for paid version customers
Built with amazing open-source technologies:
Current Version: 0.1.0 (Free)
Premium Version Features:
- π Advanced Analytics
- π₯ Employee Management
- π Review Management
- π¬ Subscription Tools
- π Customer Insights
- π₯ Data Export
- π¨ Custom Branding
- π Priority Support
Made with β€οΈ by ReactBD Technologies
β Star this repo if you find it helpful!
