├── .env ├── .eslintrc.cjs ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── docs.md │ └── feature_request.md └── workflows │ ├── auto-comment-on-pr-merge.yml │ └── greetings.yml ├── .gitignore ├── .vscode └── settings.json ├── CODE_OF_CONDUCT ├── CONTRIBUITING.md ├── README.md ├── config.env ├── dist ├── assets │ ├── banner_kids-C6fj0c76.png │ ├── banner_mens-PgqiXLwq.png │ ├── banner_women-BQd59sB_.png │ ├── exclusive_image-bt6CSZNE.png │ ├── hero2-o9_St3ke.jpg │ ├── index-ZnNZpM0-.css │ ├── index-pXWPBzfy.js │ ├── product_1-GUEEYTIC.png │ ├── product_10-2Nl_XECs.png │ ├── product_11-Xy9Rj3SK.png │ ├── product_12-G08opUrt.png │ ├── product_13-rGeN1LiX.png │ ├── product_14-HCSYfJ2r.png │ ├── product_15-_NeimwDZ.png │ ├── product_16-UK1F0lFR.png │ ├── product_17-FaCkGEZ3.png │ ├── product_18-2kDGJwTn.png │ ├── product_19-kLK4N9rs.png │ ├── product_2-dy3F06M0.png │ ├── product_20-jsIwK71V.png │ ├── product_21-KcxO7bZL.png │ ├── product_22-JoLbAceR.png │ ├── product_23-r2fN05fz.png │ ├── product_24-ZmAA0lze.png │ ├── product_25-aChXG8-c.png │ ├── product_26-zRCKzXXt.png │ ├── product_27-Yfay04_o.png │ ├── product_28-RsTEJnLA.png │ ├── product_29-eZLxGKeh.png │ ├── product_3-_afa8pZE.png │ ├── product_30-_pFrpM4Q.png │ ├── product_31-iAMH-fJB.png │ ├── product_32-CyRC6Jur.png │ ├── product_33-IfEocB95.png │ ├── product_34-h5qGMUDj.png │ ├── product_35-8pYrG3Bo.png │ ├── product_36-j1BwQLL9.png │ ├── product_4-Z2Y1MIkX.png │ ├── product_5-TY_if21P.png │ ├── product_6-A5JpRwa6.png │ ├── product_7-l0IetaTg.png │ ├── product_8-U60BzIcC.png │ └── product_9-qerwHpJY.png ├── index.html └── vite.svg ├── index.html ├── learn.md ├── package-lock.json ├── package.json ├── postcss.config.js ├── public └── vite.svg ├── server ├── .gitignore ├── config.env.sample ├── config │ ├── DBconnect.js │ └── JWTAuthentication.js ├── controllers │ ├── auth │ │ └── authController.js │ ├── kids-controller.js │ ├── loginController.js │ ├── mens-controller.js │ ├── signupController.js │ └── womens-controller.js ├── index.js ├── middlewares │ └── auth-helper.js ├── models │ ├── Kids-model.js │ ├── Mens-model.js │ ├── OtpModel.js │ ├── Womens-model.js │ └── userModel.js ├── package.json ├── routes │ ├── Stripe-route.js │ ├── auth │ │ └── authRoutes.js │ ├── kids-route.js │ ├── loginRoute.js │ ├── mens-route.js │ ├── signupRoute.js │ └── womens-route.js └── utils │ ├── decodeJwtToken.js │ ├── generateJwtToken.js │ ├── generateOTP.js │ └── sendEmail.js ├── src ├── App.jsx ├── Components │ ├── Breadcrumb.jsx │ ├── CartItems.jsx │ ├── CheckNow.jsx │ ├── Comment.jsx │ ├── DarkModeToggle.jsx │ ├── DescriptionBox.jsx │ ├── Footer.jsx │ ├── Hero.jsx │ ├── Item.jsx │ ├── Navbar.jsx │ ├── NewCollection.jsx │ ├── Newsletter.jsx │ ├── Offers.jsx │ ├── Payment.jsx │ ├── Popular.jsx │ ├── ProductDisplay.jsx │ ├── RelatedProduct.jsx │ ├── SavedItems.jsx │ └── StarRating.jsx ├── Context │ ├── SavedContext.jsx │ └── ShopContext.jsx ├── Pages │ ├── About.jsx │ ├── Cart.jsx │ ├── Contact.jsx │ ├── Login.jsx │ ├── NotFound.jsx │ ├── PaymentSucces.jsx │ ├── Product.jsx │ ├── Search.jsx │ ├── Shop.jsx │ ├── ShopCategory.jsx │ ├── Signup.jsx │ ├── Success.jsx │ ├── WishList.jsx │ └── paymentfail.jsx ├── assets │ ├── 50504080326686.webp │ ├── D-1.0-UHP-16052024-MainBannerDailyChanging-Z1-P1-BrandDay-DNMX-Flat60.avif │ ├── D-1.0-UHP-16052024-MainBannerDailyChanging-Z1-P7-AX-SuperDry-min40-extra750.avif │ ├── D-1.0-UHP-16052024-mainbanner-z1-p1-iconicsale-4080HP Desktop.avif │ ├── Empty_Cart_img.png │ ├── Hero.jpg │ ├── all_product.js │ ├── arrow.png │ ├── austin-distel-7uoMmzPd2JA-unsplash.jpg │ ├── averie-woodard-4nulm-JUYFo-unsplash.jpg │ ├── banner_kids.png │ ├── banner_mens.png │ ├── banner_women.png │ ├── breadcrum_arrow.png │ ├── cart_cross_icon.png │ ├── cart_icon.png │ ├── cart_product_icon.png │ ├── chat_icon.png │ ├── data.js │ ├── dennys-lennon-DCslPWw7Bs0-unsplash.jpg │ ├── dropdown_icon.png │ ├── email_icon.png │ ├── exclusive_image.png │ ├── filled_wishlist.png │ ├── google.png │ ├── hand_icon.png │ ├── hero1.jpg │ ├── hero2.jpg │ ├── hero_image.png │ ├── instagram_icon.png │ ├── logo.png │ ├── logo_big.png │ ├── mubariz-mehdizadeh-t3zrEm88ehc-unsplash.jpg │ ├── new_collections.js │ ├── outlined_wishlist.png │ ├── p1_product.png │ ├── p1_product_i1.png │ ├── p1_product_i2.png │ ├── p1_product_i3.png │ ├── p1_product_i4.png │ ├── phone_icon.png │ ├── pintester_icon.png │ ├── product_1.png │ ├── product_10.png │ ├── product_11.png │ ├── product_12.png │ ├── product_13.png │ ├── product_14.png │ ├── product_15.png │ ├── product_16.png │ ├── product_17.png │ ├── product_18.png │ ├── product_19.png │ ├── product_2.png │ ├── product_20.png │ ├── product_21.png │ ├── product_22.png │ ├── product_23.png │ ├── product_24.png │ ├── product_25.png │ ├── product_26.png │ ├── product_27.png │ ├── product_28.png │ ├── product_29.png │ ├── product_3.png │ ├── product_30.png │ ├── product_31.png │ ├── product_32.png │ ├── product_33.png │ ├── product_34.png │ ├── product_35.png │ ├── product_36.png │ ├── product_4.png │ ├── product_5.png │ ├── product_6.png │ ├── product_7.png │ ├── product_8.png │ ├── product_9.png │ ├── react.svg │ ├── star_dull_icon.png │ ├── star_icon.png │ ├── store.png │ ├── whatsapp_icon.png │ └── wishlist_icon.png ├── index.css └── main.jsx ├── tailwind.config.js ├── vercel.json └── vite.config.js /.env: -------------------------------------------------------------------------------- 1 | VITE_BACKEND_URL=http://localhost:7000/api/v1 2 | VITE_GOOGLE_CLIENT_ID=430349486581-523p7m5mlh1mjjne5h3h3q2t0hd0okeg.apps.googleusercontent.com -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { browser: true, es2020: true }, 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:react/recommended', 7 | 'plugin:react/jsx-runtime', 8 | 'plugin:react-hooks/recommended', 9 | ], 10 | ignorePatterns: ['dist', '.eslintrc.cjs'], 11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, 12 | settings: { react: { version: '18.2' } }, 13 | plugins: ['react-refresh'], 14 | rules: { 15 | 'react-refresh/only-export-components': [ 16 | 'warn', 17 | { allowConstantExport: true }, 18 | ], 19 | }, 20 | } 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 🪲 Bug Report 3 | about: Create a bug report to help us resolving the bug 4 | title: '🪲[Bug]: ' 5 | labels: 'bug' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/docs.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 📝 Documentation 3 | about: Propose changes and improvements to ScrapQuest Docs. 4 | title: '📝[Docs]: ' 5 | labels: 'enhancement' 6 | assignees: '' 7 | --- 8 | 9 | **What Docs changes are you proposing?** 10 | Provide a clear description of the changes you're proposing for the documentation. Are you suggesting corrections, clarifications, additions, or updates? 11 | 12 | **Why do the Docs need this improvement? What is the motivation for this change? How will this change benefit the community?** 13 | Explain the motivation behind the proposed changes and how they will benefit the community or users of the documentation. 14 | 15 | **Describe the solution you'd like** 16 | Provide a clear and concise description of the changes you'd like to see implemented in the documentation. 17 | 18 | **Describe alternatives you've considered** 19 | If you've thought about alternative approaches or solutions, briefly describe them here. 20 | 21 | **Additional context** 22 | Add any additional context, examples, or screenshots related to the proposed documentation changes. 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 💡 Feature Request 3 | about: Suggest an interesting feature idea for this project 4 | title: '💡[FEATURE]: ' 5 | labels: 'enhancement' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. -------------------------------------------------------------------------------- /.github/workflows/auto-comment-on-pr-merge.yml: -------------------------------------------------------------------------------- 1 | name: Auto Comment on PR Merge 2 | 3 | on: 4 | pull_request: 5 | types: [closed] 6 | 7 | jobs: 8 | comment: 9 | if: github.event.pull_request.merged == true 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Add Comment to Merged PR 14 | env: 15 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 16 | run: | 17 | curl -X POST \ 18 | -H "Authorization: token $GITHUB_TOKEN" \ 19 | -H "Accept: application/vnd.github.v3+json" \ 20 | -d '{"body":"🎉 Your pull request has been successfully merged! 🎉 Thank you for your contribution to our project. Your efforts are greatly appreciated. Keep up the fantastic work! 🚀"}' \ 21 | "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" 22 | -------------------------------------------------------------------------------- /.github/workflows/greetings.yml: -------------------------------------------------------------------------------- 1 | name: 'Greetings' 2 | 3 | on: 4 | fork: 5 | push: 6 | branches: [main] 7 | issues: 8 | types: [opened] 9 | pull_request_target: 10 | types: [opened] 11 | 12 | jobs: 13 | welcome: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v1 17 | - uses: EddieHubCommunity/gh-action-community/src/welcome@main 18 | with: 19 | github-token: ${{ secrets.GITHUB_TOKEN }} 20 | issue-message: | 21 | Congratulations, @${{ github.actor }}! 🎉 Thank you for creating your issue. Your contribution is greatly appreciated and we look forward to working with you to resolve the issue. Keep up the great work! 22 | pr-message: | 23 | Great job, @${{ github.actor }}! 🎉 Thank you for submitting your pull request. Your contribution is valuable and we appreciate your efforts to improve our project. 24 | footer: 'We will promptly review your changes and offer feedback. Keep up the excellent work! Kindly remember to check our [contributing guidelines](https://github.com/mohitparmar1/Shopy/blob/main/README.md)' -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "liveServer.settings.port": 5501 3 | } -------------------------------------------------------------------------------- /CODE_OF_CONDUCT: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | 1. **Respectful Communication**: All interactions within the platform, including comments, reviews, and messages, should be conducted with respect and courtesy towards other users and staff members. 4 | 5 | 2. **Honesty and Integrity**: Users are expected to provide accurate information about products and services, including pricing, availability, and specifications. Deceptive practices such as false advertising or misleading descriptions are strictly prohibited. 6 | 7 | 3. **Fair Competition**: Competition among sellers should be fair and transparent. Any attempts to manipulate search rankings, ratings, or reviews to gain an unfair advantage will not be tolerated. 8 | 9 | 4. **Intellectual Property Rights**: Users must respect the intellectual property rights of others, including trademarks, copyrights, and patents. Unauthorized use of copyrighted material or counterfeit goods is strictly prohibited. 10 | 11 | 5. **Prohibited Content**: Content that is illegal, obscene, defamatory, or discriminatory is not allowed on the platform. This includes but is not limited to hate speech, harassment, and content that promotes violence or illegal activities. 12 | 13 | 6. **Customer Service Standards**: Sellers are expected to provide prompt and courteous customer service to address any inquiries, complaints, or issues raised by users. Clear policies regarding returns, refunds, and exchanges should be communicated to customers. 14 | 15 | 7. **Security**: Users are responsible for maintaining the security of their accounts and should report any suspicious activity or security breaches immediately. 16 | 17 | By using this platform, all users agree to abide by this code of conduct and contribute to creating a positive environment for everyone. 18 | -------------------------------------------------------------------------------- /CONTRIBUITING.md: -------------------------------------------------------------------------------- 1 |

✨ Contributors Guide ✨

2 |

Welcome to Our project! 😍
We greatly appreciate your willingness to contribute.😊
This guide will help you get started with the project and make your contributions.

3 | 4 | ![Line](https://user-images.githubusercontent.com/85225156/171937799-8fc9e255-9889-4642-9c92-6df85fb86e82.gif) 5 | 6 | 7 | This document provides instructions on how to set up and build the project locally. 8 | This project is a clothing order website that allows user to add products , list their own products, make dashboard of seller 9 | 10 | ## Prerequisites 11 | 12 | Before you begin, ensure you have the following installed on your local machine: 13 | 14 | - Node.js (v14.x or later) 15 | - npm (Node Package Manager v6.x or later) 16 | 17 | ## Table of Contents 18 | - [Setup](#Setup) 19 | - [Contributing Guidelines](#contributing-guidelines) 20 | - [Getting Started](#getting-started) 21 | - [Issue Management](#issue-management) 22 | - [Communication and Collaboration](#communication-and-collaboration) 23 | - [Deadline and Completion](#deadline-and-completion) 24 | - [Quality and Learning](#quality-and-learning) 25 | 26 | ## Setup 27 | 28 | Follow these steps to set up the project locally: 29 | 30 | 1. Clone the repository to your local machine: 31 | 32 | ```bash 33 | git clone https://github.com/mohitparmar1/Shopy.git 34 | ``` 35 | 36 | 2. Navigate to the project directory: 37 | 38 | ```bash 39 | cd SHOPY 40 | ``` 41 | 3. Install project dependencies: 42 | 43 | ```bash 44 | npm install 45 | ``` 46 | 47 | ```bash 48 | npm install vite 49 | ``` 50 | 51 | 4. Start the development server and run the app 52 | 53 | ```bash 54 | npm run dev 55 | ``` 56 | 57 | ## Contributing Guidelines 58 | 59 | Before diving into the learning resources, please familiarize yourself with the following contributing guidelines: 60 | 61 | - Participants/contributors must comment on issues they wish to work on. 62 | - Issues will be assigned on a first-come, first-serve basis by mentors or the Project Administrator (PA). 63 | - Participants can open new issues using the provided template, but these need verification and labeling by a mentor or PA. 64 | - Ensure issues are assigned to you before starting work. 65 | - Each participant can work on a maximum of one issue at a time. 66 | - Don't work on issues already assigned to others. 67 | - Discuss issues with the team before starting work. 68 | - Explain your approach to solving any issue in the comments for better understanding. 69 | - Pull requests will be merged after review by a mentor or PA. 70 | - Create PRs from branches other than `main`. 71 | - Include a descriptive summary of your work in the PR description. 72 | - Use the format `Fixes: issue number` in your commit message when creating a pull request. 73 | - Complete assigned issues within the specified deadline. Failure to do so may result in reassignment. 74 | - Follow project guidelines and coding style. 75 | - Aim for structured and optimized code. 76 | - Mistakes are allowed and part of the learning process! 77 | 78 | ## Getting Started 79 | 80 | To contribute to the project, follow these steps: 81 | 82 | 1. **Fork the Repository**: Start by forking the repository to your GitHub account. 83 | 2. **Clone the Repository**: Clone your forked repository to your local machine. 84 | 3. **Choose an Issue**: Comment on an issue you'd like to work on or open a new one following the guidelines. 85 | 4. **Set Up Development Environment**: Refer to the project's development guidelines for setting up your development environment. 86 | 5. **Start Working**: Once the issue is assigned to you, start working on it following your chosen approach. 87 | 6. **Submit a Pull Request**: After completing your work, submit a pull request from your branch for review. 88 | 89 | ## Issue Management 90 | 91 | Issues are managed as follows: 92 | 93 | - Participants must comment on issues they wish to work on. 94 | - Issues will be assigned on a first-come, first-serve basis. 95 | - Participants can open new issues using the provided template, but these need verification and labeling by a mentor or PA. 96 | - Ensure issues are assigned to you before starting work. 97 | - Each participant can work on a maximum of one issue at a time. 98 | - Don't work on issues already assigned to others. 99 | - Discuss issues with the team before starting work. 100 | 101 | ## Communication and Collaboration 102 | 103 | Effective communication and collaboration are crucial for successful contributions: 104 | 105 | - Discuss issues with the team before starting work. 106 | - Explain your approach to solving any issue in the comments for better understanding. 107 | 108 | ## Deadline and Completion 109 | 110 | Ensure timely completion of assigned tasks: 111 | 112 | - Complete assigned issues within the specified deadline. 113 | - Failure to meet the deadline may result in reassignment. 114 | 115 | ## Quality and Learning 116 | 117 | Learnings: 118 | 119 | - Client-Side Development: Understanding how to build a user-friendly interface using React and TailwindCSS. 120 | - Server-Side Development: Utilizing Node.js and Express for server-side logic and API integrations. 121 | - Git Workflow: Understanding the Git workflow for contributing to open-source projects, including forking, branching, committing, and creating pull requests. 122 | 123 | Focus on quality and continuous learning: 124 | 125 | - Follow project guidelines and coding style. 126 | - Aim for structured and optimized code. 127 | - Mistakes are allowed and are a part of the learning process! 128 | 129 | Thank you for your contribution!! 130 | 131 | ![Line](https://user-images.githubusercontent.com/85225156/171937799-8fc9e255-9889-4642-9c92-6df85fb86e82.gif) 132 | 133 |

Need more help? 🤔

134 |

135 | You can refer to the following articles on basics of Git and Github and also contact the Project Mentors, in case you are stuck:
136 | How to create a Issue
137 | Forking a Repo
138 | Cloning a Repo
139 | How to create a Pull Request
140 | Getting started with Git and GitHub
141 |

142 | 143 |

Tip from us 😇

144 |

Learning and understanding take time, so don't worry at all. We have full confidence in you. You've got this!!! 💪

145 |

Show some  ❤️  by  🌟  this repository!

146 | 147 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Learn 2 | 3 | This document provides instructions on how to set up and build the project locally. 4 | This project is a clothing order website that allows user to add products , list their own products, make dashboard of seller 5 | 6 | ## Prerequisites 7 | 8 | Before you begin, ensure you have the following installed on your local machine: 9 | 10 | - Node.js (v14.x or later) 11 | - npm (Node Package Manager v6.x or later) 12 | 13 | ## Table of Contents 14 | - [Setup](#Setup) 15 | - [Contributing Guidelines](#contributing-guidelines) 16 | - [Getting Started](#getting-started) 17 | - [Issue Management](#issue-management) 18 | - [Communication and Collaboration](#communication-and-collaboration) 19 | - [Deadline and Completion](#deadline-and-completion) 20 | - [Quality and Learning](#quality-and-learning) 21 | 22 | ## Setup 23 | 24 | Follow these steps to set up the project locally: 25 | 26 | 1. Clone the repository to your local machine: 27 | 28 | ```bash 29 | git clone https://github.com/mohitparmar1/Shopy.git 30 | ``` 31 | 32 | 2. Navigate to the project directory: 33 | 34 | ```bash 35 | cd SHOPY 36 | ``` 37 | 3. Install project dependencies: 38 | 39 | ```bash 40 | npm install 41 | ``` 42 | 43 | ```bash 44 | npm install vite 45 | ``` 46 | 47 | 4. Start the development server and run the app 48 | 49 | ```bash 50 | npm run dev 51 | ``` 52 | 53 | ## Contributing Guidelines 54 | 55 | Before diving into the learning resources, please familiarize yourself with the following contributing guidelines: 56 | 57 | - Participants/contributors must comment on issues they wish to work on. 58 | - Issues will be assigned on a first-come, first-serve basis by mentors or the Project Administrator (PA). 59 | - Participants can open new issues using the provided template, but these need verification and labeling by a mentor or PA. 60 | - Ensure issues are assigned to you before starting work. 61 | - Each participant can work on a maximum of one issue at a time. 62 | - Don't work on issues already assigned to others. 63 | - Discuss issues with the team before starting work. 64 | - Explain your approach to solving any issue in the comments for better understanding. 65 | - Pull requests will be merged after review by a mentor or PA. 66 | - Create PRs from branches other than `main`. 67 | - Include a descriptive summary of your work in the PR description. 68 | - Use the format `Fixes: issue number` in your commit message when creating a pull request. 69 | - Complete assigned issues within the specified deadline. Failure to do so may result in reassignment. 70 | - Follow project guidelines and coding style. 71 | - Aim for structured and optimized code. 72 | - Mistakes are allowed and part of the learning process! 73 | 74 | ## Getting Started 75 | 76 | To contribute to the project, follow these steps: 77 | 78 | 1. **Fork the Repository**: Start by forking the repository to your GitHub account. 79 | 2. **Clone the Repository**: Clone your forked repository to your local machine. 80 | 3. **Choose an Issue**: Comment on an issue you'd like to work on or open a new one following the guidelines. 81 | 4. **Set Up Development Environment**: Refer to the project's development guidelines for setting up your development environment. 82 | 5. **Start Working**: Once the issue is assigned to you, start working on it following your chosen approach. 83 | 6. **Submit a Pull Request**: After completing your work, submit a pull request from your branch for review. 84 | 85 | ## Issue Management 86 | 87 | Issues are managed as follows: 88 | 89 | - Participants must comment on issues they wish to work on. 90 | - Issues will be assigned on a first-come, first-serve basis. 91 | - Participants can open new issues using the provided template, but these need verification and labeling by a mentor or PA. 92 | - Ensure issues are assigned to you before starting work. 93 | - Each participant can work on a maximum of one issue at a time. 94 | - Don't work on issues already assigned to others. 95 | - Discuss issues with the team before starting work. 96 | 97 | ## Communication and Collaboration 98 | 99 | Effective communication and collaboration are crucial for successful contributions: 100 | 101 | - Discuss issues with the team before starting work. 102 | - Explain your approach to solving any issue in the comments for better understanding. 103 | 104 | ## Deadline and Completion 105 | 106 | Ensure timely completion of assigned tasks: 107 | 108 | - Complete assigned issues within the specified deadline. 109 | - Failure to meet the deadline may result in reassignment. 110 | 111 | ## Quality and Learning 112 | 113 | Learnings: 114 | 115 | - Client-Side Development: Understanding how to build a user-friendly interface using React and TailwindCSS. 116 | - Server-Side Development: Utilizing Node.js and Express for server-side logic and API integrations. 117 | - Git Workflow: Understanding the Git workflow for contributing to open-source projects, including forking, branching, committing, and creating pull requests. 118 | 119 | Focus on quality and continuous learning: 120 | 121 | - Follow project guidelines and coding style. 122 | - Aim for structured and optimized code. 123 | - Mistakes are allowed and are a part of the learning process! 124 | -------------------------------------------------------------------------------- /config.env: -------------------------------------------------------------------------------- 1 | 2 | ./package-lock.json 3 | 4 | -------------------------------------------------------------------------------- /dist/assets/banner_kids-C6fj0c76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/banner_kids-C6fj0c76.png -------------------------------------------------------------------------------- /dist/assets/banner_mens-PgqiXLwq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/banner_mens-PgqiXLwq.png -------------------------------------------------------------------------------- /dist/assets/banner_women-BQd59sB_.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/banner_women-BQd59sB_.png -------------------------------------------------------------------------------- /dist/assets/exclusive_image-bt6CSZNE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/exclusive_image-bt6CSZNE.png -------------------------------------------------------------------------------- /dist/assets/hero2-o9_St3ke.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/hero2-o9_St3ke.jpg -------------------------------------------------------------------------------- /dist/assets/index-ZnNZpM0-.css: -------------------------------------------------------------------------------- 1 | *,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.-top-2{top:-.5rem}.left-0{left:0}.right-\[10px\]{right:10px}.top-0{top:0}.top-28{top:7rem}.top-32{top:8rem}.top-44{top:11rem}.top-80{top:20rem}.z-10{z-index:10}.m-2{margin:.5rem}.m-5{margin:1.25rem}.m-auto{margin:auto}.mx-10{margin-left:2.5rem;margin-right:2.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-5{margin-left:1.25rem;margin-right:1.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-10{margin-top:2.5rem;margin-bottom:2.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-3{margin-top:.75rem;margin-bottom:.75rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.mb-10{margin-bottom:2.5rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-8{margin-bottom:2rem}.ml-0{margin-left:0}.ml-10{margin-left:2.5rem}.ml-14{margin-left:3.5rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.mr-6{margin-right:1.5rem}.mt-10{margin-top:2.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-9{margin-top:2.25rem}.flex{display:flex}.grid{display:grid}.h-1\/2{height:50%}.h-12{height:3rem}.h-2{height:.5rem}.h-2\/4{height:50%}.h-4{height:1rem}.h-6{height:1.5rem}.h-\[100px\]{height:100px}.h-\[600px\]{height:600px}.h-screen{height:100vh}.w-1\/2{width:50%}.w-10{width:2.5rem}.w-2\/3{width:66.666667%}.w-3{width:.75rem}.w-3\/4{width:75%}.w-32{width:8rem}.w-4{width:1rem}.w-40{width:10rem}.w-6{width:1.5rem}.w-96{width:24rem}.w-\[100px\]{width:100px}.w-\[200px\]{width:200px}.w-full{width:100%}.w-screen{width:100vw}.max-w-2xl{max-width:42rem}.max-w-80{max-width:20rem}.max-w-\[200px\]{max-width:200px}.flex-1{flex:1 1 0%}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.gap-10{gap:2.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-7{gap:1.75rem}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-full{border-radius:9999px}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-l-full{border-top-left-radius:9999px;border-bottom-left-radius:9999px}.border{border-width:1px}.border-2{border-width:2px}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-gray-400{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.bg-orange-300{--tw-bg-opacity: 1;background-color:rgb(253 186 116 / var(--tw-bg-opacity))}.bg-orange-400{--tw-bg-opacity: 1;background-color:rgb(251 146 60 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-purple-100{--tw-gradient-from: #f3e8ff var(--tw-gradient-from-position);--tw-gradient-to: rgb(243 232 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-200{--tw-gradient-from: #e9d5ff var(--tw-gradient-from-position);--tw-gradient-to: rgb(233 213 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-blue-300{--tw-gradient-to: #93c5fd var(--tw-gradient-to-position)}.to-white{--tw-gradient-to: #fff var(--tw-gradient-to-position)}.p-10{padding:2.5rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-36{padding-left:9rem;padding-right:9rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0{padding-top:0;padding-bottom:0}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pt-10{padding-top:2.5rem}.pt-16{padding-top:4rem}.text-center{text-align:center}.font-Poppins{font-family:Poppins,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity))}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.line-through{text-decoration-line:line-through}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-300{transition-delay:.3s}.duration-300{transition-duration:.3s}.hover\:scale-95:hover{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.hover\:bg-gray-900:hover{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.hover\:bg-orange-400:hover{--tw-bg-opacity: 1;background-color:rgb(251 146 60 / var(--tw-bg-opacity))}.hover\:font-semibold:hover{font-weight:600}.hover\:text-gray-400:hover{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.hover\:text-orange-400:hover{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity))}.focus\:border-blue-300:focus{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.active\:bg-gray-300:active{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity))}.active\:bg-slate-200:active{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}@media (min-width: 768px){.md\:left-\[250px\]{left:250px}.md\:top-96{top:24rem}.md\:mb-0{margin-bottom:0}.md\:flex-row{flex-direction:row}.md\:pt-20{padding-top:5rem}.md\:pt-32{padding-top:8rem}.md\:text-4xl{font-size:2.25rem;line-height:2.5rem}.md\:text-base{font-size:1rem;line-height:1.5rem}.md\:text-lg{font-size:1.125rem;line-height:1.75rem}}@media (min-width: 1024px){.lg\:text-5xl{font-size:3rem;line-height:1}.lg\:text-lg{font-size:1.125rem;line-height:1.75rem}} 2 | -------------------------------------------------------------------------------- /dist/assets/product_1-GUEEYTIC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_1-GUEEYTIC.png -------------------------------------------------------------------------------- /dist/assets/product_10-2Nl_XECs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_10-2Nl_XECs.png -------------------------------------------------------------------------------- /dist/assets/product_11-Xy9Rj3SK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_11-Xy9Rj3SK.png -------------------------------------------------------------------------------- /dist/assets/product_12-G08opUrt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_12-G08opUrt.png -------------------------------------------------------------------------------- /dist/assets/product_13-rGeN1LiX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_13-rGeN1LiX.png -------------------------------------------------------------------------------- /dist/assets/product_14-HCSYfJ2r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_14-HCSYfJ2r.png -------------------------------------------------------------------------------- /dist/assets/product_15-_NeimwDZ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_15-_NeimwDZ.png -------------------------------------------------------------------------------- /dist/assets/product_16-UK1F0lFR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_16-UK1F0lFR.png -------------------------------------------------------------------------------- /dist/assets/product_17-FaCkGEZ3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_17-FaCkGEZ3.png -------------------------------------------------------------------------------- /dist/assets/product_18-2kDGJwTn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_18-2kDGJwTn.png -------------------------------------------------------------------------------- /dist/assets/product_19-kLK4N9rs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_19-kLK4N9rs.png -------------------------------------------------------------------------------- /dist/assets/product_2-dy3F06M0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_2-dy3F06M0.png -------------------------------------------------------------------------------- /dist/assets/product_20-jsIwK71V.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_20-jsIwK71V.png -------------------------------------------------------------------------------- /dist/assets/product_21-KcxO7bZL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_21-KcxO7bZL.png -------------------------------------------------------------------------------- /dist/assets/product_22-JoLbAceR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_22-JoLbAceR.png -------------------------------------------------------------------------------- /dist/assets/product_23-r2fN05fz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_23-r2fN05fz.png -------------------------------------------------------------------------------- /dist/assets/product_24-ZmAA0lze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_24-ZmAA0lze.png -------------------------------------------------------------------------------- /dist/assets/product_25-aChXG8-c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_25-aChXG8-c.png -------------------------------------------------------------------------------- /dist/assets/product_26-zRCKzXXt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_26-zRCKzXXt.png -------------------------------------------------------------------------------- /dist/assets/product_27-Yfay04_o.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_27-Yfay04_o.png -------------------------------------------------------------------------------- /dist/assets/product_28-RsTEJnLA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_28-RsTEJnLA.png -------------------------------------------------------------------------------- /dist/assets/product_29-eZLxGKeh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_29-eZLxGKeh.png -------------------------------------------------------------------------------- /dist/assets/product_3-_afa8pZE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_3-_afa8pZE.png -------------------------------------------------------------------------------- /dist/assets/product_30-_pFrpM4Q.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_30-_pFrpM4Q.png -------------------------------------------------------------------------------- /dist/assets/product_31-iAMH-fJB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_31-iAMH-fJB.png -------------------------------------------------------------------------------- /dist/assets/product_32-CyRC6Jur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_32-CyRC6Jur.png -------------------------------------------------------------------------------- /dist/assets/product_33-IfEocB95.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_33-IfEocB95.png -------------------------------------------------------------------------------- /dist/assets/product_34-h5qGMUDj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_34-h5qGMUDj.png -------------------------------------------------------------------------------- /dist/assets/product_35-8pYrG3Bo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_35-8pYrG3Bo.png -------------------------------------------------------------------------------- /dist/assets/product_36-j1BwQLL9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_36-j1BwQLL9.png -------------------------------------------------------------------------------- /dist/assets/product_4-Z2Y1MIkX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_4-Z2Y1MIkX.png -------------------------------------------------------------------------------- /dist/assets/product_5-TY_if21P.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_5-TY_if21P.png -------------------------------------------------------------------------------- /dist/assets/product_6-A5JpRwa6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_6-A5JpRwa6.png -------------------------------------------------------------------------------- /dist/assets/product_7-l0IetaTg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_7-l0IetaTg.png -------------------------------------------------------------------------------- /dist/assets/product_8-U60BzIcC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_8-U60BzIcC.png -------------------------------------------------------------------------------- /dist/assets/product_9-qerwHpJY.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohitparmar1/Shopy/2ece73aea417808f23d1c5354d7791dac2dd6558/dist/assets/product_9-qerwHpJY.png -------------------------------------------------------------------------------- /dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | shopy 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /dist/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | shopy 14 | 48 | 49 | 50 | 51 | 52 | 53 | 58 | shopy 59 | 60 | 61 |
62 |
63 |
64 | 65 | 66 | 79 |
80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /learn.md: -------------------------------------------------------------------------------- 1 | # Learn 2 | 3 | This document provides instructions on how to set up and build the project locally. 4 | This project is a clothing order website that allows user to add products , list their own products, make dashboard of seller 5 | 6 | ## Prerequisites 7 | 8 | Before you begin, ensure you have the following installed on your local machine: 9 | 10 | - Node.js (v14.x or later) 11 | - npm (Node Package Manager v6.x or later) 12 | 13 | ## Table of Contents 14 | - [Setup](#Setup) 15 | - [Contributing Guidelines](#contributing-guidelines) 16 | - [Getting Started](#getting-started) 17 | - [Issue Management](#issue-management) 18 | - [Communication and Collaboration](#communication-and-collaboration) 19 | - [Deadline and Completion](#deadline-and-completion) 20 | - [Quality and Learning](#quality-and-learning) 21 | 22 | ## Setup 23 | 24 | Follow these steps to set up the project locally: 25 | 26 | 1. Clone the repository to your local machine: 27 | 28 | ```bash 29 | git clone https://github.com/mohitparmar1/Shopy.git 30 | ``` 31 | 32 | 2. Navigate to the project directory: 33 | 34 | ```bash 35 | cd SHOPY 36 | ``` 37 | 3. Install project dependencies: 38 | 39 | ```bash 40 | npm install 41 | ``` 42 | 43 | ```bash 44 | npm install vite 45 | ``` 46 | 47 | 4. Start the development server and run the app 48 | 49 | ```bash 50 | npm run dev 51 | ``` 52 | 53 | ## Contributing Guidelines 54 | 55 | Before diving into the learning resources, please familiarize yourself with the following contributing guidelines: 56 | 57 | - Participants/contributors must comment on issues they wish to work on. 58 | - Issues will be assigned on a first-come, first-serve basis by mentors or the Project Administrator (PA). 59 | - Participants can open new issues using the provided template, but these need verification and labeling by a mentor or PA. 60 | - Ensure issues are assigned to you before starting work. 61 | - Each participant can work on a maximum of one issue at a time. 62 | - Don't work on issues already assigned to others. 63 | - Discuss issues with the team before starting work. 64 | - Explain your approach to solving any issue in the comments for better understanding. 65 | - Pull requests will be merged after review by a mentor or PA. 66 | - Create PRs from branches other than `main`. 67 | - Include a descriptive summary of your work in the PR description. 68 | - Use the format `Fixes: issue number` in your commit message when creating a pull request. 69 | - Complete assigned issues within the specified deadline. Failure to do so may result in reassignment. 70 | - Follow project guidelines and coding style. 71 | - Aim for structured and optimized code. 72 | - Mistakes are allowed and part of the learning process! 73 | 74 | ## Getting Started 75 | 76 | To contribute to the project, follow these steps: 77 | 78 | 1. **Fork the Repository**: Start by forking the repository to your GitHub account. 79 | 2. **Clone the Repository**: Clone your forked repository to your local machine. 80 | 3. **Choose an Issue**: Comment on an issue you'd like to work on or open a new one following the guidelines. 81 | 4. **Set Up Development Environment**: Refer to the project's development guidelines for setting up your development environment. 82 | 5. **Start Working**: Once the issue is assigned to you, start working on it following your chosen approach. 83 | 6. **Submit a Pull Request**: After completing your work, submit a pull request from your branch for review. 84 | 85 | ## Issue Management 86 | 87 | Issues are managed as follows: 88 | 89 | - Participants must comment on issues they wish to work on. 90 | - Issues will be assigned on a first-come, first-serve basis. 91 | - Participants can open new issues using the provided template, but these need verification and labeling by a mentor or PA. 92 | - Ensure issues are assigned to you before starting work. 93 | - Each participant can work on a maximum of one issue at a time. 94 | - Don't work on issues already assigned to others. 95 | - Discuss issues with the team before starting work. 96 | 97 | ## Communication and Collaboration 98 | 99 | Effective communication and collaboration are crucial for successful contributions: 100 | 101 | - Discuss issues with the team before starting work. 102 | - Explain your approach to solving any issue in the comments for better understanding. 103 | 104 | ## Deadline and Completion 105 | 106 | Ensure timely completion of assigned tasks: 107 | 108 | - Complete assigned issues within the specified deadline. 109 | - Failure to meet the deadline may result in reassignment. 110 | 111 | ## Quality and Learning 112 | 113 | Learnings: 114 | 115 | - Client-Side Development: Understanding how to build a user-friendly interface using React and TailwindCSS. 116 | - Server-Side Development: Utilizing Node.js and Express for server-side logic and API integrations. 117 | - Git Workflow: Understanding the Git workflow for contributing to open-source projects, including forking, branching, committing, and creating pull requests. 118 | 119 | Focus on quality and continuous learning: 120 | 121 | - Follow project guidelines and coding style. 122 | - Aim for structured and optimized code. 123 | - Mistakes are allowed and are a part of the learning process! 124 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "client", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "@emotion/react": "^11.11.4", 14 | "@emotion/styled": "^11.11.5", 15 | "@fortawesome/fontawesome-free": "^6.5.2", 16 | "@fortawesome/free-solid-svg-icons": "^6.5.2", 17 | "@fortawesome/react-fontawesome": "^0.2.2", 18 | "@mui/icons-material": "^5.15.18", 19 | "@mui/material": "^5.15.17", 20 | "@react-icons/all-files": "^4.1.0", 21 | "@react-oauth/google": "^0.12.1", 22 | "@stripe/react-stripe-js": "^2.7.1", 23 | "@stripe/stripe-js": "^3.4.0", 24 | "axios": "^1.7.2", 25 | "dotenv": "^16.4.5", 26 | "jwt-decode": "^4.0.0", 27 | "react": "^18.2.0", 28 | "react-dom": "^18.2.0", 29 | "react-icons": "^5.2.1", 30 | "react-router-dom": "^6.21.3", 31 | "react-slick": "^0.30.2", 32 | "react-toastify": "^10.0.5", 33 | "slick-carousel": "^1.8.1" 34 | }, 35 | "devDependencies": { 36 | "@types/react": "^18.2.43", 37 | "@types/react-dom": "^18.2.17", 38 | "@vitejs/plugin-react": "^4.2.1", 39 | "autoprefixer": "^10.4.17", 40 | "eslint": "^8.55.0", 41 | "eslint-plugin-react": "^7.33.2", 42 | "eslint-plugin-react-hooks": "^4.6.0", 43 | "eslint-plugin-react-refresh": "^0.4.5", 44 | "postcss": "^8.4.33", 45 | "tailwindcss": "^3.4.1", 46 | "vite": "^5.2.11" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/.gitignore: -------------------------------------------------------------------------------- 1 | config.env 2 | /node_modules 3 | package-lock.json 4 | config.env -------------------------------------------------------------------------------- /server/config.env.sample: -------------------------------------------------------------------------------- 1 | DATABASE_URL= 2 | PORT=7000 3 | CORS_ORIGIN=https://shopy-mohitparmar1s-projects.vercel.app/ -------------------------------------------------------------------------------- /server/config/DBconnect.js: -------------------------------------------------------------------------------- 1 | import mongoose from 'mongoose'; 2 | 3 | const connectDB = async () => { 4 | try { 5 | await mongoose.connect(process.env.DATABASE_URL); 6 | console.log("Connected To MongoDB"); 7 | } catch (err) { 8 | console.log(err) 9 | process.exit(1); 10 | } 11 | }; 12 | 13 | export {connectDB}; -------------------------------------------------------------------------------- /server/config/JWTAuthentication.js: -------------------------------------------------------------------------------- 1 | import passport from "passport"; 2 | const authenticateJWT = (req, res, next) => { 3 | passport.authenticate("jwt", { session: false }, (err, user, info) => { 4 | if (err) { 5 | return res.status(500).json({ 6 | success: false, 7 | message: "Internal Server Error", 8 | }); 9 | } 10 | if (!user) { 11 | return res.status(401).json({ 12 | success: false, 13 | isLoggedIn: false, 14 | message: "Invalid Request. Please Sign In Your Account", 15 | }); 16 | } 17 | req.user = user; 18 | next(); 19 | })(req, res, next); 20 | }; 21 | 22 | export { authenticateJWT }; 23 | -------------------------------------------------------------------------------- /server/controllers/auth/authController.js: -------------------------------------------------------------------------------- 1 | import { UserModel } from "../../models/userModel.js"; 2 | import { OtpModel } from "../../models/OtpModel.js"; 3 | import { generateOTP } from "../../utils/generateOTP.js"; 4 | import { sendEmail } from "../../utils/sendEmail.js"; 5 | import { generateToken } from "../../utils/generateJwtToken.js"; 6 | import { decodeJWT } from "../../utils/decodeJwtToken.js"; 7 | /* 8 | Forgot Password 9 | 10 | */ 11 | const forgotPassword = async (req, res) => { 12 | try { 13 | const { email } = req.body; 14 | const user = await UserModel.findOne({ email }); 15 | if (!user) { 16 | return res.status(404).json({ 17 | message: "Invalid Email or User Not Found", 18 | success: false, 19 | }); 20 | } 21 | 22 | // generating otp 23 | const otp = generateOTP(); 24 | await OtpModel.create({ email: user.email, otp }); 25 | // Send OTP via email 26 | const emailOptions = { 27 | mail: user.email, 28 | subject: "FORGOT PASSWORD - OTP", 29 | 30 | messageContent: ` 31 |
32 |

Verify Password Reset Request

33 |

Dear ${user.fullname},

34 |

We noticed that you recently requested to reset your password for your account. Please use the following One-Time Password (OTP) to reset your password:

35 |

OTP: ${otp}

36 | 37 |

This OTP Will expires in 2:00 Minutes.

38 |

Note: If you did not request this password reset, please ignore this email. Your account security is important to us, and we apologize for any inconvenience.

39 |

If you encounter any issues or need further assistance, please don't hesitate to contact our support team at [Support Email] or call us at [Support Phone Number].

40 |

Thank you for choosing Shopy !

41 |

Best regards,
[Company Name]

42 |
43 | `, 44 | }; 45 | await sendEmail(emailOptions); 46 | res.status(201).json({ 47 | success: true, 48 | message: `An OTP is send to your email ${email} .`, 49 | otp: otp, 50 | }); 51 | } catch (error) { 52 | return res.status(500).json({ 53 | success: false, 54 | error: error.message, 55 | }); 56 | } 57 | }; 58 | const verifyAndResetPassword = async (req, res) => { 59 | try { 60 | const { email, otp } = req.body; 61 | // console.log(req.body); 62 | 63 | // Retrieve the OTP stored in the database for the user's email 64 | const otpData = await OtpModel.findOne({ email }).sort({ createdAt: -1 }); 65 | 66 | // Check if OTP exists in the database 67 | if (!otpData) { 68 | return res 69 | .status(404) 70 | .json({ success: false, message: "OTP Expired. Click on Resend OTP" }); 71 | } 72 | 73 | // Compare the OTP provided by the user with the OTP stored in the database 74 | if (otpData.otp !== otp) { 75 | return res.status(400).json({ 76 | success: false, 77 | message: "Invalid OTP.", 78 | }); 79 | } 80 | // - Delete the OTP record from the database 81 | await otpData.deleteOne(); 82 | const user = await UserModel.findOne({ email }); 83 | if (!user) { 84 | return res.status(404).json({ 85 | message: "User Not Found", 86 | success: false, 87 | }); 88 | } 89 | 90 | const password_Reset_Token = generateToken(user._id, "300s"); 91 | const password_Reset_URL = `${process.env.CLIENT_URL}/reset-password/${password_Reset_Token}`; 92 | // Send OTP via email 93 | const emailOptions = { 94 | mail: user.email, 95 | subject: "RESET PASSWORD ", 96 | 97 | messageContent: ` 98 |
99 |

Reset Your Password

100 |

Dear ${user.fullname},

101 |

We have received a request to reset the password associated with your account. To proceed with the password reset, please follow the instructions below:

102 | 103 |
    104 |
  1. Click on the following link to reset your password: Password Reset Link
  2. 105 |
  3. Please note that this link is valid for 5:00 Minutes. After this period, you will need to request another password reset.
  4. 106 |
  5. If you did not request this password reset, please change your Password Immediately by Logging into your account.
  6. 107 |
108 |

Note: If the above link does not work then copy and paste this url into browser.
${password_Reset_URL}

109 |

Ensure the security of your account:

110 | 116 | 117 |

If you encounter any issues or require further assistance, please feel free to reach out to our support team at [Support Email].

118 | 119 |

Thank you for your attention to this matter.

120 |

Best regards,
Shopy!!

121 |
122 | `, 123 | }; 124 | await sendEmail(emailOptions); 125 | 126 | return res.status(200).json({ 127 | success: true, 128 | message: "Password Reset Link has been Sent to your email.", 129 | password_Reset_URL, 130 | }); 131 | } catch (error) { 132 | return res.status(500).json({ 133 | success: false, 134 | error: error.message, 135 | }); 136 | } 137 | }; 138 | const setNewPassword = async (req, res) => { 139 | try { 140 | const { token, newPassword } = req.body; 141 | console.log(token); 142 | 143 | //decodes token id 144 | const decoded = await decodeJWT(token); 145 | console.log(decoded); 146 | if (!decoded) { 147 | return res.status(404).json({ 148 | success: true, 149 | message: "Please make another new password Reset request", 150 | }); 151 | } 152 | let user = await UserModel.findOne({ _id: decoded.id }).select("password"); 153 | // console.log(user); 154 | if (!user) { 155 | return res.status(400).json({ 156 | success: false, 157 | message: "Invalid Token or User not found", 158 | }); 159 | } 160 | 161 | user.password = newPassword; 162 | user = await user.save(); 163 | 164 | res.status(200).send({ 165 | message: "Password changed successfully", 166 | success: true, 167 | // user, 168 | }); 169 | } catch (error) { 170 | return res.status(500).json({ 171 | success: false, 172 | error: error.message, 173 | }); 174 | } 175 | }; 176 | 177 | export { forgotPassword, verifyAndResetPassword, setNewPassword }; 178 | -------------------------------------------------------------------------------- /server/controllers/kids-controller.js: -------------------------------------------------------------------------------- 1 | import { KidsModel } from "../models/Kids-model.js"; 2 | 3 | const Kids=KidsModel; 4 | 5 | //Returns all the Items 6 | const getAllItems = async (req, res) => { 7 | try { 8 | const AllItems = await Kids.find(); 9 | res.status(200).json({ 10 | AllItems, 11 | }); 12 | } catch (err) { 13 | res.status(500).json({ 14 | message:err.message, 15 | }); 16 | } 17 | }; 18 | 19 | //create a new item 20 | const createItem = async (req, res) => { 21 | try { 22 | const newItem = await Kids.create(req.body); 23 | res.status(201).json({ 24 | newItem, 25 | }); 26 | } catch (err) { 27 | res.status(500).json({ 28 | message:err.message, 29 | }); 30 | } 31 | }; 32 | 33 | //returns a particular item 34 | const getItemById = async (req, res) => { 35 | try { 36 | const ItemById = await Kids.findById(req.params.id); 37 | res.status(200).json({ 38 | ItemById, 39 | }); 40 | } catch (err) { 41 | res.status(500).json({ 42 | message:err.message, 43 | }); 44 | } 45 | }; 46 | 47 | //Updates The Item Details 48 | const UpdateItem = async (req, res) => { 49 | try { 50 | const UpdateItemById = await Kids.findByIdAndUpdate( 51 | req.params.id, 52 | req.body, 53 | { 54 | new: true, 55 | } 56 | ); 57 | res.status(200).json({ 58 | UpdateItemById, 59 | }); 60 | } catch (err) { 61 | res.status(500).json({ 62 | message:err.message, 63 | }); 64 | } 65 | }; 66 | 67 | //Delete a Particular Item 68 | const DeleteItem = async (req, res) => { 69 | try { 70 | const DeleteAItem = await Kids.findByIdAndDelete(req.params.id); 71 | res.status(204).json({ 72 | DeleteAItem, 73 | }); 74 | } catch (err) { 75 | res.status(500).json({ 76 | message:err.message, 77 | }); 78 | } 79 | }; 80 | 81 | export { getAllItems, createItem, getItemById, UpdateItem, DeleteItem }; 82 | -------------------------------------------------------------------------------- /server/controllers/loginController.js: -------------------------------------------------------------------------------- 1 | import {userModel} from "../models/userModel.js"; 2 | import bcrypt from "bcrypt"; 3 | import jwt from "jsonwebtoken"; 4 | 5 | const postLogin=async (req,res)=>{ 6 | try { 7 | if(req.body.authType===true){ 8 | const user=await userModel.findOne({ email: req.body.email }); 9 | if(!user){ 10 | const hashedPassword = await bcrypt.hash(req.body.password, 10); 11 | const pass= req.body.password; 12 | req.body.password = hashedPassword; 13 | const data = await userModel.create({ 14 | email:req.body.email, 15 | password:req.body.password 16 | }); 17 | req.body.password=pass 18 | } 19 | } 20 | const currentUser = await userModel.findOne({ email: req.body.email }); 21 | if (currentUser) { 22 | const isPasswordCorrect = bcrypt.compareSync( 23 | req.body.password, 24 | currentUser.password 25 | ); 26 | if (isPasswordCorrect) { 27 | const token = jwt.sign( 28 | { id: currentUser._id }, 29 | process.env.JWT_SECRET 30 | ); 31 | res.cookie('jwttoken', token, { 32 | httpOnly: false, 33 | maxAge: 24 * 60 * 60 * 10 34 | }); 35 | return res.status(200).json({ message: "Login Successfully"}); 36 | } else { 37 | return res.status(400).json({ message: "Password is Incorrect" }); 38 | } 39 | } 40 | else { 41 | return res.status(400).json({ message: "User not found" }); 42 | } 43 | } 44 | catch (err) { 45 | res.status(500).json({ message:"server error" }); 46 | } 47 | } 48 | export { postLogin }; -------------------------------------------------------------------------------- /server/controllers/mens-controller.js: -------------------------------------------------------------------------------- 1 | import {MensModel} from "../models/Mens-model.js"; 2 | 3 | const Mens=MensModel; 4 | 5 | //Returns all the Items 6 | const getAllItems = async (req, res) => { 7 | try { 8 | const AllItems = await Mens.find(); 9 | res.status(200).json({ 10 | AllItems, 11 | }); 12 | } catch (err) { 13 | res.status(500).json({ 14 | message:err.message, 15 | }); 16 | } 17 | }; 18 | 19 | //create a new item 20 | const createItem = async (req, res) => { 21 | try { 22 | const newItem = await Mens.create(req.body); 23 | res.status(201).json({ 24 | newItem, 25 | }); 26 | } catch (err) { 27 | res.status(500).json({ 28 | message:err.message, 29 | }); 30 | } 31 | }; 32 | 33 | //returns a particular item 34 | const getItemById = async (req, res) => { 35 | try { 36 | const ItemById = await Mens.findById(req.params.id); 37 | res.status(200).json({ 38 | ItemById, 39 | }); 40 | } catch (err) { 41 | res.status(500).json({ 42 | message:err.message, 43 | }); 44 | } 45 | }; 46 | 47 | //Updates The Item Details 48 | const UpdateItem = async (req, res) => { 49 | try { 50 | const UpdateItemById = await Mens.findByIdAndUpdate( 51 | req.params.id, 52 | req.body, 53 | { 54 | new: true, 55 | } 56 | ); 57 | res.status(200).json({ 58 | UpdateItemById, 59 | }); 60 | } catch (err) { 61 | res.status(500).json({ 62 | message:err.message, 63 | }); 64 | } 65 | }; 66 | 67 | //Delete a Particular Item 68 | const DeleteItem = async (req, res) => { 69 | try { 70 | const DeleteAItem = await Mens.findByIdAndDelete(req.params.id); 71 | res.status(204).json({ 72 | DeleteAItem, 73 | }); 74 | } catch (err) { 75 | res.status(500).json({ 76 | message:err.message, 77 | }); 78 | } 79 | }; 80 | 81 | export { getAllItems, createItem, getItemById, UpdateItem, DeleteItem }; 82 | -------------------------------------------------------------------------------- /server/controllers/signupController.js: -------------------------------------------------------------------------------- 1 | import {userModel} from "../models/userModel.js"; 2 | import bcrypt from "bcrypt"; 3 | const postRegister = async (req, res, next) => { 4 | try { 5 | const hashedPassword = await bcrypt.hash(req.body.password, 10); 6 | req.body.password = hashedPassword; 7 | const data = await userModel.create({ 8 | ...req.body, 9 | }); 10 | console.log(data); 11 | res.status(201).json({message: "User Created"}); 12 | } catch (err) { 13 | // console.log(err); 14 | res.status(400).json({ message: err.message }); 15 | } 16 | }; 17 | export { postRegister }; 18 | -------------------------------------------------------------------------------- /server/controllers/womens-controller.js: -------------------------------------------------------------------------------- 1 | import { WomensModel } from "../models/Womens-model.js"; 2 | 3 | const Womens=WomensModel; 4 | 5 | //Returns all the Items 6 | const getAllItems = async (req, res) => { 7 | try { 8 | const AllItems = await Womens.find(); 9 | res.status(200).json({ 10 | AllItems, 11 | }); 12 | } catch (err) { 13 | res.status(500).json({ 14 | message:err.message, 15 | }); 16 | } 17 | }; 18 | 19 | //create a new item 20 | const createItem = async (req, res) => { 21 | try { 22 | const newItem = await Womens.create(req.body); 23 | res.status(201).json({ 24 | newItem, 25 | }); 26 | } catch (err) { 27 | res.status(500).json({ 28 | message:err.message, 29 | }); 30 | } 31 | }; 32 | 33 | //returns a particular item 34 | const getItemById = async (req, res) => { 35 | try { 36 | const ItemById = await Womens.findById(req.params.id); 37 | res.status(200).json({ 38 | ItemById, 39 | }); 40 | } catch (err) { 41 | res.status(500).json({ 42 | message:err.message, 43 | }); 44 | } 45 | }; 46 | 47 | //Updates The Item Details 48 | const UpdateItem = async (req, res) => { 49 | try { 50 | const UpdateItemById = await Womens.findByIdAndUpdate( 51 | req.params.id, 52 | req.body, 53 | { 54 | new: true, 55 | } 56 | ); 57 | res.status(200).json({ 58 | UpdateItemById, 59 | }); 60 | } catch (err) { 61 | res.status(500).json({ 62 | message:err.message, 63 | }); 64 | } 65 | }; 66 | 67 | //Delete a Particular Item 68 | const DeleteItem = async (req, res) => { 69 | try { 70 | const DeleteAItem = await Womens.findByIdAndDelete(req.params.id); 71 | res.status(204).json({ 72 | DeleteAItem, 73 | }); 74 | } catch (err) { 75 | res.status(500).json({ 76 | message:err.message, 77 | }); 78 | } 79 | }; 80 | 81 | export { getAllItems, createItem, getItemById, UpdateItem, DeleteItem }; 82 | -------------------------------------------------------------------------------- /server/index.js: -------------------------------------------------------------------------------- 1 | 2 | import express from 'express'; 3 | import dotenv from 'dotenv'; 4 | import cors from 'cors'; 5 | import morgan from 'morgan'; 6 | import { MensRouter } from './routes/mens-route.js'; 7 | import connectDB from './config/DBconnect.js'; 8 | import { authRouter } from "./routes/auth/authRoutes.js"; 9 | import { WomensRouter } from './routes/womens-route.js'; 10 | import {LoginRouter} from "./routes/loginRoute.js"; 11 | import {SignupRouter} from './routes/signupRoute.js'; 12 | import { KidsRouter } from './routes/kids-route.js'; 13 | import StripeRouter from './routes/Stripe-route.js'; 14 | import cookieParser from 'cookie-parser'; 15 | 16 | 17 | const app = express(); 18 | 19 | 20 | dotenv.config(); 21 | 22 | 23 | connectDB(); 24 | 25 | app.use(express.json()); 26 | app.use(cookieParser()); 27 | app.use(morgan('dev')) 28 | 29 | app.use(cors({ 30 | origin: process.env.CORS_ORIGIN || "https://shopy-mohitparmar1s-projects.vercel.app/", 31 | methods:['GET','POST'], 32 | credentials:true, 33 | })) 34 | 35 | app.use(express.urlencoded({extended:false})); 36 | 37 | app.use("/api/v1/auth", authRouter); 38 | app.use('/api/v1/mens',MensRouter); 39 | app.use('/api/v1/womens',WomensRouter); 40 | app.use('/api/v1/kids',KidsRouter); 41 | app.use('/api/v1/signup',SignupRouter); 42 | app.use('/api/v1/login',LoginRouter); 43 | app.use('/api',StripeRouter); 44 | const port=process.env.PORT||7000; 45 | app.listen(port,()=>{ 46 | console.log(`Server is running on port ${port}`); 47 | }) 48 | 49 | -------------------------------------------------------------------------------- /server/middlewares/auth-helper.js: -------------------------------------------------------------------------------- 1 | import jwt from "jsonwebtoken"; 2 | import { userModel } from "../models/userModel.js"; 3 | import bcrypt from "bcrypt"; 4 | 5 | const authLogin = async (req, res, next) => { 6 | try { 7 | const token = req.cookies.jwttoken; 8 | const verifyToken = jwt.verify(token, process.env.jwt_secret); 9 | const user = await userModel.findOne({ _id: verifyToken.id }); 10 | if(!user){ 11 | return res.status(401).json({ message: "User not found" }); 12 | } 13 | else{ 14 | next(); 15 | } 16 | } 17 | catch (err) { 18 | res.status(501).json({ message: "Internal Server Error" }); 19 | } 20 | } 21 | 22 | export { authLogin }; -------------------------------------------------------------------------------- /server/models/Kids-model.js: -------------------------------------------------------------------------------- 1 | import mongoose from "mongoose"; 2 | 3 | const KidsSchema = new mongoose.Schema( 4 | { 5 | ClothName: { 6 | type: String, 7 | required: [true, "Item Name Must be specified"], 8 | }, 9 | images: [String], 10 | rating: { 11 | type: Number, 12 | }, 13 | reviews: [String], 14 | brand: { 15 | type: String, 16 | required: [true, "Brand description is required"], 17 | }, 18 | description: { 19 | type: String, 20 | required: [true, "A Description is required for a Cloth/Item"], 21 | }, 22 | price: { 23 | type: Number, 24 | required: [true, "Price must be mentioned"], 25 | }, 26 | category: { 27 | type: String, 28 | default: "Kid", 29 | }, 30 | itemsleft: { 31 | type: Number, 32 | required: [true, "Number of items left must be mentioned"], 33 | }, 34 | subCategory: { 35 | type: [String], 36 | required: [ 37 | true, 38 | "Please mention the sub category i.e, is it a t-shirt/pant,etc", 39 | ], 40 | }, 41 | tags: [String], 42 | size: [String], 43 | }, 44 | { timestamps: true } 45 | ); 46 | 47 | const KidsModel = new mongoose.model("Kid", KidsSchema); 48 | 49 | export { KidsModel }; 50 | -------------------------------------------------------------------------------- /server/models/Mens-model.js: -------------------------------------------------------------------------------- 1 | import mongoose from "mongoose"; 2 | 3 | const MensSchema = new mongoose.Schema( 4 | { 5 | ClothName: { 6 | type: String, 7 | required: [true, "Item Name Must be specified"], 8 | }, 9 | images: [String], 10 | rating: { 11 | type: Number, 12 | }, 13 | reviews: [String], 14 | brand: { 15 | type: String, 16 | required: [true, "Brand description is required"], 17 | }, 18 | description: { 19 | type: String, 20 | required: [true, "A Description is required for a Cloth/Item"], 21 | }, 22 | price: { 23 | type: Number, 24 | required: [true, "Price must be mentioned"], 25 | }, 26 | category: { 27 | type: String, 28 | default: "Men", 29 | }, 30 | itemsleft: { 31 | type: Number, 32 | required: [true, "Number of items left must be mentioned"], 33 | }, 34 | subCategory: { 35 | type: [String], 36 | required: [ 37 | true, 38 | "Please mention the sub category i.e, is it a t-shirt/pant,etc", 39 | ], 40 | }, 41 | tags: [String], 42 | size: [String], 43 | }, 44 | { timestamps: true } 45 | ); 46 | 47 | const MensModel = new mongoose.model("Men", MensSchema); 48 | 49 | export { MensModel }; 50 | -------------------------------------------------------------------------------- /server/models/OtpModel.js: -------------------------------------------------------------------------------- 1 | import mongoose from "mongoose"; 2 | 3 | const OtpSchema = new mongoose.Schema({ 4 | email: { 5 | type: String, 6 | required: true, 7 | }, 8 | otp: { 9 | type: String, 10 | required: true, 11 | }, 12 | createdAt: { 13 | type: Date, 14 | default: Date.now, 15 | expires: 60, // Set expiration time in seconds (e.g., 60 seconds) 16 | }, 17 | }); 18 | 19 | const OtpModel = mongoose.model("otp", OtpSchema); 20 | export { OtpModel }; 21 | -------------------------------------------------------------------------------- /server/models/Womens-model.js: -------------------------------------------------------------------------------- 1 | import mongoose from "mongoose"; 2 | 3 | const WomensSchema = new mongoose.Schema( 4 | { 5 | ClothName: { 6 | type: String, 7 | required: [true, "Item Name Must be specified"], 8 | }, 9 | images: [String], 10 | rating: { 11 | type: Number, 12 | }, 13 | reviews: [String], 14 | brand: { 15 | type: String, 16 | required: [true, "Brand description is required"], 17 | }, 18 | description: { 19 | type: String, 20 | required: [true, "A Description is required for a Cloth/Item"], 21 | }, 22 | price: { 23 | type: Number, 24 | required: [true, "Price must be mentioned"], 25 | }, 26 | category: { 27 | type: String, 28 | default: "Women", 29 | }, 30 | itemsleft: { 31 | type: Number, 32 | required: [true, "Number of items left must be mentioned"], 33 | }, 34 | subCategory: { 35 | type: [String], 36 | required: [ 37 | true, 38 | "Please mention the sub category i.e, is it a t-shirt/pant,etc", 39 | ], 40 | }, 41 | tags: [String], 42 | size: [String], 43 | }, 44 | { timestamps: true } 45 | ); 46 | 47 | const WomensModel = new mongoose.model("Women", WomensSchema); 48 | 49 | export { WomensModel }; 50 | -------------------------------------------------------------------------------- /server/models/userModel.js: -------------------------------------------------------------------------------- 1 | // Importing mongoose 2 | import mongoose from "mongoose"; 3 | // Importing email-validator 4 | import emailValidator from "email-validator"; 5 | // Importing bcrypt 6 | import bcrypt from "bcrypt"; 7 | const userSchema = new mongoose.Schema({ 8 | email: { 9 | type: String, 10 | required: true, 11 | unique: true, 12 | validate: function () { 13 | return emailValidator.validate(this.email); 14 | }, 15 | }, 16 | password: { 17 | type: String, 18 | required: true, 19 | minLength: 6, 20 | } 21 | }); 22 | userSchema.pre("save", async function (next) { 23 | try { 24 | const existingUser = await userModel.findOne({ email: this.email }); 25 | if (existingUser) { 26 | const err = new Error("Email already exists"); 27 | err.status = 400; 28 | return next(err); 29 | } 30 | 31 | next(); 32 | } catch (error) { 33 | next(error); 34 | } 35 | }); 36 | const userModel = new mongoose.model("user", userSchema); 37 | export { userModel }; 38 | 39 | -------------------------------------------------------------------------------- /server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "description": "", 5 | "type": "module", 6 | "main": "index.js", 7 | "scripts": { 8 | "start": "nodemon index.js" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "bcrypt": "^5.1.1", 15 | "bcryptjs": "^2.4.3", 16 | "cookie-parser": "^1.4.6", 17 | "cors": "^2.8.5", 18 | "dotenv": "^16.4.5", 19 | "email-validator": "^2.0.4", 20 | "express": "^4.19.2", 21 | "jsonwebtoken": "^9.0.2", 22 | "mongoose": "^8.3.5", 23 | "morgan": "^1.10.0", 24 | 25 | "nodemailer": "^6.9.13", 26 | "nodemon": "^3.1.0", 27 | "passport": "^0.7.0" 28 | 29 | "stripe": "^15.6.0" 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /server/routes/Stripe-route.js: -------------------------------------------------------------------------------- 1 | import express from "express"; 2 | const StripeRouter = express.Router(); 3 | import dotenv from "dotenv"; 4 | dotenv.config({ path: "./config.env" }); 5 | import Stripe from "stripe"; 6 | const stripe = Stripe(process.env.STRIPE_PRIVATE_KEY); 7 | 8 | 9 | StripeRouter.post("/create-checkout-session", async (req, res) => { 10 | //ErrorHandling if product is not an Array 11 | if (!Array.isArray(req.body.products)) { 12 | return res.status(400).send({ error: "Products must be an array." }); 13 | } 14 | 15 | const { products,cartItem } = req.body; 16 | console.log(products); 17 | 18 | 19 | //LineItems 20 | const lineItems = products.map((product) => ({ 21 | price_data: { 22 | currency: "usd", 23 | product_data: { 24 | name: product.name, 25 | }, 26 | unit_amount: Math.round(product.new_price * 100), 27 | }, 28 | quantity: cartItem[product.id], 29 | })); 30 | 31 | 32 | //checkoutSession 33 | const session = await stripe.checkout.sessions.create({ 34 | line_items: lineItems, 35 | mode: "payment", 36 | success_url: 37 | "https://shopy-mohitparmar1s-projects.vercel.app/user/paymentsuccess", 38 | cancel_url: 39 | "https://shopy-mohitparmar1s-projects.vercel.app/user/paymentfail", 40 | shipping_address_collection: { 41 | allowed_countries: ["IN", "US"], 42 | }, 43 | phone_number_collection: { 44 | enabled: true, 45 | }, 46 | }); 47 | 48 | res.json({ 49 | id: session.id, 50 | url: session.url, 51 | }) 52 | 53 | }); 54 | 55 | export default StripeRouter; 56 | -------------------------------------------------------------------------------- /server/routes/auth/authRoutes.js: -------------------------------------------------------------------------------- 1 | import express from "express"; 2 | // import passport from "passport"; 3 | // import { UserModel } from "../../models/userModel"; 4 | // import { authenticateJWT } from "../../config/JWTAuthentication"; 5 | import { 6 | forgotPassword, 7 | setNewPassword, 8 | verifyAndResetPassword, 9 | } from "../../controllers/auth/authController.js"; 10 | 11 | const authRouter = express.Router(); 12 | 13 | authRouter.post("/forgot-password", forgotPassword); 14 | authRouter.post("/verify/password-otp", verifyAndResetPassword); 15 | authRouter.post("/reset/set-new-password", setNewPassword); 16 | export { authRouter }; 17 | -------------------------------------------------------------------------------- /server/routes/kids-route.js: -------------------------------------------------------------------------------- 1 | import express from "express"; 2 | import { 3 | getAllItems, 4 | createItem, 5 | getItemById, 6 | UpdateItem, 7 | DeleteItem, 8 | } from "../controllers/kids-controller.js"; 9 | 10 | const KidsRouter = express.Router(); 11 | 12 | KidsRouter.route("/").get(getAllItems).post(createItem); 13 | 14 | KidsRouter.route("/:id").get(getItemById).patch(UpdateItem).delete(DeleteItem); 15 | 16 | export {KidsRouter}; -------------------------------------------------------------------------------- /server/routes/loginRoute.js: -------------------------------------------------------------------------------- 1 | import {postLogin} from '../controllers/loginController.js'; 2 | import express from "express" 3 | import { authLogin } from '../middlewares/auth-helper.js'; 4 | const LoginRouter = express.Router(); 5 | 6 | LoginRouter.route('/').post(postLogin); 7 | 8 | export {LoginRouter}; -------------------------------------------------------------------------------- /server/routes/mens-route.js: -------------------------------------------------------------------------------- 1 | import express from "express"; 2 | import { 3 | getAllItems, 4 | createItem, 5 | getItemById, 6 | UpdateItem, 7 | DeleteItem, 8 | } from "../controllers/mens-controller.js"; 9 | 10 | const MensRouter = express.Router(); 11 | 12 | MensRouter.route("/").get(getAllItems).post(createItem); 13 | 14 | MensRouter.route("/:id").get(getItemById).patch(UpdateItem).delete(DeleteItem); 15 | 16 | export {MensRouter}; -------------------------------------------------------------------------------- /server/routes/signupRoute.js: -------------------------------------------------------------------------------- 1 | import { postRegister } from "../controllers/signupController.js"; 2 | 3 | import express from "express"; 4 | const SignupRouter = express.Router(); 5 | 6 | SignupRouter.route("/").post(postRegister); 7 | 8 | export { SignupRouter }; -------------------------------------------------------------------------------- /server/routes/womens-route.js: -------------------------------------------------------------------------------- 1 | import express from "express"; 2 | import { 3 | getAllItems, 4 | createItem, 5 | getItemById, 6 | UpdateItem, 7 | DeleteItem, 8 | } from "../controllers/womens-controller.js"; 9 | 10 | const WomensRouter = express.Router(); 11 | 12 | WomensRouter.route("/").get(getAllItems).post(createItem); 13 | 14 | WomensRouter.route("/:id").get(getItemById).patch(UpdateItem).delete(DeleteItem); 15 | 16 | export {WomensRouter}; -------------------------------------------------------------------------------- /server/utils/decodeJwtToken.js: -------------------------------------------------------------------------------- 1 | import jwt from "jsonwebtoken"; 2 | // import dotenv from "dotenv"; 3 | // dotenv.config(); 4 | 5 | export const decodeJWT = async (token) => { 6 | return jwt.verify(token, process.env.JWT_SECRET); 7 | }; 8 | -------------------------------------------------------------------------------- /server/utils/generateJwtToken.js: -------------------------------------------------------------------------------- 1 | // const jwt = require("jsonwebtoken"); 2 | // const { JWT_SECRET } = require("./keys"); 3 | import jwt from "jsonwebtoken"; 4 | // const JWT_SECRET = process.env.JWT_SECRET; 5 | 6 | export const generateToken = (id, tokenValidity = "30d") => { 7 | // console.log(tokenValidity); 8 | return jwt.sign({ id }, process.env.JWT_SECRET, { 9 | expiresIn: tokenValidity, 10 | }); 11 | }; 12 | -------------------------------------------------------------------------------- /server/utils/generateOTP.js: -------------------------------------------------------------------------------- 1 | export const generateOTP = (length = 4) => { 2 | const chars = "0123456789"; 3 | let otp = ""; 4 | 5 | for (let i = 0; i < length; i++) { 6 | const randomIndex = Math.floor(Math.random() * chars.length); 7 | otp += chars[randomIndex]; 8 | } 9 | 10 | return otp; 11 | }; 12 | -------------------------------------------------------------------------------- /server/utils/sendEmail.js: -------------------------------------------------------------------------------- 1 | import nodemailer from "nodemailer"; 2 | 3 | const sendEmail = async (options) => { 4 | const transporter = nodemailer.createTransport({ 5 | host: process.env.SMTP_HOST, 6 | port: process.env.SMTP_PORT, 7 | service: process.env.SMTP_SERVICES, 8 | auth: { 9 | user: process.env.SMTP_MAIL, 10 | pass: process.env.SMTP_PASSWORD, 11 | }, 12 | }); 13 | 14 | const mailOptions = { 15 | from: process.env.SMTP_MAIL, 16 | to: options.mail, 17 | subject: options.subject, 18 | html: options.messageContent, 19 | }; 20 | 21 | const mailInfo = transporter.sendMail(mailOptions, (error, result) => { 22 | if (error) { 23 | console.log(error); 24 | // throw new Error("OTP can't be send"); 25 | } 26 | }); 27 | console.log(mailInfo); 28 | }; 29 | 30 | export { sendEmail }; 31 | -------------------------------------------------------------------------------- /src/App.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; 3 | import Navbar from "./Components/Navbar"; 4 | import Footer from "./Components/Footer"; 5 | import Payment from "./Components/Payment"; 6 | import PaymentSuccess from "./Pages/PaymentSucces"; 7 | import PaymentFail from "./Pages/paymentfail"; 8 | import Cart from "./Pages/Cart"; 9 | import Login from "./Pages/Login"; 10 | import Signup from "./Pages/Signup"; 11 | import Shop from "./Pages/Shop"; 12 | import ShopCategory from "./Pages/ShopCategory"; 13 | import Product from "./Pages/Product"; 14 | import Saved from "./Pages/WishList"; 15 | import About from "./Pages/About"; 16 | import Contact from "./Pages/Contact"; 17 | import CheckNow from "./Components/CheckNow"; 18 | import NotFound from "./Pages/NotFound"; 19 | import Search from "./Pages/Search"; 20 | import kids_banner from "./assets/banner_kids.png"; 21 | import men_banner from "./assets/banner_mens.png"; 22 | import women_banner from "./assets/banner_women.png"; 23 | import "./index.css"; 24 | 25 | const App = () => ( 26 | 27 | 28 |
29 | 30 | } /> 31 | } /> 32 | } /> 33 | } /> 34 | } /> 35 | } /> 36 | } /> 37 | } /> 38 | } /> 39 | } /> 40 | } /> 41 | } /> 42 | } /> 43 | } /> 44 | } /> 45 | } /> 46 | } /> 47 | } /> 48 | 49 |
50 |
51 | ); 52 | 53 | const LoginWithFooter = () => ( 54 | <> 55 | 56 |