Giter Site home page Giter Site logo

amazone-clone-2.0's Introduction

How to Implemanting firebase

  1. First you have go to https://firebase.google.com/ and and click "go to console"
  2. Create new project do you want to build than click settings icon and after dropdown list click "projcet settings"
  3. click add web and enter your nickname web app and click config after that copy that config and save in firebase.js
  4. click authentication you can choose what you want use but i just use google after you have config that settings copy GOOGLE_ID and GOOGLE_SECRET and save in .env.local

IF you get some error in this case

Authorization Error Error 400: redirect_uri_mismatch

You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy.

If you're the app developer, register the redirect URI in the Google Cloud Console.

you can just go https://cloud.google.com/appengine/?utm_source=google&utm_medium=cpc&utm_campaign=japac-AU-all-en-dr-bkws-all-all-trial-e-dr-1009882&utm_content=text-ad-none-none-DEV_c-CRE_582319728387-ADGP_Hybrid%20%7C%20BKWS%20-%20EXA%20%7C%20Txt%20~%20Compute%20~%20App%20Engine_cloud%20computing%20-%20cloud_V4-KWID_43700069451405574-aud-970366092687%3Akwd-134064744524&userloc_9072594-network_g&utm_term=KW_api%20google%20cloud&gclid=Cj0KCQiApL2QBhC8ARIsAGMm-KG5HFBTfYtM_64cikIBfdyo5oT141I8YQaO1SzFLKWD025yuAEaUC4aAhbREALw_wcB&gclsrc=aw.ds this are GCP links to set web app config

  1. first you go to APIs & Services and click the credentials added new authorized link javascript origins you can added http://localhosst:3000
  2. and create URIs http://localhost:3000/api/auth/callback/google

How use stripe into your app

1). you can go to this link https://stripe.com/ to see the fiture and what you can get from this app 2). Click unto developers mode and see after dropdown you can click Documentation check to stripe checkout in sidebar link to get guide made app with stripe. Than you can click Accept a payment 3). That have a guide how to set up stripe in your workspace.

How to integrating Stripe CLI

  1. First you can go to stripe docs and got to Stripe CLI and than install that.
  2. Then you can run stripe.exe if you use windows in your cmd than you can write stripe login in CLI
  3. Then you can write this stripe listen --forward-to localhost:3000/api/webhook
  4. After that you have STRIPE_SIGNING_SECRET=your_secret_key_you_get_from_cli

How to creating webhook

  1. First you have to install micro and firebase-admin and made webhook.js in api couse all in api folder run in backend with node.js
  2. After you have install all you have install permission from firebase go to console and click project settings then you can go to service accounts to generate new private key and than pull thae json file to you workspace and rename that to permisson

How to test payment with dummy card payment

use this code payment : 424242424242424
end exp 04/24
secure code: 424

How to get webhook from stripe

you have got admin dashboard and go to webhooks and add endpoints add your URL endpoint and than select event pick checkout.session.completed

Amazon Clone

Template Screenshot

Live demo

Installation Steps

Using npm

Run commands

  1. npm install

  2. npm run dev

Or using yarn

Run commands

  1. npm install --global yarn

  2. yarn install

  3. yarn run dev

Environment variables

Open or create a .env file then edit add this setting

# Authentication
GOOGLE_ID=key_goes_here
GOOGLE_SECRET=key_goes_here
NEXTAUTH_URL=http://localhost:3000

# Stripe
STRIPE_PUBLIC_KEY=key_goes_here
STRIPE_SECRET_KEY=key_goes_here

# Stripe Terminal/CLI
STRIPE_SIGNING_SECRET=key_goes_here

HOST=http://localhost:3000

# Need to add this to... google cloud
# http://localhost:3000/api/auth/callback/google

What tech i us to build AMAZON 2.0!

1). Next.js
2). React.js
3). Redux.js
4). tailwindcss
5). firebase and firebase-admin
6). nextAuth.js
7). heroicons.js
8). axios
9). stripe
10). Web Hooks
11). micro

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

amazone-clone-2.0's People

Contributors

peaceantohim avatar

Stargazers

 avatar

Watchers

 avatar

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.