NirajD10 / pureplantparadise

An E-commerce indoor plant selling site using MERN Stack
https://pureplantparadise.netlify.app/
5 stars 0 forks source link

how to run this project local #1

Closed dipesh-17 closed 6 months ago

dipesh-17 commented 6 months ago

can you provide exact files and steps to run locally

NirajD10 commented 6 months ago

Hello @dipesh-17 , Have you read details from README.md? what are issue you are facing to?

dipesh-17 commented 6 months ago

Niraj Sir can you share me your .env file for reference I'm not getting should i add to in that file

NirajD10 commented 6 months ago

@dipesh-17 Yes, you may need create .env file in both frontend and backend. The environment value details are mentioned on README.md

NirajD10 commented 6 months ago

@dipesh-17 Please don't not put example line ("for example - FRONTEND_URL = "http://localhost:5173/" ") and ("Make sure replace your backend url" ) in .env file.

have you started backend server before starting frontend?

dipesh-17 commented 6 months ago

Yes, I have started but I'm not getting how to get the backend URL it's working on the 3000 port and the frontend on 5173. so can you suggest me changes by looking above .env files? backend frontend error1 error2 erroe3

NirajD10 commented 6 months ago

ah I understood the situation. It's look like I didn't implement banner image upload on admin store settings. I added manual image upload on firebase storage. I am sorry about this. I'll fix this bugs.

if you want to run site. You may need to create new Folder and name it as "Home_Banner" from Firebase storage and upload it image as much as you want as banner.

NirajD10 commented 6 months ago

2)http://localhost:3000/admin/login 500 (Internal Server Error) please niraj sir can suggest me what are changes i need to do in .env file I have no idea about that .

You need to create admin account by doing manual fill data from mongodb. for hashed password you can try generate this link and store it value as hashedpassword.

for example, (this is how structure object are admins reference in mongodb) -

{
  email: "admin email"
  hashedpassword: "put encrypted hashed password"
  role: "super-admin"
}

if you want to allow other user account to limit role in admin , then you may assign role as "demo"

dipesh-17 commented 6 months ago

Niraj Sir, I have added an admin account the database according to the you have provided solution and also it's successfully login into the application, but I'm getting this error at the admin dashboard.

image Also on user side there is no products available, so i can i add a manual into the database

NirajD10 commented 6 months ago

@dipesh-17 its look like GET method url are getting double slash. "//admin/dashboard". please check .env from frontend where VITE_BACKEND value should be http://localhost:3000. so the url should work as http://localhost:3000/admin/dashboard

NirajD10 commented 6 months ago

@dipesh-17 you don't need create manual data. You need access admin dashboard. once its view you can create it there,

can you please check chrome network tabs and find dashboard request ? these are my request image

dipesh-17 commented 6 months ago

image see mine can you share your complete .env file ?

NirajD10 commented 6 months ago

@dipesh-17 Please check what response has given?

.env is meant to be secret. it should not be share anyone. please config it well. I'll remove value with keeping environment key -

.env file from frontend

VITE_BACKEND=http://localhost:3000
BACKEND=http://localhost:3000
VITE_AUTH_API_URL=http://localhost:3000/auth/
VITE_ADMIN_AUTH_API_URL=http://localhost:3000/admin/
VITE_PRODUCTION_MODE=false

VITE_URL=http://localhost:5173
dipesh-17 commented 6 months ago

how can I add an attribute group there, can you provide me products detail and images?

image

NirajD10 commented 6 months ago

@dipesh-17 first you need to create categories. then you can choose attributes belongs to attribute group(categories)

dipesh-17 commented 6 months ago

error_monday

Niraj Sir now everything is running only I have issue in the admin dashboard it's not opening see this issue. I need your help for issue. I also want you can add a feature every customer can cancel their order if needed.

NirajD10 commented 6 months ago

Niraj Sir now everything is running only I have issue in the admin dashboard it's not opening see this issue. I need your help for issue. I also want you can add a feature every customer can cancel their order if needed.

Please raise new issues and give proper more details as new feature.

dipesh-17 commented 6 months ago

Niraj Sir Still I'm facing an issue with the admin dashboard after successful login it redirects to the admin dashboard but I'm getting this issue. | error_monday

image

NirajD10 commented 6 months ago

@dipesh-17 I'll look it and will fix it. I am closing this issues.