Skip to content

EgaleCoder/SCATCH_MART

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

76 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›’ SCATCH MART

Project Banner

A Modern Full-Stack E-Commerce Platform Built with MERN Stack

React Vite Tailwind CSS Node.js License

Live Demo โ€ข Documentation โ€ข Report Bug โ€ข Request Feature


๐Ÿ“‹ Table of Contents


๐ŸŽฏ Overview

SCATCH MART is a cutting-edge, full-featured e-commerce platform built with the MERN stack (MongoDB, Express.js, React, Node.js). This modern web application delivers a seamless online shopping experience with secure authentication, advanced product management, dynamic cart functionality, and a comprehensive admin panel.

The platform features a responsive, mobile-first design built with React 19, Vite, and Tailwind CSS v4, ensuring optimal performance and user experience across all devices.

๐ŸŒŸ Why SCATCH MART?

  • Modern Architecture: Built with React 19 and latest web technologies
  • Performance First: Optimized with code splitting, lazy loading, and skeleton screens
  • Secure: JWT-based authentication with role-based access control
  • Scalable: Modular design with Context API and reducer pattern
  • Developer Friendly: Clean code, ESLint configuration, and comprehensive documentation

๐Ÿ“ธ Screenshots

๐Ÿ  Landing Page & Home

Landing Page

Modern, responsive landing page with hero section and featured products


๐Ÿ›๏ธ Product Catalog

Product Catalog

Advanced product filtering and search with category-based navigation


๐Ÿ“ฆ Product Details

Product Details

Detailed product view with image gallery, specifications, and related products


๐Ÿ›’ Shopping Cart

Shopping Cart

Dynamic cart with quantity management and real-time price calculations


๐Ÿ‘ค User Authentication

Login Page

User Login

Signup Page

User Registration

Forgot Password

Password Recovery

User Profile

User Profile


๐Ÿ” Admin Panel

Admin Dashboard

Comprehensive admin dashboard with analytics and user activity tracking


Admin Features

Product Management

Product Management

Order Management

Order Management


๐Ÿคณ Making Order in 3 steps

Step 1

Fill your Shipping Details

Step 2

Choose Your Payment method

Confirm Order

Order Confirmed

Optimized mobile experience with touch-friendly interface


โœจ Features

๐Ÿ” Authentication & Security

  • Secure JWT-based Authentication with token management
  • User Registration & Login with comprehensive form validation
  • Password Recovery System with OTP verification
  • Role-based Access Control (User/Admin)
  • Session Management with React Context API
  • Protected Routes with authentication guards
  • Secure Password Hashing and validation

๐Ÿ›๏ธ Product Management

  • Product Catalog with advanced filtering and search
  • Product Details with image galleries and specifications
  • Category-based Organization for easy navigation
  • Related Products suggestions
  • Product Reviews and ratings (planned)
  • Real-time Inventory tracking

๐Ÿ›’ Shopping Cart

  • Smart Shopping Cart with dynamic updates
  • Quantity Management with real-time price calculations
  • Cart Persistence across sessions
  • Add/Remove Items with instant feedback
  • Price Summary with tax and shipping calculations
  • Checkout Process (payment integration planned)

๐Ÿ‘จโ€๐Ÿ’ผ Admin Panel

  • Complete Dashboard with analytics and insights
  • Product Management - Add, edit, delete, and view products
  • User Management - View and manage user accounts
  • Analytics Dashboard with user activity tracking
  • Role Verification and access control
  • Bulk Operations for efficient management

๐ŸŽจ UI/UX Features

  • Responsive Design optimized for all devices
  • Mobile-First Approach with touch-friendly interface
  • Skeleton Loading for improved perceived performance
  • Toast Notifications for user feedback
  • Error Boundaries for graceful error handling
  • Smooth Transitions and animations
  • Dark Mode Support (planned)

๐Ÿ› ๏ธ Tech Stack

Frontend

Technology Version Purpose
React 19.x UI Library with concurrent features
Vite 5.x Next-generation build tool
React Router 7.x Advanced routing with nested routes
Tailwind CSS 4.x Utility-first CSS framework
Styled Components 6.x CSS-in-JS library
Material-UI 5.x React component library
Axios 1.6.x HTTP client for API calls

State Management

  • React Context API with useReducer pattern
  • Custom Hooks for API interactions
  • Local Storage/Session Storage for persistence

Development Tools

  • ESLint - Code linting and formatting
  • Vite Dev Server - Fast development experience
  • Git & GitHub - Version control and collaboration

Backend (Separate Repository)

  • Node.js - Runtime environment
  • Express.js - Web application framework
  • MongoDB - NoSQL database
  • Mongoose - ODM for MongoDB
  • JWT - Token-based authentication

๐Ÿ—๏ธ Architecture

System Architecture Diagram

System Architecture

Frontend Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     React Application                    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Pages Layer                                             โ”‚
โ”‚  โ”œโ”€โ”€ Home, Login, Product Details, Cart, Admin Panel   โ”‚
โ”‚                                                           โ”‚
โ”‚  Components Layer                                        โ”‚
โ”‚  โ”œโ”€โ”€ Shared: Navbar, Footer, SearchBar                  โ”‚
โ”‚  โ”œโ”€โ”€ Product: ProductCard, AddToCart, Filters           โ”‚
โ”‚  โ”œโ”€โ”€ Admin: AdminPanel, AddProduct, UserManagement      โ”‚
โ”‚  โ”œโ”€โ”€ Common: SkeletonLoader, ErrorBoundary              โ”‚
โ”‚                                                           โ”‚
โ”‚  State Management Layer (Context API + Reducers)        โ”‚
โ”‚  โ”œโ”€โ”€ AuthContext โ†’ authReducer                          โ”‚
โ”‚  โ”œโ”€โ”€ ProductContext โ†’ productReducer                    โ”‚
โ”‚  โ”œโ”€โ”€ CartContext โ†’ cartReducer                          โ”‚
โ”‚  โ”œโ”€โ”€ AdminContext โ†’ adminReducer                        โ”‚
โ”‚  โ””โ”€โ”€ FilterContext โ†’ filterReducer                      โ”‚
โ”‚                                                           โ”‚
โ”‚  API Layer (Custom Hooks)                               โ”‚
โ”‚  โ”œโ”€โ”€ useAuthApi()                                        โ”‚
โ”‚  โ”œโ”€โ”€ useProductAPI()                                     โ”‚
โ”‚  โ”œโ”€โ”€ useCartApi()                                        โ”‚
โ”‚  โ””โ”€โ”€ useAdminApi()                                       โ”‚
โ”‚                                                           โ”‚
โ”‚  Utils Layer                                             โ”‚
โ”‚  โ”œโ”€โ”€ axios.js (HTTP client config)                      โ”‚
โ”‚  โ”œโ”€โ”€ priceFormat.js (Formatting utilities)              โ”‚
โ”‚  โ””โ”€โ”€ ErrorBoundary.jsx (Error handling)                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
                  Backend REST API

State Management Flow

State Management


๐Ÿš€ Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v18 or higher) - Download
  • npm or yarn - Package manager
  • Git - Version control
  • Backend API - Running instance of the backend server

Installation

  1. Clone the Repository
git clone https://github.com/EgaleCoder/SCATCH_MART.git
cd SCATCH_MART
  1. Install Dependencies
npm install
# or
yarn install
  1. Configure Environment Variables

Create a .env file in the root directory:

cp .env.development .env

Update the .env file with your configuration (see Environment Variables)

  1. Start Development Server
npm run dev
# or
yarn dev

The application will be available at http://localhost:5173

  1. Build for Production
npm run build
# or
yarn build

Quick Start with Docker (Optional)

# Build and run with Docker
docker build -t scatch-mart .
docker run -p 5173:5173 scatch-mart

๐Ÿ“ Project Structure

scatch-mart/
โ”œโ”€โ”€ public/                      # Static assets
โ”‚   โ””โ”€โ”€ assets/                  # Images, icons, etc.
โ”‚
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ Components/              # React components
โ”‚   โ”‚   โ”œโ”€โ”€ Admin/              # Admin-specific components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ActiveUser.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AddProduct.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AdminDetails.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AdminNavbar.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AdminPanel.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Home.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ShowProducts.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Sidebar.jsx
โ”‚   โ”‚   โ”‚
โ”‚   โ”‚   โ”œโ”€โ”€ Common/             # Shared components
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ SkeletonLoader.jsx
โ”‚   โ”‚   โ”‚
โ”‚   โ”‚   โ”œโ”€โ”€ Home/               # Main user interface
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Buttons/
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Pay.jsx
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ViewCart.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ CategoryCard.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Footer.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Navbar.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Profile.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ SearchBar.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ShowProduct/
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ AddToCart.jsx
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ CardLoader.jsx
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ ConfirmationCard.jsx
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ FeatureSection.jsx
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ FillterComponent.jsx
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ MyImg.jsx
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ Navigation.jsx
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ ProductCard.jsx
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ QuantitySelector.jsx
โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ RelatedProducts.jsx
โ”‚   โ”‚   โ”‚
โ”‚   โ”‚   โ””โ”€โ”€ User/
โ”‚   โ”‚       โ””โ”€โ”€ UserProfile.jsx
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ Pages/                  # Route components
โ”‚   โ”‚   โ”œโ”€โ”€ AdminLogin.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ Cart.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ ForgetPassword.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ Home.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ Login.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ PageNotFound.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ ProductDetails.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ ShowProducts.jsx
โ”‚   โ”‚   โ””โ”€โ”€ Signin.jsx
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ context/                # React Context providers
โ”‚   โ”‚   โ”œโ”€โ”€ adminContext.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ authContext.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ cartContext.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ fillterContext.jsx
โ”‚   โ”‚   โ””โ”€โ”€ productContext.jsx
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ Hooks/                  # Custom hooks
โ”‚   โ”‚   โ”œโ”€โ”€ useAdminApi.js
โ”‚   โ”‚   โ”œโ”€โ”€ useAuthApi.js
โ”‚   โ”‚   โ”œโ”€โ”€ useCartApi.js
โ”‚   โ”‚   โ””โ”€โ”€ useProductAPI.js
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ reducer/                # Reducer functions
โ”‚   โ”‚   โ”œโ”€โ”€ adminReducer.js
โ”‚   โ”‚   โ”œโ”€โ”€ authReducer.js
โ”‚   โ”‚   โ”œโ”€โ”€ cartReducer.js
โ”‚   โ”‚   โ”œโ”€โ”€ fillterReducer.js
โ”‚   โ”‚   โ””โ”€โ”€ productReducer.js
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ Routes/
โ”‚   โ”‚   โ””โ”€โ”€ ProtectedRoutes.jsx
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ utils/                  # Utility functions
โ”‚   โ”‚   โ”œโ”€โ”€ axios.js
โ”‚   โ”‚   โ”œโ”€โ”€ ErrorBoundary.jsx
โ”‚   โ”‚   โ””โ”€โ”€ priceFormat.js
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ App.jsx                 # Main app component
โ”‚   โ”œโ”€โ”€ main.jsx                # Entry point
โ”‚   โ”œโ”€โ”€ App.css
โ”‚   โ””โ”€โ”€ index.css
โ”‚
โ”œโ”€โ”€ ProjectSS/                       # Documentation
โ”‚    โ””โ”€โ”€ screenshots/            # Application screenshots
โ”‚
โ”œโ”€โ”€ .env.development            # Development environment variables
โ”œโ”€โ”€ .env.production             # Production environment variables
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ eslint.config.js
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ vite.config.js
โ””โ”€โ”€ LICENSE

๐Ÿ”ง Environment Variables

Create a .env file in the root directory with the following variables:

# API Configuration
VITE_API_BASE_URL=http://localhost:5000/api
VITE_API_TIMEOUT=10000

# Authentication
VITE_JWT_SECRET=your_jwt_secret_key
VITE_JWT_EXPIRY=7d

# Application
VITE_APP_NAME=SCATCH MART
VITE_APP_VERSION=1.0.0
VITE_APP_ENV=development

# Features (Optional)
VITE_ENABLE_ANALYTICS=false
VITE_ENABLE_ERROR_REPORTING=false

# Payment Gateway (Coming Soon)
# VITE_STRIPE_PUBLIC_KEY=your_stripe_public_key
# VITE_RAZORPAY_KEY_ID=your_razorpay_key_id

Environment-specific Configuration

  • Development: .env.development
  • Production: .env.production

๐Ÿ“– Usage Guide

For Users

1. Registration & Login

// Navigate to signup page
/signup

// Fill registration form with:
- Full Name
- Email Address
- Password (min 8 characters)
- Confirm Password

// After registration, login with credentials
/login

2. Browsing Products

  • Visit the home page to see featured products
  • Use the search bar for specific items
  • Apply filters (category, price range, ratings)
  • Click on a product card for detailed view

3. Shopping Cart

  • Add products to cart from product details page
  • Manage quantities in cart
  • Review cart before checkout
  • Proceed to payment (integration coming soon)

4. User Profile

  • Access profile from navbar
  • Update personal information
  • View order history (coming soon)
  • Manage addresses (coming soon)

For Admins

1. Admin Login

// Navigate to admin login
/admin/login

// Use admin credentials provided by system administrator

2. Product Management

  • Add Product: Fill product details form with images
  • Edit Product: Update existing product information
  • Delete Product: Remove products from catalog
  • View Products: See all products with management options

3. User Management

  • View all registered users
  • Monitor user activity
  • Manage user roles and permissions

4. Analytics

  • View user activity metrics
  • Track sales and revenue (coming soon)
  • Monitor popular products
  • Analyze customer behavior

๐Ÿ“ก API Documentation

Authentication Endpoints

// User Registration
POST /api/auth/register
Body: { name, email, password }

// User Login
POST /api/auth/login
Body: { email, password }
Response: { token, user }

// Password Recovery
POST /api/auth/forgot-password
Body: { email }

// Verify OTP
POST /api/auth/verify-otp
Body: { email, otp }

// Reset Password
POST /api/auth/reset-password
Body: { email, newPassword, token }

Product Endpoints

// Get All Products
GET /api/products
Query: ?page=1&limit=10&category=electronics

// Get Single Product
GET /api/products/:id

// Create Product (Admin)
POST /api/products
Headers: { Authorization: Bearer <token> }
Body: { name, description, price, category, images }

// Update Product (Admin)
PUT /api/products/:id
Headers: { Authorization: Bearer <token> }

// Delete Product (Admin)
DELETE /api/products/:id
Headers: { Authorization: Bearer <token> }

Cart Endpoints

// Get User Cart
GET /api/cart
Headers: { Authorization: Bearer <token> }

// Add to Cart
POST /api/cart/add
Headers: { Authorization: Bearer <token> }
Body: { productId, quantity }

// Update Cart Item
PUT /api/cart/update/:itemId
Headers: { Authorization: Bearer <token> }
Body: { quantity }

// Remove from Cart
DELETE /api/cart/remove/:itemId
Headers: { Authorization: Bearer <token> }

// Clear Cart
DELETE /api/cart/clear
Headers: { Authorization: Bearer <token> }

Admin Endpoints

// Get All Users (Admin)
GET /api/admin/users
Headers: { Authorization: Bearer <admin-token> }

// Get User Activity (Admin)
GET /api/admin/analytics/users
Headers: { Authorization: Bearer <admin-token> }

// Delete User (Admin)
DELETE /api/admin/users/:id
Headers: { Authorization: Bearer <admin-token> }

For complete API documentation, visit the API Docs


๐Ÿšข Deployment

Deploy on Vercel

  1. Install Vercel CLI:
npm install -g vercel
  1. Deploy:
vercel
  1. Configure environment variables in Vercel dashboard

Deploy on Netlify

  1. Build the project:
npm run build
  1. Deploy dist folder to Netlify

  2. Configure environment variables in Netlify dashboard

Deploy with Docker

# Dockerfile
FROM node:18-alpine as build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build

FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

Deploy:

docker build -t scatch-mart .
docker run -p 80:80 scatch-mart

๐Ÿ—บ๏ธ Roadmap

Phase 1: Core Features โœ… (Completed)

  • User authentication and authorization
  • Product catalog with filtering
  • Shopping cart functionality
  • Admin panel with product management
  • Responsive design
  • Skeleton loading states

Phase 2: Enhanced Features ๐Ÿšง (In Progress)

  • Payment gateway integration (Stripe/Razorpay)
  • Order management system
  • Product reviews and ratings
  • Email notifications
  • Advanced search with autocomplete
  • Wishlist functionality

Phase 3: Advanced Features ๐Ÿ“… (Planned)

  • Real-time inventory tracking
  • Multi-vendor support
  • Advanced analytics dashboard
  • AI-powered product recommendations
  • PWA features for offline support
  • Multi-language support (i18n)

Phase 4: Optimization & Scale ๐Ÿ”ฎ (Future)

  • Microservices architecture
  • WebSocket integration for real-time updates
  • Advanced caching strategies
  • Mobile app (React Native)
  • Performance monitoring
  • A/B testing framework

๐Ÿค Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

How to Contribute

  1. Fork the Project
  2. Create your Feature Branch
    git checkout -b feature/AmazingFeature
  3. Commit your Changes
    git commit -m 'Add some AmazingFeature'
  4. Push to the Branch
    git push origin feature/AmazingFeature
  5. Open a Pull Request

Contribution Guidelines

  • Follow the existing code style and conventions
  • Write meaningful commit messages
  • Add tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting PR

Code of Conduct

Please read our Code of Conduct before contributing.


๐Ÿ“œ License

Distributed under the MIT License. See LICENSE file for more information.


๐Ÿ“ž Contact

Abhinav Mishra - Developer

Project Link: https://github.com/EgaleCoder/SCATCH_MART


๐Ÿ™ Acknowledgments


๐Ÿ“Š Project Statistics

GitHub Repo Size GitHub Stars GitHub Forks GitHub Issues GitHub Pull Requests GitHub Last Commit


โญ Star this repository if you find it helpful!

SCATCH MART - Where Modern Technology Meets Exceptional Shopping Experience ๐Ÿ›’โœจ

Made with โค๏ธ by Abhinav Mishra

About

Scatch Mart is a MERN stack e-commerce platform with secure authentication, product management, and a dynamic cart. Customers browse products, while admins manage data. The responsive UI, built with React.js and styled-components, is scalable with plans for payment integration and product search.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages