E-commerce Website | Reactjs | Nodejs | Mongodb | Expressjs | JWT | Tailwind Css

  • By Hasan
  • Last update: Dec 26, 2022
  • Comments: 5

Project Demo

Alt text

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

NPM / Yarn and Node.js installed

Installing

Installing NPM modules on both client and server folders

Execute these commands from the project directory

cd client && npm install
cd server && npm install

Running the app

Open a terminal on server directory

npm run start:dev

and open another terminal on client directory

npm run start

Access the web app at http://localhost:3000/

Github

https://github.com/hasan-py/MERN_Stack_Project_Ecommerce_Hayroo

Comments(5)

  • 1

    MongoError: E11000 duplicate key error collection: amazona.products index: name_1 dup key: { name: null }

    I am getting this error when I am trying to add product second time through admin panel.

    MongoError: E11000 duplicate key error collection: amazona.products index: name_1 dup key: { name: null } at Function.create (D:\a_project\project\server\node_modules\mongodb\lib\core\error.js:57:12)
    at toError (D:\a_project\project\server\node_modules\mongodb\lib\utils.js:130:22) at D:\a_project\project\server\node_modules\mongodb\lib\operations\common_functions.js:258:39
    at handler (D:\a_project\project\server\node_modules\mongodb\lib\core\sdam\topology.js:943:24)
    at D:\a_project\project\server\node_modules\mongodb\lib\cmap\connection_pool.js:350:13 at handleOperationResult (D:\a_project\project\server\node_modules\mongodb\lib\core\sdam\server.js:558:5) at MessageStream.messageHandler (D:\a_project\project\server\node_modules\mongodb\lib\cmap\connection.js:281:5) at MessageStream.emit (events.js:376:20)
    at processIncomingData (D:\a_project\project\server\node_modules\mongodb\lib\cmap\message_stream.js:144:12) at MessageStream._write (D:\a_project\project\server\node_modules\mongodb\lib\cmap\message_stream.js:42:5) at writeOrBuffer (internal/streams/writable.js:358:12) at MessageStream.Writable.write (internal/streams/writable.js:303:10) at TLSSocket.ondata (internal/streams/readable.js:745:22) at TLSSocket.emit (events.js:376:20) at addChunk (internal/streams/readable.js:309:12) at readableAddChunk (internal/streams/readable.js:284:9) { driver: true, index: 0, code: 11000, keyPattern: { name: 1 }, keyValue: { name: null } }

  • 2

    Upload issue

    Hi Hasan, this project is awesome but the upload isn't working. as you already quoted _In uploads folder you need create 3 folder like bellow. Folder structure will be like: public -> uploads -> 1. products 2. customize 3. categories_

    but there is not uploads folder anywhere. Can you share the proper path for the same?

    I have tried creating server/public/uploads/categories but while doing that getting

    POST /api/customize/upload-slide-image 500 1267.869 ms - 277 Error: ENOENT: no such file or directory, open 'public/uploads/categories/1a.jpeg'

  • 3

    Brother you are a dope developer how did u learn so much???

    Please let me know in the comments. How do u code so much do u read documentation or do you watch video tutorials and do u listen to music while programming.

  • 4

    Fix the update product cover image

    Thanks for your great product.

    I have fixed the issue of updating the product cover image and updated the function deleteImages in the Products controller. Please check my PR.

    Regards,

    Harry

  • 5

    Add env to git ignore

    Hey Hasan, I happen to see your youtube video and came to view your code. The first thing I noticed is you have added all the API key to Github, make sure .env is not added to Github.