A modern, full-stack e-commerce application built with Next.js 15, PayloadCMS, and Stripe integration.
- Frontend: Next.js 15 with React 19
- Backend/CMS: PayloadCMS with MongoDB
- Payment: Stripe Integration
- Styling: Tailwind CSS 4
- UI Components: Radix UI + shadcn/ui
- State Management: Zustand + TanStack Query
- API: tRPC for type-safe APIs
- Animations: Framer Motion
- Forms: React Hook Form with Zod validation
- Runtime: Bun (recommended) or Node.js
- Modern e-commerce interface with product catalog
- Content Management System powered by PayloadCMS
- Secure payment processing with Stripe
- Responsive design with dark/light theme support
- Type-safe API calls with tRPC
- Multi-tenant architecture support
- Rich text editing capabilities
- Advanced UI components with Radix UI
- Node.js 18+ or Bun
- MongoDB database
- Stripe account for payments
-
Clone the repository
git clone https://github.com/ASHUTOSH-KUMAR-RAO/ecommerce-2.git cd ecommerce-2 -
Install dependencies
# Using Bun (recommended) bun install # Or using npm npm install
-
Environment Setup Create a
.env.localfile in the root directory:# Database DATABASE_URI=mongodb://localhost:27017/ecommerce # PayloadCMS PAYLOAD_SECRET=your-payload-secret-key # Stripe STRIPE_SECRET_KEY=sk_test_... STRIPE_PUBLISHABLE_KEY=pk_test_... STRIPE_WEBHOOK_SECRET=whsec_... # Next.js NEXTAUTH_SECRET=your-nextauth-secret NEXTAUTH_URL=http://localhost:3000
-
Database Setup
# Fresh database migration bun run db:fresh # Seed with sample data bun run db:seed # Or reset everything bun run db:reset
-
Generate Types
bun run generate:types
# Start development server with Turbopack
bun run dev
# Server will start at http://localhost:3000# Build the application
bun run build
# Start production server
bun run start-
Login to Stripe CLI
bun run stripe:login
-
Listen for webhooks
bun run stripe:listen
-
Test Stripe integration
bun run stripe:test bun run stripe:events
# Trigger test payment events
bun run stripe:triggerecommerce-2/
├── src/
│ ├── app/ # Next.js app directory
│ ├── components/ # Reusable React components
│ ├── lib/ # Utility functions and configs
│ ├── server/ # tRPC server and API routes
│ └── seed.ts # Database seeding script
├── payload.config.ts # PayloadCMS configuration
├── tailwind.config.js # Tailwind CSS configuration
└── next.config.js # Next.js configuration
| Script | Description |
|---|---|
dev |
Start development server with Turbopack |
build |
Build production application |
start |
Start production server |
lint |
Run ESLint for code quality |
generate:types |
Generate TypeScript types from PayloadCMS |
db:fresh |
Fresh database migration |
db:seed |
Seed database with sample data |
db:reset |
Reset and reseed database |
stripe:login |
Login to Stripe CLI |
stripe:listen |
Listen for Stripe webhooks |
stripe:test |
Test Stripe CLI installation |
This project uses a comprehensive UI library built on:
- Radix UI - Accessible, unstyled components
- Tailwind CSS - Utility-first styling
- shadcn/ui - Beautiful, customizable components
- Framer Motion - Smooth animations
- Lucide React - Modern icon library
- Access admin panel at
/admin - Configure collections, fields, and relationships
- Manage content and media uploads
Make sure to set up all required environment variables for:
- Database connection
- PayloadCMS configuration
- Stripe API keys
- Authentication secrets
- Vercel (Next.js optimized)
- Railway
- DigitalOcean
- AWS/GCP
- Use MongoDB Atlas for cloud database
- Or self-hosted MongoDB instance
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is private and proprietary.
Ashutosh Kumar Rao
- GitHub: @ASHUTOSH-KUMAR-RAO
Built with ❤️ using Next.js and PayloadCMS