Building a Full Stack Clone of Amazon (accounts, checkout, payment processing, order history, etc)
-
To Get Started use npx create-react-app nameofapp
-
create a data base with firebase click </>
-
use sudo npm install -g firebase-tools (sudo helps with installing globally
-
click settings icon > project settings > click config (copy config snippet)
-
Create Firebase.js in src folder
-
Start creating components, add in App.js
-
install material UI /material-ui.com npm install @material-ui/core then install icons with npm install @material-ui/icons or if for fonts use correct npm install command and import each icon as you would and use like a component
-
using props to render different products to , pass in props into the product function product.js
-
install React Router, this is to give your pages different routes like /checkout npm install react-router-dom import { BrowserRouter as Router, Route, Switch } from "react-router-dom"; in app js
-
Use router like this
<Header /> <Switch> <Route path="/checkout"> <h1>I am checkout</h1> </Route> <Route path="/"> <Home /> </Route> </Switch> </div> </Router>``` MAKE SURE TO PUT THE DEFAULT OR EMPTY '/' AT THE BOTTOM OR IT WILL NOT RENDER THE OTHERS. -
Create Checkout page and subtotal install react currency format with npm install react-currency-format
-
Now we have to use React Context API/REDUX for when we add to cart, everytime I add to cart it will push the product into the data layer(react context api/redux). After it is stored inside that data layer we can put it into any component we need like the basket/checkout
-
Add stripe payment processing to project with api key in app.js