Skip to content

AlfonsoVidrio/quickcart

Repository files navigation

πŸ›’ QuickCart - Modern E-commerce Platform

A full-stack e-commerce platform built with Next.js, featuring user authentication, product management, shopping cart functionality, and secure payment processing.

✨ Features

πŸ›οΈ Customer Features

  • Browse Products - View all available products with detailed information
  • Product Details - Complete product information with multiple images
  • Shopping Cart - Add/remove products with real-time cart updates
  • Stock Management - Automatic stock validation to prevent overselling
  • Address Management - Add delivery addresses for orders
  • Multiple Payment Options:
    • πŸ’³ Stripe - Secure credit/debit card payments
    • πŸ’΅ Cash on Delivery (COD) - Pay when you receive your order
  • Order History - View all your past orders and their status

πŸͺ Seller Features

  • Product Management - Add new products with images and details
  • Inventory Control - Manage product listings and availability
  • Order Management - View and track all customer orders
  • Stock Monitoring - Real-time inventory tracking

πŸ”§ Potential Future Features

The following features could be implemented to enhance the platform:

Customer Enhancements

  • Address Management - Edit and update existing delivery addresses
  • Order Tracking - Real-time order status updates with notifications

Seller Enhancements

  • Product Editing - Modify existing product details and pricing
  • Product Removal - Delete discontinued or out-of-stock products
  • Order Status Management - Update order status for Cash on Delivery orders
  • Advanced Analytics - Sales reports and inventory insights

πŸ› οΈ Technology Stack

  • Next.js 14 - React framework with App Router
  • Tailwind CSS - Utility-first CSS framework
  • MongoDB - NoSQL database with Mongoose ODM
  • Clerk - Authentication and user management
  • Cloudinary - Image storage and optimization
  • Stripe - Payment processing
  • Inngest - Background jobs and event handling
  • React Context API - State management

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • MongoDB database
  • Clerk account for authentication
  • Cloudinary account for image storage
  • Stripe account for payments

Environment Variables Setup

Configure your environment variables by copying .env.example to .env and filling in your actual values for all required services (MongoDB, Clerk, Cloudinary, Inngest, and Stripe).

Installation

# Clone the repository
git clone https://github.com/AlfonsoVidrio/quickcart.git

# Navigate to project directory
cd quickcart

# Install dependencies
npm install

# Copy environment variables template
cp .env.example .env.local
# Edit .env.local with your actual values

# Run the development server
npm run dev

Open http://localhost:3000 in your browser to see the application.

πŸ“‹ Environment Setup

Seller Account Setup

To enable seller functionality for a user:

  1. Go to your Clerk Dashboard
  2. Navigate to Users section
  3. Edit the user's public metadata
  4. Add the following JSON:
    {
      "role": "seller"
    }
  5. Save changes - the user will now have access to seller features

πŸ“ Project Structure

quickcart/
β”œβ”€β”€ πŸ“ app/                     # Next.js App Router
β”‚   β”œβ”€β”€ πŸ“ api/                # API routes
β”‚   β”‚   β”œβ”€β”€ πŸ“ cart/           # Cart operations
β”‚   β”‚   β”œβ”€β”€ πŸ“ inngest/        # Inngest webhook endpoint
β”‚   β”‚   β”œβ”€β”€ πŸ“ order/          # Order management
β”‚   β”‚   β”œβ”€β”€ πŸ“ product/        # Product operations
β”‚   β”‚   β”œβ”€β”€ πŸ“ stripe/         # Payment webhooks
β”‚   β”‚   └── πŸ“ user/           # User operations
β”‚   β”œβ”€β”€ πŸ“ add-address/        # Add delivery address page
β”‚   β”œβ”€β”€ πŸ“ all-products/       # Product catalog page
β”‚   β”œβ”€β”€ πŸ“ cart/               # Shopping cart pages
β”‚   β”œβ”€β”€ πŸ“ my-orders/          # User order history
β”‚   β”œβ”€β”€ πŸ“ order-placed/       # Order confirmation page
β”‚   β”œβ”€β”€ πŸ“ product/            # Product detail pages
β”‚   β”œβ”€β”€ πŸ“ seller/             # Seller dashboard
β”‚   β”œβ”€β”€ οΏ½ favicon.ico         # Site favicon
β”‚   β”œβ”€β”€ πŸ“„ globals.css         # Global styles
β”‚   β”œβ”€β”€ πŸ“„ layout.js           # Root layout component
β”‚   └── πŸ“„ page.jsx            # Homepage
β”œβ”€β”€ πŸ“ assets/                 # Static assets
β”‚   β”œβ”€β”€ πŸ“„ assets.js           # Asset exports
β”‚   β”œβ”€β”€ πŸ“„ productData.js      # Sample product data
β”‚   └── πŸ–ΌοΈ [images]           # Product and UI images
β”œβ”€β”€ πŸ“ components/             # Reusable components
β”‚   β”œβ”€β”€ πŸ“ seller/             # Seller-specific components
β”‚   β”œβ”€β”€ πŸ“„ Banner.jsx          # Hero banner component
β”‚   β”œβ”€β”€ πŸ“„ FeaturedProduct.jsx # Featured product display
β”‚   β”œβ”€β”€ πŸ“„ Footer.jsx          # Footer component
β”‚   β”œβ”€β”€ πŸ“„ HeaderSlider.jsx    # Image slider component
β”‚   β”œβ”€β”€ πŸ“„ HomeProducts.jsx    # Product grid for homepage
β”‚   β”œβ”€β”€ πŸ“„ Loading.jsx         # Loading spinner component
β”‚   β”œβ”€β”€ πŸ“„ Navbar.jsx          # Navigation component
β”‚   β”œβ”€β”€ πŸ“„ NewsLetter.jsx      # Newsletter subscription
β”‚   β”œβ”€β”€ πŸ“„ OrderSummary.jsx    # Order summary component
β”‚   └── πŸ“„ ProductCard.jsx     # Product display card
β”œβ”€β”€ πŸ“ config/                 # Configuration
β”‚   β”œβ”€β”€ πŸ“„ db.js               # Database connection
β”‚   └── πŸ“„ inngest.js          # Background jobs setup
β”œβ”€β”€ πŸ“ context/                # React Context
β”‚   └── πŸ“„ AppContext.jsx      # Global state management
β”œβ”€β”€ πŸ“ lib/                    # Utility functions
β”‚   └── πŸ“„ authSeller.js       # Seller authentication utilities
β”œβ”€β”€ πŸ“ models/                 # Database models
β”‚   β”œβ”€β”€ πŸ“„ Address.js          # Address schema
β”‚   β”œβ”€β”€ πŸ“„ Order.js            # Order schema
β”‚   β”œβ”€β”€ πŸ“„ Product.js          # Product schema
β”‚   └── πŸ“„ User.js             # User schema
β”œβ”€β”€ πŸ“ public/                 # Public static files
β”‚   β”œβ”€β”€ πŸ“„ file.svg            # File icon
β”‚   β”œβ”€β”€ πŸ“„ globe.svg           # Globe icon
β”‚   β”œβ”€β”€ πŸ“„ next.svg            # Next.js logo
β”‚   β”œβ”€β”€ πŸ“„ vercel.svg          # Vercel logo
β”‚   └── πŸ“„ window.svg          # Window icon
β”œβ”€β”€ οΏ½ .env.example            # Environment variables template
β”œβ”€β”€ πŸ“„ .gitignore              # Git ignore rules
β”œβ”€β”€ οΏ½ eslint.config.mjs       # ESLint configuration
β”œβ”€β”€ πŸ“„ jsconfig.json           # JavaScript configuration
β”œβ”€β”€ πŸ“„ middleware.ts           # Next.js middleware
β”œβ”€β”€ πŸ“„ next.config.mjs         # Next.js configuration
β”œβ”€β”€ πŸ“„ package.json            # Dependencies and scripts
β”œβ”€β”€ πŸ“„ postcss.config.mjs      # PostCSS configuration
β”œβ”€β”€ πŸ“„ README.md               # Project documentation
└── πŸ“„ tailwind.config.mjs     # Tailwind CSS configuration

🚦 API Routes

Public Routes

  • GET /api/product/list - Get all products
  • GET /api/product/[id] - Get product details

Protected Routes (User)

  • POST /api/cart/update - Update cart items
  • GET /api/cart/get - Get user cart
  • POST /api/order/create - Create new order (COD)
  • POST /api/order/stripe - Create Stripe checkout
  • POST /api/user/add-address - Add shipping address
  • GET /api/user/get-address - Get user addresses
  • GET /api/user/data - Get user profile data

Protected Routes (Seller)

  • POST /api/product/add - Add new product
  • GET /api/product/seller-list - Get seller products
  • GET /api/order/seller-orders - Get seller orders

πŸ“Έ Screenshots

🏠 Homepage

home

πŸ“± Product Catalog

all-produts

πŸ” Product Details

product-details

πŸ›’ Shopping Cart

cart

πŸ“¦ Order History

my-orders

βž• Add Product (Seller)

add-product

πŸ“Š List of Products (Seller)

product-list

About

A full-stack e-commerce platform built with Next.js, featuring user authentication, product management, shopping cart functionality, and secure payment processing.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages