Skip to content

brian5Home/ECommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E-Commerce Platform

A modern, full-featured e-commerce platform built with Next.js 14, Prisma, SQL Server, and Stripe.

Features

Storefront

  • 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

Admin Panel

  • 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

Technical Features

  • 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

Getting Started

Prerequisites

  • Docker and Docker Compose
  • Stripe account (for payments)
  • Git

Installation with Docker (Recommended)

  1. Clone the repository:
git clone <repository-url>
cd ECommerce
  1. Set up environment variables:
cp .env.example .env
# Edit .env with your Stripe keys and other configuration
  1. 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
  1. The application will be available at http://localhost:3000
  2. SQL Server will be available at localhost:1433
  3. Access Prisma Studio: docker-compose exec app npx prisma studio

Installation without Docker

  1. Ensure you have Node.js 18+ and SQL Server installed
  2. Install dependencies: npm install
  3. Set up environment variables (copy .env.example to .env)
  4. Generate Prisma client: npm run db:generate
  5. Push database schema: npm run db:push
  6. Run development server: npm run dev

Project Structure

├── 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

Environment Variables

  • DATABASE_URL - SQL Server connection string
  • NEXTAUTH_URL - Application URL
  • NEXTAUTH_SECRET - Secret for NextAuth
  • STRIPE_SECRET_KEY - Stripe secret key
  • STRIPE_PUBLISHABLE_KEY - Stripe publishable key
  • STRIPE_WEBHOOK_SECRET - Stripe webhook secret

Scripts

  • npm run dev - Start development server (port 3000)
  • npm run dev:admin - Start development server (port 3001)
  • npm run build - Build for production
  • npm run start - Start production server
  • npm run db:generate - Generate Prisma client
  • npm run db:push - Push schema changes to database
  • npm run db:migrate - Run database migrations
  • npm run db:studio - Open Prisma Studio
  • npm run db:seed - Seed the database

Key Features

Catalog Management

  • Products with multiple variants (size, color, etc.)
  • Categories and collections
  • Product attributes and specifications
  • Inventory management
  • SEO optimization

Order Processing

  • Complete order lifecycle management
  • Shipment tracking
  • Refunds and returns
  • Customer notifications

Promotions

  • Coupon codes (percentage or fixed amount)
  • Cart rules (automatic promotions)
  • Configurable stacking rules

Affiliate Marketing

  • Affiliate tracking via unique links
  • Commission calculation
  • Attribution models (first/last click)
  • Payout management

Ad Management

  • Ad slot definitions
  • Campaign management
  • Creative assets
  • Impression and click tracking

Security

  • 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!

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors