Table of Contents
To see the demo, visit this link : https://youtu.be/xy7Y642nfAs
As a third project, I made a clone of amazon that includes stripe payments as well as a star review system among other features.
This project has been done in pair programming with Adam Louali.
In order to make the project run on your computer, follow these steps :
NOTICE :
- You can global search for " REMOVED " to easily locate all the information that needs to be replaced in the project.
- Firebase Blaze plan is required to make outbound requests to Stripe.
-
Clone the repo and cd into the project's folder
git clone https://github.com/Diae-Louali/AmazonClone.git
cd amazon-clone -
In your terminal, execute :
npm install
-
Cd to /functions and execure in your terminal :
cd functionsnpm install
-
In Unsplash, register your app and copy the access key
-
Paste the key in src/Seeder.js line 8, like so :
accessKey: "access key goes here", -
In Stripe, copy paste your Publishable key in src/App.js at line 19 :
const promise = loadStripe("publishable key goes here");
-
Copy paste your stripe Secret key in functions/index.js at line 4 :
const stripe = require("stripe")("secret key goes here");
-
In Firebase, go to project settings and copy paste your project ID in the file .firebaserc :
{ "projects": { "default": "project ID goes here" } } -
In project settings, copy the CDN of the Firebase SDK snippet and paste it in src/firebase.js :
const firebaseConfig = { apiKey: "apiKey goes here", authDomain: "authDomain goes here", databaseURL: "hdatabaseURL goes here", projectId: "projectId goes here", storageBucket: "storageBucket goes here", messagingSenderId: "messagingSenderId goes here", appId: "appId goes here", measurementId: "measurementId goes here" }; -
In your terminal, cd back to amazon-clone and execute the following :
firebase emulators:start
-
Copy the api url returned by the previous command and paste it in src/axios.js at line 5 :
+ functions[api]: http function initialized (url to copy from the terminal).
const instance = axios.create({ // THE API (cloud function) URL baseURL: "the api url goes here", }); -
(Optional) To seed the database with products, uncomment the Seeder() function in src/App.js at line 28. It takes about 10 seconds to work (don't forget to comment it back once the database is populated).
Diae Louali - LinkedIn - Loualidiae@outlook.fr
Project Link: https://github.com/Diae-Louali/AmazonClone