Skip to content

gagandeepsingh101/quickkart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ QuickKart

QuickKart is a full-stack e-commerce application built with React on the frontend and Node.js/Express on the backend.

πŸš€ Live Links


πŸ›  Tech Stack

Frontend

  • βš›οΈ React - JavaScript library for building user interfaces
  • ⚑ Vite - Fast build tool and development server
  • 🏬 Redux Toolkit - State management (authentication, shopping, admin functions)
  • πŸ”€ React Router DOM - Client-side routing
  • πŸ”— Axios - HTTP client for API requests
  • 🎨 Radix UI - Headless UI component library
  • πŸ’… Tailwind CSS - Utility-first CSS framework
  • 🎭 Lucide React - Icon library

Backend

  • πŸš€ Node.js - JavaScript runtime
  • πŸ— Express.js - Web framework
  • πŸ—„ MongoDB - NoSQL database
  • πŸ“œ Mongoose - Object modeling for MongoDB
  • πŸ” JWT - Authentication with JSON Web Tokens
  • πŸ”‘ bcryptjs - Password hashing
  • ☁️ Cloudinary - Cloud storage for images
  • πŸ’³ PayPal REST SDK - Payment processing
  • πŸ“‚ Multer - File upload middleware

πŸ›  Environment Setup

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn
  • MongoDB instance

Frontend Setup

cd client
npm install

Create a .env file in the client/ directory:

VITE_API_URL=http://localhost:5000/api

Start the frontend server:

npm run dev

Frontend will be available at http://localhost:5173


Backend Setup

cd server
npm install

Create a .env file in the server/ directory:

PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
PAYPAL_CLIENT_ID=your_paypal_client_id
PAYPAL_CLIENT_SECRET=your_paypal_client_secret

Start the backend server:

npm run dev

Backend API will be available at http://localhost:5000


🎯 Key Features

User Features

βœ”οΈ User authentication (register, login, logout)
βœ”οΈ Browse and search products
βœ”οΈ Filter products by category, brand, price
βœ”οΈ Shopping cart management
βœ”οΈ Order placement and PayPal payment integration
βœ”οΈ Manage saved addresses
βœ”οΈ Product reviews and ratings

Admin Features

βœ”οΈ Dashboard with statistics
βœ”οΈ Product management (add, edit, delete)
βœ”οΈ Order management (status updates)
βœ”οΈ Feature image management


πŸ“ Project Structure

Frontend

client/
β”œβ”€β”€ public/                 # Static assets
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/             # Images
β”‚   β”œβ”€β”€ components/         # Reusable components
β”‚   β”‚   β”œβ”€β”€ admin-view/     # Admin UI components
β”‚   β”‚   β”œβ”€β”€ auth/           # Authentication UI
β”‚   β”‚   β”œβ”€β”€ common/         # Common UI elements
β”‚   β”‚   β”œβ”€β”€ shopping-view/  # Shopping experience UI
β”‚   β”‚   └── ui/             # UI elements (buttons, cards, etc.)
β”‚   β”œβ”€β”€ config/             # Configuration files
β”‚   β”œβ”€β”€ lib/                # Helper functions
β”‚   β”œβ”€β”€ pages/              # Page components
β”‚   β”‚   β”œβ”€β”€ admin-view/     # Admin pages
β”‚   β”‚   β”œβ”€β”€ auth/           # Login/Register pages
β”‚   β”‚   β”œβ”€β”€ shopping-view/  # Shopping pages
β”‚   β”œβ”€β”€ store/              # Redux store
β”‚   β”‚   └── slices/         # Redux slices
β”‚   β”œβ”€β”€ App.jsx             # Main application
β”‚   β”œβ”€β”€ main.jsx            # Entry point
β”œβ”€β”€ .env                    # Environment variables
β”œβ”€β”€ package.json            # Dependencies
└── vite.config.js          # Vite configuration

Backend

server/
β”œβ”€β”€ controllers/            # API Controllers
β”‚   β”œβ”€β”€ admin/              # Admin controllers
β”‚   β”œβ”€β”€ auth/               # Authentication controllers
β”‚   β”œβ”€β”€ common/             # Common functionalities
β”‚   β”œβ”€β”€ shop/               # Shopping-related logic
β”œβ”€β”€ helpers/                # Utility functions
β”‚   β”œβ”€β”€ cloudinary.js       # Cloudinary integration
β”‚   β”œβ”€β”€ db.js               # MongoDB connection
β”‚   β”œβ”€β”€ paypal.js           # PayPal SDK setup
β”œβ”€β”€ models/                 # Mongoose Models
β”‚   β”œβ”€β”€ Address.js
β”‚   β”œβ”€β”€ Cart.js
β”‚   β”œβ”€β”€ Feature.js
β”‚   β”œβ”€β”€ Order.js
β”‚   β”œβ”€β”€ Product.js
β”‚   β”œβ”€β”€ Review.js
β”‚   β”œβ”€β”€ User.js
β”œβ”€β”€ routes/                 # API Routes
β”œβ”€β”€ .env                    # Environment variables
β”œβ”€β”€ package.json            # Dependencies
└── server.js               # Main server file

πŸ“‘ API Routes

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - Login user
  • POST /api/auth/logout - Logout user
  • GET /api/auth/check-auth - Verify authentication

Products

  • GET /api/products/get - Get all products
  • GET /api/products/get/:id - Get product details
  • POST /api/admin/products/add - Add a product (Admin)
  • PUT /api/admin/products/edit/:id - Edit a product (Admin)
  • DELETE /api/admin/products/delete/:id - Delete a product (Admin)

Cart

  • POST /api/cart/add - Add item to cart
  • GET /api/cart/get - Get cart items
  • PUT /api/cart/update - Update cart item
  • DELETE /api/cart/delete/:id - Remove cart item

Orders

  • POST /api/orders/create - Create order
  • GET /api/orders/get - Get user orders
  • GET /api/admin/orders/get - Get all orders (Admin)
  • PUT /api/admin/orders/update/:id - Update order status (Admin)

Reviews

  • POST /api/reviews/add - Add product review
  • GET /api/reviews/get/:productId - Get product reviews

🎨 Styling & UI Components

  • Tailwind CSS with custom themes
  • Radix UI for headless components
  • Lucide Icons for modern UI
  • Class Variance Authority for dynamic styles

πŸ“¦ State Management

Redux Toolkit slices:

  • Authentication - User info, login status
  • Shopping - Cart, orders, reviews
  • Admin - Product & order management

⚑ Scripts

Frontend

npm run dev      # Start dev server
npm run build    # Build for production
npm run lint     # Run ESLint
npm run preview  # Preview production build

Backend

npm run dev      # Start development server
npm start        # Start production server

πŸ”‘ Admin Credentials

To access the Admin Panel, use the following credentials:


πŸ’³ PayPal Sandbox (Local Payments Only)

⚠️ PayPal payments work only on localhost (not in live deployment).
Use the following PayPal sandbox account to test payments:

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages