Skip to content

Sahillather002/ProductsStore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

33 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ShopHub - Premium E-Commerce Platform

A comprehensive, full-stack e-commerce application built with Next.js 15, TypeScript, Supabase, and modern web technologies. This platform features all the essential functionality you'd expect from a production-ready e-commerce site.

πŸš€ Features

Core E-Commerce Features

  • Product Catalog: Browse products with categories, search, and filtering
  • Shopping Cart: Full cart management with add/update/remove functionality
  • User Authentication: Secure login/registration with Supabase Auth
  • Order Management: Complete order processing and tracking
  • Payment Integration: Stripe payment gateway integration
  • Review System: Customer reviews and ratings
  • Wishlist: Save favorite products for later

Advanced Features

  • Admin Dashboard: Comprehensive admin panel for store management
  • Image Hosting: Cloudinary integration for product images
  • Real-time Updates: WebSocket support for live notifications
  • Responsive Design: Mobile-first design with Tailwind CSS
  • Database Management: Supabase PostgreSQL with Row Level Security
  • API Integration: RESTful APIs for all functionality

User Experience

  • Modern UI: Beautiful, intuitive interface with shadcn/ui components
  • Search & Filter: Advanced product search and category filtering
  • Order History: Complete order tracking and management
  • User Profile: Personal dashboard with order history and preferences
  • Secure Checkout: Safe and secure payment processing

πŸ›  Technology Stack

Frontend

  • Next.js 15: React framework with App Router
  • TypeScript: Type-safe development
  • Tailwind CSS: Utility-first CSS framework
  • shadcn/ui: Modern UI component library
  • Lucide React: Beautiful icon library
  • Framer Motion: Smooth animations

Backend

  • Next.js API Routes: Server-side API endpoints
  • Supabase: PostgreSQL database with real-time capabilities
  • Supabase Auth: Authentication and authorization
  • Row Level Security: Database-level security policies
  • Stripe: Payment processing
  • Cloudinary: Image hosting and management

Development Tools

  • ESLint: Code linting and formatting
  • TypeScript: Static type checking
  • Hot Reload: Fast development experience

πŸ“¦ Installation

  1. Clone the repository

    git clone <repository-url>
    cd shophub
  2. Install dependencies

    npm install
  3. Set up Supabase

    • Create a project at https://app.supabase.com
    • Run supabase-schema.sql in SQL Editor
    • Run supabase-sample-data-auth.sql in SQL Editor
    • Get your API keys from Settings > API
  4. Set up environment variables

    cp ENV_TEMPLATE.txt .env

    Configure the following variables in .env:

    # Supabase (REQUIRED)
    NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
    NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
    SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
    
    # App
    NEXT_PUBLIC_APP_URL=http://localhost:3000
    
    # Stripe (Optional)
    NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key
    STRIPE_SECRET_KEY=your_stripe_secret_key
    STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
    
    # Cloudinary (Optional)
    NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
    CLOUDINARY_API_KEY=your_cloudinary_api_key
    CLOUDINARY_API_SECRET=your_cloudinary_api_secret
  5. Start the development server

    npm run dev

πŸ— Project Structure

src/
β”œβ”€β”€ app/                    # Next.js App Router
β”‚   β”œβ”€β”€ api/               # API routes
β”‚   β”‚   β”œβ”€β”€ auth/          # Authentication endpoints
β”‚   β”‚   β”œβ”€β”€ cart/          # Shopping cart API
β”‚   β”‚   β”œβ”€β”€ checkout/      # Payment processing
β”‚   β”‚   β”œβ”€β”€ orders/        # Order management
β”‚   β”‚   β”œβ”€β”€ products/      # Product catalog
β”‚   β”‚   β”œβ”€β”€ reviews/       # Review system
β”‚   β”‚   └── wishlist/      # Wishlist functionality
β”‚   β”œβ”€β”€ admin/             # Admin dashboard
β”‚   β”œβ”€β”€ dashboard/         # User dashboard
β”‚   └── globals.css        # Global styles
β”œβ”€β”€ components/            # React components
β”‚   β”œβ”€β”€ ui/               # shadcn/ui components
β”‚   β”œβ”€β”€ cart/             # Cart-related components
β”‚   └── providers/        # Context providers
β”œβ”€β”€ lib/                  # Utility libraries
β”‚   β”œβ”€β”€ auth.ts           # Supabase Auth utilities
β”‚   β”œβ”€β”€ supabase.ts       # Supabase client
β”‚   β”œβ”€β”€ stripe.ts         # Stripe configuration
β”‚   └── cloudinary.ts     # Cloudinary setup
└── hooks/                # Custom React hooks

🎯 Key Features Explained

Shopping Cart System

  • Persistent cart storage in database
  • Real-time cart updates
  • Quantity management
  • Checkout integration

Admin Dashboard

  • Product management (CRUD operations)
  • Order tracking and management
  • Sales analytics and reporting
  • User management

Payment Processing

  • Stripe integration for secure payments
  • Webhook handling for payment confirmation
  • Order status updates
  • Refund processing

Review System

  • Customer ratings and reviews
  • Review moderation
  • Average rating calculations
  • Verified purchase badges

πŸ”§ Development Commands

# Development
npm run dev          # Start development server
npm run build        # Build for production
npm run start        # Start production server

# Database
npm run db:push      # Push schema to database
npm run db:studio    # Open Prisma Studio
npm run seed         # Seed database with sample data

# Code Quality
npm run lint         # Run ESLint
npm run type-check   # Run TypeScript checks

πŸš€ Deployment

This application is designed to be deployed on modern hosting platforms:

  1. Vercel (Recommended)

    • Automatic deployments from Git
    • Built-in Next.js optimization
    • Edge functions support
  2. Netlify

    • Static site generation
    • Serverless functions
    • Form handling
  3. AWS/Google Cloud

    • Full control over infrastructure
    • Scalability options
    • Custom configurations

πŸ“ API Documentation

Products API

  • GET /api/products - Get all products with filtering
  • GET /api/products/[id] - Get single product
  • POST /api/products - Create new product (admin)
  • PUT /api/products/[id] - Update product (admin)
  • DELETE /api/products/[id] - Delete product (admin)

Cart API

  • GET /api/cart - Get user's cart
  • POST /api/cart - Add item to cart
  • PUT /api/cart - Update cart item
  • DELETE /api/cart - Remove item from cart

Orders API

  • GET /api/orders/user - Get user's orders
  • POST /api/checkout - Process checkout
  • GET /api/admin/dashboard - Get admin stats

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Next.js team for the amazing framework
  • shadcn/ui for beautiful components
  • Prisma for excellent ORM
  • Stripe for payment processing
  • Cloudinary for image hosting

πŸ“ž Support

For support and questions:

  • Create an issue in the repository
  • Check the documentation
  • Review the code comments

Built with ❀️ using modern web technologies

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors