A modern, full-featured e-commerce platform built with Next.js 14, Prisma, SQL Server, and Stripe.
- Product catalog with categories, collections, and search
- Shopping cart and checkout with Stripe
- Customer accounts and order history
- Product reviews and wishlist
- Responsive, mobile-first design
- Comprehensive product management with variants
- Order management and fulfillment
- Customer management
- Promotion and coupon system
- Affiliate marketing and tracking
- Ad placement management
- Role-based access control (RBAC)
- Audit logging
- Next.js 14 with App Router
- TypeScript for type safety
- Prisma ORM for database access
- SQL Server database
- Stripe integration for payments
- NextAuth for authentication
- Tailwind CSS for styling
- Docker and Docker Compose
- Stripe account (for payments)
- Git
- Clone the repository:
git clone <repository-url>
cd ECommerce- Set up environment variables:
cp .env.example .env
# Edit .env with your Stripe keys and other configuration- Start the application with Docker Compose:
# Development mode with hot reload
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up
# OR Production mode
docker-compose up -d- The application will be available at http://localhost:3000
- SQL Server will be available at
localhost:1433 - Access Prisma Studio:
docker-compose exec app npx prisma studio
- Ensure you have Node.js 18+ and SQL Server installed
- Install dependencies:
npm install - Set up environment variables (copy
.env.exampleto.env) - Generate Prisma client:
npm run db:generate - Push database schema:
npm run db:push - Run development server:
npm run dev
├── app/ # Next.js app router
│ ├── admin/ # Admin panel routes
│ ├── api/ # API routes
│ ├── auth/ # Authentication pages
│ └── (storefront)/ # Storefront pages
├── components/ # React components
├── lib/ # Utility libraries
│ ├── prisma.ts # Prisma client
│ ├── auth.ts # NextAuth config
│ └── stripe.ts # Stripe client
├── prisma/ # Prisma schema and migrations
│ └── schema.prisma # Database schema
├── types/ # TypeScript type definitions
└── middleware.ts # Next.js middleware
DATABASE_URL- SQL Server connection stringNEXTAUTH_URL- Application URLNEXTAUTH_SECRET- Secret for NextAuthSTRIPE_SECRET_KEY- Stripe secret keySTRIPE_PUBLISHABLE_KEY- Stripe publishable keySTRIPE_WEBHOOK_SECRET- Stripe webhook secret
npm run dev- Start development server (port 3000)npm run dev:admin- Start development server (port 3001)npm run build- Build for productionnpm run start- Start production servernpm run db:generate- Generate Prisma clientnpm run db:push- Push schema changes to databasenpm run db:migrate- Run database migrationsnpm run db:studio- Open Prisma Studionpm run db:seed- Seed the database
- Products with multiple variants (size, color, etc.)
- Categories and collections
- Product attributes and specifications
- Inventory management
- SEO optimization
- Complete order lifecycle management
- Shipment tracking
- Refunds and returns
- Customer notifications
- Coupon codes (percentage or fixed amount)
- Cart rules (automatic promotions)
- Configurable stacking rules
- Affiliate tracking via unique links
- Commission calculation
- Attribution models (first/last click)
- Payout management
- Ad slot definitions
- Campaign management
- Creative assets
- Impression and click tracking
- Role-based access control (RBAC)
- CSRF protection
- Secure session management
- Rate limiting
- Audit logging for admin actions
NOTE: Be sure to look at the Security_Audit.md <<<<---------------------------- Dont store passwords and be sure the implement recommended changes if you decide to use this!
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License.