├── my-app ├── src │ ├── components │ │ ├── Admin │ │ │ ├── UpdateOrder.js │ │ │ ├── createproduct.css │ │ │ ├── Dashboard.js │ │ │ ├── UsersList.js │ │ │ ├── AdminSideBar.js │ │ │ ├── OrderList.js │ │ │ ├── ProductList.js │ │ │ └── MainData.js │ │ ├── Products │ │ │ ├── products.css │ │ │ ├── NoProduct.js │ │ │ └── Product.js │ │ ├── layout │ │ │ ├── categories │ │ │ │ ├── category.css │ │ │ │ ├── Category.js │ │ │ │ └── category.json │ │ │ ├── Header │ │ │ │ ├── header.css │ │ │ │ ├── SearchBar.js │ │ │ │ ├── Secondarydropdown.js │ │ │ │ ├── Primarydropdown.js │ │ │ │ └── Header.js │ │ │ ├── MetaData.js │ │ │ ├── Loader │ │ │ │ └── Loader.js │ │ │ └── footer │ │ │ │ ├── Footer.js │ │ │ │ └── footer.json │ │ ├── cart │ │ │ ├── EmptyCart.js │ │ │ ├── Cart.js │ │ │ └── CartItem.js │ │ ├── home │ │ │ ├── Bannerslider │ │ │ │ ├── carousel.css │ │ │ │ └── BannerSlider.js │ │ │ ├── Home.js │ │ │ ├── productslider │ │ │ │ ├── Product.js │ │ │ │ └── Productslider.js │ │ │ └── dealcontainer │ │ │ │ ├── TopProducts.js │ │ │ │ └── dealcontainer.js │ │ ├── productdetials │ │ │ └── Modal.js │ │ ├── orders │ │ │ ├── Order.js │ │ │ ├── PaymentSucess.js │ │ │ ├── OrderSidebar.js │ │ │ ├── Orders.js │ │ │ └── CheckoutItem.js │ │ ├── Wishlist │ │ │ ├── Wishitem.js │ │ │ └── Wishlist.js │ │ ├── Invoice │ │ │ ├── Invoice.js │ │ │ └── InvoiceContent.js │ │ └── User │ │ │ ├── Account.js │ │ │ ├── Sidebar.js │ │ │ ├── Login.js │ │ │ └── Register.js │ ├── man.gif │ ├── assets │ │ ├── banner2.png │ │ ├── banner3.png │ │ ├── banner4.png │ │ ├── bannner.jpg │ │ ├── dslr.webp │ │ ├── empty.webp │ │ ├── banner1.webp │ │ ├── emptywish.png │ │ ├── register.png │ │ ├── register.webp │ │ └── no-products.png │ ├── constants │ │ ├── WishlistConstants.js │ │ ├── CartConstants.js │ │ ├── UserConstants.js │ │ ├── OrderConstants.js │ │ └── ProductConstants.js │ ├── setupTests.js │ ├── Axios.js │ ├── actions │ │ ├── WishActions.js │ │ ├── CartActions.js │ │ ├── UserActions.js │ │ ├── OrderActions.js │ │ └── ProductActions.js │ ├── utils │ │ └── CategorySearch.js │ ├── reportWebVitals.js │ ├── index.css │ ├── Routes │ │ └── ProtectedRoutes.js │ ├── Reducers │ │ ├── WishReducer.js │ │ ├── CartReducer.js │ │ ├── UserReducer.js │ │ ├── OrderReducer.js │ │ └── ProductReducer.js │ ├── index.js │ ├── Store.js │ └── App.js ├── public │ ├── robots.txt │ ├── favicon.ico │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── index.html ├── tailwind.config.js ├── .gitignore ├── package.json └── README.md ├── server ├── .gitignore ├── middleware │ ├── aysnchandler.js │ ├── error.js │ └── auth.js ├── vercel.json ├── utils │ ├── errorhandler.js │ ├── jsonwebtoken.js │ ├── apifeatures.js │ └── sendEmails.js ├── config │ ├── redis.js │ ├── example.env │ └── database.js ├── routes │ ├── paymentroute.js │ ├── orderroutes.js │ ├── userroutes.js │ └── productroutes.js ├── models │ ├── usermodel.js │ ├── ProductModel.js │ └── ordermodel.js ├── controllers │ ├── paymentcontroller.js │ ├── ordercontroller.js │ ├── usercontroller.js │ └── productcontroller.js ├── app.js └── package.json └── README.md /my-app/src/components/Admin/UpdateOrder.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /config/app.env -------------------------------------------------------------------------------- /my-app/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /my-app/src/man.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maheshpatil132/flipkart-clone/HEAD/my-app/src/man.gif -------------------------------------------------------------------------------- /my-app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maheshpatil132/flipkart-clone/HEAD/my-app/public/favicon.ico -------------------------------------------------------------------------------- /my-app/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maheshpatil132/flipkart-clone/HEAD/my-app/public/logo192.png -------------------------------------------------------------------------------- /my-app/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maheshpatil132/flipkart-clone/HEAD/my-app/public/logo512.png -------------------------------------------------------------------------------- /my-app/src/assets/banner2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maheshpatil132/flipkart-clone/HEAD/my-app/src/assets/banner2.png -------------------------------------------------------------------------------- /my-app/src/assets/banner3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maheshpatil132/flipkart-clone/HEAD/my-app/src/assets/banner3.png -------------------------------------------------------------------------------- /my-app/src/assets/banner4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maheshpatil132/flipkart-clone/HEAD/my-app/src/assets/banner4.png -------------------------------------------------------------------------------- /my-app/src/assets/bannner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maheshpatil132/flipkart-clone/HEAD/my-app/src/assets/bannner.jpg -------------------------------------------------------------------------------- /my-app/src/assets/dslr.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maheshpatil132/flipkart-clone/HEAD/my-app/src/assets/dslr.webp -------------------------------------------------------------------------------- /my-app/src/assets/empty.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maheshpatil132/flipkart-clone/HEAD/my-app/src/assets/empty.webp -------------------------------------------------------------------------------- /my-app/src/assets/banner1.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maheshpatil132/flipkart-clone/HEAD/my-app/src/assets/banner1.webp -------------------------------------------------------------------------------- /my-app/src/assets/emptywish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maheshpatil132/flipkart-clone/HEAD/my-app/src/assets/emptywish.png -------------------------------------------------------------------------------- /my-app/src/assets/register.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maheshpatil132/flipkart-clone/HEAD/my-app/src/assets/register.png -------------------------------------------------------------------------------- /my-app/src/assets/register.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maheshpatil132/flipkart-clone/HEAD/my-app/src/assets/register.webp -------------------------------------------------------------------------------- /my-app/src/assets/no-products.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maheshpatil132/flipkart-clone/HEAD/my-app/src/assets/no-products.png -------------------------------------------------------------------------------- /my-app/src/constants/WishlistConstants.js: -------------------------------------------------------------------------------- 1 | export const AddWishItem = "AddWishItem" 2 | export const RemoveWishItem = "AddWishItem" -------------------------------------------------------------------------------- /server/middleware/aysnchandler.js: -------------------------------------------------------------------------------- 1 | module.exports = (thefunc)=>(req,res,next)=>{ 2 | Promise.resolve(thefunc(req,res,next)).catch(next) 3 | } -------------------------------------------------------------------------------- /my-app/src/components/Products/products.css: -------------------------------------------------------------------------------- 1 | .products{ 2 | display: grid; 3 | grid-template-columns: repeat( auto-fit , minmax(15rem,1fr)); 4 | 5 | } -------------------------------------------------------------------------------- /my-app/src/components/layout/categories/category.css: -------------------------------------------------------------------------------- 1 | .menu:hover .submenu{ 2 | display: flex; 3 | flex-direction: column; 4 | } 5 | .submenu{ 6 | display: none; 7 | } -------------------------------------------------------------------------------- /server/vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "name": "music-album", 4 | "builds": [ 5 | { "src": "app.js", "use": "@vercel/node" } 6 | ], 7 | "routes": [ 8 | { "src": "/(.*)", "dest": "/app.js" } 9 | ] 10 | } -------------------------------------------------------------------------------- /my-app/src/components/Admin/createproduct.css: -------------------------------------------------------------------------------- 1 | .img:hover .delete{ 2 | display: flex; 3 | } 4 | 5 | 6 | .delete{ 7 | box-shadow:0px 0px 50px 100px rgba(0, 0, 0, 0.349); 8 | background: rgba(0, 0, 0, 0.452); 9 | display: none; 10 | } -------------------------------------------------------------------------------- /my-app/src/constants/CartConstants.js: -------------------------------------------------------------------------------- 1 | export const AddToCart = "AddToCart" 2 | export const RemoveToCart = "RemoveToCart" 3 | export const ClearCartItems = "ClearCartItems" 4 | export const ClearError = "ClearError" 5 | export const Save_ShipingInfo = "Save_ShipingInfo" -------------------------------------------------------------------------------- /my-app/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /server/utils/errorhandler.js: -------------------------------------------------------------------------------- 1 | class ErrorHandler extends Error { 2 | constructor(message, status){ 3 | super(message); 4 | this.status = status 5 | 6 | Error.captureStackTrace(this,this.constructor) 7 | } 8 | 9 | } 10 | 11 | module.exports = ErrorHandler -------------------------------------------------------------------------------- /my-app/src/Axios.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | 3 | // For Production, Create .env file and put your backend api URL in that, OR use localhost url 4 | export const Axios = axios.create({ 5 | baseURL : process.env.REACT_APP_BACKEND_URL, 6 | // baseURL : 'http://localhost:4000/', 7 | withCredentials:true 8 | }) -------------------------------------------------------------------------------- /my-app/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: [ 4 | "./src/**/*.{js,jsx,ts,tsx}", 5 | ], 6 | theme: { 7 | extend: { 8 | colors:{ 9 | 'primary':'#2874f0', 10 | 'secondary':'#172337' 11 | } 12 | }, 13 | }, 14 | plugins: [], 15 | } 16 | -------------------------------------------------------------------------------- /my-app/src/actions/WishActions.js: -------------------------------------------------------------------------------- 1 | import { AddWishItem } from "../constants/WishlistConstants" 2 | 3 | 4 | export const AddWish = ( data ) => (dispatch , getState) =>{ 5 | dispatch({ 6 | type : AddWishItem, 7 | payload : data 8 | }) 9 | 10 | localStorage.setItem("wishitems" , JSON.stringify(getState().WishList.wishItems)) 11 | } -------------------------------------------------------------------------------- /my-app/src/components/layout/Header/header.css: -------------------------------------------------------------------------------- 1 | /* header css file */ 2 | 3 | 4 | .dropdown::before{ 5 | content: ''; 6 | height: 20px; 7 | width: 20px; 8 | background-color: white; 9 | transform: rotate(45deg); 10 | position: absolute; 11 | left: 44%; 12 | top: -.5rem; 13 | border-radius: .01rem; 14 | z-index: -1; 15 | } 16 | -------------------------------------------------------------------------------- /my-app/src/components/layout/MetaData.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {Helmet} from "react-helmet"; 3 | 4 | const MetaData = ({title}) => { 5 | return ( 6 |
{e}
33 | ) 34 | }) 35 | } 36 |Dear ${username},
21 |Thank you for signing up with Flipkart Clone. To 22 | ensure the security of your account and to enjoy 23 | the full benefits of our services, please verify 24 | your email address by clicking the link below: 25 |
26 | ` 27 | } 28 | 29 | 30 | exports.sendEmail = async ( email , username )=>{ 31 | 32 | // Email content 33 | const mailOptions = { 34 | from: 'maheshpatilhp132@gmail.com', 35 | to: 'maheshpatilkg132@gmail.com', 36 | subject: 'Please Verify your Email Address', 37 | html: htmlContent(username) 38 | }; 39 | 40 | // Send the email 41 | transporter.sendMail(mailOptions, function (error, info) { 42 | if (error) { 43 | console.error('Error sending email: ' + error); 44 | } else { 45 | console.log('Email sent: ' + info.response); 46 | } 47 | }); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /my-app/src/components/Products/Product.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import StarIcon from '@mui/icons-material/Star'; 3 | 4 | 5 | const Product = ({data}) => { 6 | return ( 7 |
21 | Date: {invoiceData.date}
24 |From : {invoiceData.from}
29 |To : {invoiceData.to}
30 |Address : {invoiceData && invoiceData.shiping && invoiceData.shiping.address}
36 |pincode : {invoiceData && invoiceData.shiping && invoiceData.shiping.pincode}
37 |state : {invoiceData && invoiceData.shiping && invoiceData.shiping.state}
38 |country : {invoiceData && invoiceData.shiping && invoiceData.shiping.country}
39 |Payment Id : {invoiceData && invoiceData.paymentinfo && invoiceData.paymentinfo.id}
44 |Payment status : {invoiceData && invoiceData.paymentinfo && invoiceData.paymentinfo.status}
45 | 46 || Item | 53 |Quantity | 54 |Price | 55 |Total | 56 |
|---|---|---|---|
| {item.name} | 62 |{item.quantity} | 63 |Rs.{item.price} | 64 |Rs.{item.quantity * item.price} | 65 |
| 69 | | 70 | | Tax | 71 |Rs.{ invoiceData.shipingprice} | 72 |
| 75 | | 76 | | Delivery | 77 |Rs.{invoiceData.taxprice} | 78 |
| 81 | | 82 | | Total | 83 |84 | Rs.{totalamount + invoiceData.taxprice + invoiceData.shipingprice} 85 | | 86 |
93 | Total: ${calculateTotal(invoiceData.items)}
99 |