This is the Amazon Clone full stack, built by React on the frontend, backend designed by Nodejs, hosted on Firebase, among some features below:
- The Home page
- The Checkout page
- Total price in cart
- The Login page
- User authentication
- The payment page
- Payment processing
This website is deployed at https://clone-ed564.web.app/
When hosting our local app into the link above, there is an issue with ES6 functions firebase while my code is in ES7. Thus, when the customer place an order, proceed to checkout, enter the credit/debit card, click on "Buy Now" button, it will display "processing". I will figure out it.
However, it runs successfully on the local machine. You can follow the instruction below:
- Clone my project into your local machine: git clone "https://github.com/tuyenphk/amazon-fullstack.git"
- Run on the front end first: cd "folder located" then npm install then npm start
- Firebase Console: create the project, choose Web App and then copy Config Firebase SDK into firebase.js
- Authentication: choose "Authentication" in Firebase Console, then enabled the Email/Password
- Remember to run firebase in your local project: npm install -g firebase-tools
- Go to https://stripe.com/, it is used for navigating the credit/debit card information. Sign in this website and go to the "Dashboard", choose "Developers" mode on the left side-bar, then API key. At this page, you will get the "Publishable Key" and "Secret Key"
- The "Publishable key" will be added into the App.js
- Create the Functions Firebase (backend for payment page): firebase init then choose Functions
- When the backend folder is created, add the "Secret key" into the functions/index.js at stripe
- Run backend: cd "backend located" then npm install express cors stripe then firebase emulators:start
- Remember to run both frontend and backend so that when clicking on "Buy Now" button, the confirmation order will be displayed instead of the "processing".