This is a Next.js-based E-commerce Store that supports product listing, payments using Stripe, and email notifications using Resend. The project includes an admin panel for managing products, customers, orders, and discount codes.
- Frontend: Next.js, Tailwind CSS, React
- Backend: Next.js Server Actions, Prisma ORM
- Database: PostgreSQL (via Prisma ORM)
- Authentication: Basic Auth for Admin Panel
- Payments: Stripe Payment Integration
- Email Notifications: Resend API for sending emails
- Deployment: Vercel (recommended)
- Browse and purchase products
- Stripe payment integration
- Order history with downloadable links
- Admin panel to manage products
- Upload images and digital products
- Set availability and pricing
- Create and manage discount codes
- Supports percentage and fixed discounts
- Sales trends visualization
- Top-selling products
- Revenue breakdown by product
- Order confirmation emails
- Order history retrieval via email
git clone https://github.com/yourusername/nextjs-ecommerce.git
cd nextjs-ecommercenpm install
# or
yarn install
# or
pnpm installCreate a .env file in the root directory and add:
DATABASE_URL="postgresql://username:password@localhost:5432/next-js-ecommerce-store-code"
ADMIN_USERNAME=admin
HASHED_ADMIN_PASSWORD=yourhashedpassword
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
RESEND_API_KEY=your_resend_api_key
NEXT_PUBLIC_STRIPE_PUBLIC_KEY=your_stripe_public_key
NEXT_PUBLIC_SERVER_URL=http://localhost:3000npx prisma migrate dev --name init
npx prisma generatenpm run devVisit http://localhost:3000 in your browser.
This project integrates Stripe for handling payments.
-
Payments: Users can checkout and pay via Stripe.
-
Webhook Handling: The app listens to Stripe webhooks to process orders.
-
Success Page: After payment, users get a download link.
To learn more, visit: Stripe Docs.
The Resend API is used to send email confirmations and order receipts.
-
Order Confirmation: Sent after successful payment.
-
Order History Retrieval: Users can request past orders via email.
To learn more, visit: Resend Documentation.
-
Login to Vercel:
vercel login
-
Deploy:
vercel
For more details, check Next.js Deployment Docs.