GithubHelp home page GithubHelp logo

basir / amazona Goto Github PK

View Code? Open in Web Editor NEW
584.0 21.0 478.0 1.47 MB

Build Ecommerce Like Amazon By MERN Stack

Home Page: https://www.udemy.com/course/build-ecommerce-website-like-amazon-react-node-mongodb

HTML 3.81% CSS 4.47% JavaScript 91.71% Shell 0.01%
react nodejs reactjs redux redux-thunk expressjs mongoose mongodb bycryptjs

amazona's People

Contributors

basir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amazona's Issues

Adding redux to Homescreen

i keep on getting this error , please assist me ,
error message 1

the code below is what is triggering the error (TypeError: Object(...) is not a function)
useEffect(() => { dispatch(listProducts()); }, [dispatch]);

please help me , please anyone.

Create SECURITY.md

Hey there!

I belong to an open source security research community, and a member (@ktg9) has found an issue, but doesn’t know the best way to disclose it.

If not a hassle, might you kindly add a SECURITY.md file with an email, or another contact method? GitHub recommends this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future.

Thank you for your consideration, and I look forward to hearing from you!

(cc @huntr-helper)

Order id screen (nor backend) is not filtered by owner

I was expecting that in backend (or at least in frontend) there would be a check if the order is belonging to user (or seller or admin).
It seems that anyone could access to orders of another user (thus also some additional data such as shipping address).

TypeError: Cannot read property 'map' of undefined

TypeError: Cannot read property 'map' of undefined

getting this error while working on "Create React App" assignment. The error is coming from App.js

16 |
17 |


18 |

19 |


| ^ 20 | {data.products.map((product) => (
21 |

22 | <a href={/product/${product._id}}>

Header's not responsive

Hello, I finished the course and pressing 'F12' to be responsive, the header is broken. I downloaded the "amazona master" from your repository and it also contains such an error. I hope someone can help me, I will be grateful.

errobasir

Products Not Showing On Home Screen

Products are not showing on Home Screen after connecting to MongoDB (edits to server.js) and deleting ID from products in backend data.js

After deploy to heroku product not showing error

Hllo please help me when I deploy it to heroku and when I will connect with MongoDB atlas it will not insert my sample users and product into online MongoDB atlas database so i will copy paste products data manually it will show product but when I click on product It will show error product not found can you help me to solve this.
And when I register as newbuddy it insert data in online database and also signin works with that .

Heroku Error

2022-07-01T18:57:21.194308+00:00 app[web.1]: [nodemon] app crashed - waiting for file changes before starting...
2022-07-01T18:58:14.106281+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=db-store-app.herokuapp.com request_id=af63302d-a50a-411f-af8e-6ec1cf7adcf0 fwd="41.81.150.65" dyno= connect= service= status=503 bytes= protocol=https
2022-07-01T18:58:20.170740+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2022-07-01T18:58:20.197793+00:00 heroku[web.1]: Stopping process with SIGKILL
2022-07-01T18:58:20.356448+00:00 heroku[web.1]: Process exited with status 137
2022-07-01T18:58:20.525483+00:00 heroku[web.1]: State changed from starting to crashed
2022-07-01T18:58:21.554536+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=db-store-app.herokuapp.com request_id=78723726-98c3-4423-8be4-41b3638ae7ac fwd="41.81.150.65" dyno= connect= service= status=503 bytes= protocol=https

heroku demand ES2015 or SyntaxError: Unexpected identifier for server side

i have fallow the tutorial up to video no 45 - full course.
i getting this error when deploying to heroku.

/app/back-end/server.js:1
import express from 'express'
^^^^^^^
app[web.1]:
app[web.1]: SyntaxError: Unexpected identifier.

at video 45 the website is pushing to heroku as is..
and in my case i had to convert only the server side to es2015 to see it working on heroku.

this is my root package.json

`{

"name": "amazona-shop-ml-1",

"version": "1.0.0",
"description": "eCom react and node look like amazon",
"main": "index.js",
"engines": {
"node": "12.4.0",
"npm": "6.9.0"
},
"scripts": {
"build": "cd front-end && npm install && npm run build",
"start": "nodemon --watch back-end --exec node --experimental-modules back-end/server.js"
},
"scriptsxxxxx": {
"heroku-postbuild": "npm run build && cd front-end && npm install && npm run build",
"build": "cd front-end && npm install && npm run build",
"start": "nodemon --watch back-end --exec babel-node back-end/server.js",
"server": "nodemon --watch back-end --exec babel-node back-end/server.js",
"client": "cd front-end && npm run start",
"dev": "npm run server & (npm run client)",
"dev1": "concurrently "npm run server" "npm run client""
},
"author": "",
"license": "ISC",
"dependencies": {
"bcrypt": "^5.0.0",
"bcryptjs": "^2.4.3",
"body-parser": "^1.19.0",
"concurrently": "^5.3.0",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"express-async-handler": "^1.1.4",
"jsonwebtoken": "^8.5.1",
"mongoose": "^5.10.15",
"multer": "^1.4.2"
},
"devDependencies": {
"@babel/cli": "^7.12.1",
"@babel/core": "^7.12.3",
"@babel/node": "^7.12.6",
"@babel/preset-env": "^7.12.1",
"eslint": "^7.15.0",
"eslint-plugin-react": "^7.21.5",
"nodemon": "^2.0.6"
}
}
`

i would like to use the save ES version as in the course and not an old version of java script.

regards.

React application is not opening, it showing error

PS D:\projects\e-Commerce Website\Grab & Go\frontend> npm start

[email protected] start
react-scripts start

'Go\frontend\node_modules.bin' is not recognized as an internal or external command,
operable program or batch file.
internal/modules/cjs/loader.js:965
throw err;
^

Error: Cannot find module 'D:\projects\e-Commerce Website\react-scripts\bin\react-scripts.js'
←[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:962:15)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:838:27)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)←[39m
←[90m at internal/main/run_main_module.js:17:47←[39m {
code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: []

Iam getting Order validation failed error in backend terminal when I click on place order button. can anyone help me to fix this issue with line of code as i

ValidationError:: orderItems.0.product: Path product is required.
at model.Document.invalidate (C:\Users\madhu\Desktop\Student Projects\Latest\mongodb\node_modules\mongoose\lib\document.js:2760:32)
at EmbeddedDocument.invalidate (C:\Users\madhu\Desktop\Student Projects\Latest\mongodb\node_modules\mongoose\lib\types\embedded.js:298:29)
at C:\Users\madhu\Desktop\Student Projects\Latest\mongodb\node_modules\mongoose\lib\document.js:2552:17
at C:\Users\madhu\Desktop\Student Projects\Latest\mongodb\node_modules\mongoose\lib\schematype.js:1273:9
at processTicksAndRejections (internal/process/task_queues.js:75:11)

Error handling issue

Hi. There's a problem with error handling. Whenever you enter a wrong product id in the browser bar, the response must be 404 Product Not Found. But, if you enter manually an ID that is not in MongoDB format (for example, if you make it shorter) the backhand throws an error in 'find' function which is shown on the front end. How can we check for correct formatting? Preferably before the request goes, so that we could redirect the user immediately.

State of cart does not change when sign out

The state of cart (if there were items in it) is not set to empty when user signs out.

export const signout = () => (dispatch) => {
localStorage.removeItem('userInfo');
localStorage.removeItem('cartItems');
dispatch({ type: USER_SIGNOUT });
};

TypeError: products.map is not a function

import React, { useEffect, } from 'react';

import Product from '../components/Product';
import LoadingBox from '../components/LoadingBox';
import MessageBox from '../components/MessageBox';
import { useDispatch, useSelector } from 'react-redux';
import { listProducts } from '../actions/productAction';

export default function HomeScreen() {
const dispatch = useDispatch();
const productList = useSelector((state) => state.productList);
const { loading, error, products } = productList;

useEffect(() => {
dispatch(listProducts());
}, [dispatch]);
return (


{loading ? (

) : error ? (
{error}
) : (

{products.map((product) => (

))}

)}

);
}

Request failed with status code 404

everything has been going well as am building shopping cart, but when i click in product it says request failed with status code 404.
here is my server.js

`import express from 'express';
import data from './data.js';

const app = express();

app.get('/api/Products/:id', (req, res) => {
const product = data.products.find((x) => x._id === req.params.id);
if (product) {
res.send(product);
} else {
res.status(404).send({ message: 'Product Not Found' });
}
});

app.get('/api/products', (req, res) => {
res.send(data.products);
});
app.get('/', (req, res) => {
res.send('Server is ready');
});
const port = process.env.PORT || 5000;
app.listen(port, () => {
console.log(Serve at http://localhost: ${port});
});`

lesson 28

I followed EXACT STEPS from lesson1 until 28, when I clicked place order button , it returned INVALID TOKEN. INSPECT shows " Failed to load resource: the server responded with a status of 401 (Unauthorized) "...
Can anyone help

?

Issue while trying to seed the application off fresh fork and install

Hello Basir, thank you for providing this as a reference and making this code available. I went through some of the tutorials on YouTube and thought I would try to fork and start fresh from your repo. I was having an issue with running the seed URL on localhost.
from: " 5. Seed Users and Products
Run this on chrome: http://localhost:5000/api/users
It returns admin email and password ";

{
"message": "ENOENT: no such file or directory, stat '/Users/johnsasser/Desktop/SandBox/amazona/frontend/build/index.html'"
}

is the return message from the req.
I got 500 internal server err on the GET req.
I received the same results from both seeding instructions. Is there something simple I am missing?

TypeError: products.map is not a function

facing these issues at the homeScreen.js

`import React, { useEffect, useState } from 'react';
import axios from 'axios';
import Product from '../components/Product';
import LoadingBox from '../components/LoadingBox';
import MessageBox from '../components/MessageBox';

export default function HomeScreen() {
const [products, setProducts] = useState([]);
const [loading, setLoading] = useState(false);
const [error, setError] = useState(false);
useEffect(() => {
const fecthData = async () => {
try {
setLoading(true);
const { data } = await axios.get('/api/products');
setLoading(false);
setProducts(data);
} catch (err) {
setError(err.message);
setLoading(false);
}
};
fecthData();
}, []);
return (


{ loading ? (

) : error ? (
{error}
) : (

{products && products.map((product) => (

))}

)}

);
}
`

SyntaxError: Unexpected identifier

Hi,

I keep getting "SyntaxError: Unexpected identifier" when trying to run node in the beginning of lesson 9.

I also added "type": "module" in the package.json. Nothing works.

Here is my code in server.js:

`import express from 'express';
import data from './data.js';

const app = express();

app.get('/api/products', (req, res) => {
res.send(data.products);
});

app.get('/', (req, res) => {
res.send('Server is ready');
});

app.listen(5000, () => {
console.log('Serve at http://localhost:5000');
});`

UI flickering

Hi,
do you have any solution for flickering UI while loading?
Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.