/Tesla-Clone-By-Devang-Sharma

Amazon Clone By Devang Sharma as part of Masterclass with Newton School

Primary LanguageJavaScript

Author:

πŸ† DEVANG SHARMA πŸš€
πŸ† Linktree: https://linktr.ee/idevangsharma

About:

This Project was Made in Masterclass by Devang Sharma in Collaboration with Newton School.

This project was bootstrapped with Create React App.

An amazing TESLA clone built using React JS for frontend and Firebase for Backend πŸ˜€πŸ˜Ž.

Summary:

βœ… Introduction- DONE

Date : 3rd April 2022
Mentor: DEVANG SHARMA
Batch: NEWTON SCHOOL
Agenda : Tesla - Product Overview, Clone, and Hosting

βœ… Introduction :
βœ… Live Demo of Clone- Web Version
βœ… Scope and Definition
βœ… Tesla as a Product
βœ… Requirement clarification
(1) Functional
(2) Non Functional
(3) Out of Scope

βœ… Intro to React Js
βœ… Environment Setup- VS Code
βœ… Useful Extensions
βœ… Github Account
βœ… Create Repo: Tesla clone by devang [first name]:

βœ… Steps:
(1) Create App:
(2) Setup Firebase:
(3) Setup React Router: IMPORTANT and Its Use Cases (No Refresh- SPA with Multiple Pages):
(4) Build Nav Bar (Header) - STICKY
(5) Build Banner
(6) Product Component
(7) React Context API/ Redux
(8) Add to Basket Button
(9) Checkout Page
(10) Subtotal Component
(11) Login Page
(12) Deploy Page LIVE on Firebase

βœ… BEM Model in CSS (Block, Element, Modifier)
βœ… Heroku Account:
βœ… Firebase Account:

"Please Type 'Hi' in the Chat Box if you have joined and Can See this Screen". "We Will Start immediately After Every one has joined the session"

-> Introduction : DONE

-> Live Demo of Tesla: DONE

-> Live Demo of Clone- Web Version - DONE


πŸš€ First React App

  • Install Node and Npm (Node Package Manager) in your System - DONE
    (https://nodejs.org/en/download/)
    Check With: node -v and npm -v

  • Diff between npm create and npx create
    (npm install -g create-react-app --template redux)
    (npx create-react-app tesla-clone-by-devang)

πŸš€ Accounts Required : Github and Heroku- DONE

Redirect URI- http://localhost:3000/ - DONE

πŸš€ Coding, Coding and Coding: MOST Imp and Fun: 1 Hr 15 Mins- DONE

πŸš€ Push to Github: 5 Mins- DONE

πŸš€ Hosting on Heroku (Deployment on Prod): 10 Mins- DONE

πŸš€ npm install and npm start commands (Local and Prod Builds)- DONE

πŸš€ ColorZilla Chrome Extension

https://chrome.google.com/webstore/detail/colorzilla/bhlhnicpbhignbdhedgjhgdocnmhomnp/related?hl=en

πŸš€ Es7 VS Code Extension

(Type rfce and Enter)

πŸš€ object-fit: contain

(PRO Tip to Make Responsive Web Pages)

πŸš€ LIVE DEMO of Clone We Will Build:

πŸš€ CODING:

πŸš€ Github Push

  • DO NOT PUSH Node-Modules

Two Methods:
(1) Github Desktop

(2) Git Command

git status
git add . (Don't Use Node Modules)
git commit -m "Added Tesla Clone"
git push

πŸš€ Host on Heroku

(1) Create Profile On Heroku
(2) Create Repo
(3) Create Heroku App
(4) Select Region - US ot Europe
(5) Select Github Repo
(6) Deploy on Heroku


Build Will be Successful and Tesla Clone would be published to a LIVE Website.

πŸš€ Ending:

(1) Post About in Linkedin
(2) Github Link and recording
(3) Certificate
(4) Newton School

πŸš€ Web Site:

Front-End:

Client Side:

  • What you See/Experience as a User ? (UI and UX)

UI: User interface
UX: User Experience

πŸš€ Web Site:

πŸš€ Front End:

  • Languages: HTML, CSS, JS, Typescript
  • Frameworks: React, Angular, Vue

πŸš€ BackEnd:

  • Languages: Java, Node.js, Python, C++, C# etc
  • Framework: Django, Flask, Spring Boot etc

πŸš€ Mobile Application:

  • Android (Google): Java, Kotlin
  • iOS (Apple): Swift

πŸš€ New things: Flutter, React Native : BOTH for Android and iOS


πŸš€ Tesla Clone:

  • Front End: React js with Redux
  • Back End: Firebase

πŸš€ Live Demo of Tesla Clone:

(1) Header

  • Tesla Logo
  • Navigation Bar:
    • Model X
    • Model Y
    • Model S
  • Hamburger Menu: List of Items

(2) Body:

  • Different Products

Each Product:

  • Bg Image
  • Name of Model
  • Order Online for Touchless Delivery
  • 2 Buttons: (1) Custom Order (2) Existing Inventory
  • Arrow Down Icon (Except On Last Page)

πŸš€ Database:

(21) User Profile:

  • User Details
  • Name
  • Email
  • Geoloaction (Lat, Long)
  • Profile Picture
  • Saved (Cart Items)

(2) Authentication:

  • Sign Up (Create New Username and PW)
  • Login (Match Username with PW)

Client ---> Username + PW ----> jkhghdjsg27863787897912 --> Server

{ username: devang@gmail.com PW: devang }

devang ---> jkhghdjsg27863787897912: ENCRYPTION

If Correct, Login Else, Incorrect Password

πŸš€ BackEnd: FIREBASE:

  • Firebase: Set of Tools/Suite of Tools
  • Firebase: Database
  • Firebase: Authentication
  • Firebase: Storage
  • Firebase: Hosting
  • Firebase: Messaging
  • Firebase: Realtime Database

πŸš€ FIREBASE Setup STEPS:

Link: https://firebase.google.com/

  • Add Project
  • Configure Google Analytics
  • Register the App with Hosting
  • npm install firebase
  • sudo npm install -g firebase-tools

Link: https://console.firebase.google.com/

πŸš€ Steps:

(1) Clone the Repo
(2) Install Dependencies
Command: npm install
(3) Run the App
Command: npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

BackEnd: FIREBASE: DONE

  • Firebase: Set of Tools/Suite of Tools
  • Firebase: Database
  • Firebase: Authentication
  • Firebase: Storage
  • Firebase: Hosting
  • Firebase: Messaging
  • Firebase: Realtime Database

Free Hosting:

  • Heroku
  • Netifly
  • AWS
  • Github Pages

Firebase Setup:

(1) https://firebase.google.com/ Go to Console

Tesla Key:

// For Firebase JS SDK v7.20.0 and later, measurementId is optional const firebaseConfig = { apiKey: "AIzaSyAHMFvnrKGjcYhhz3OsB6SQwLsYFSX_su4", authDomain: "tesla-clone-b5fee.firebaseapp.com", projectId: "tesla-clone-b5fee", storageBucket: "tesla-clone-b5fee.appspot.com", messagingSenderId: "33288283283", appId: "1:33288283283:web:197d797196016b71415966", measurementId: "G-C6FSML87Q7" };

Group Photo: DONE

-> First React App

Check With: node -v and npm -v

  • Diff between npm create and npx create (npm install -g create-react-app)

Choose Any Folder: (npx create-react-app tesla-clone-by-devang)

Redux Template: (npx create-react-app tesla-clone-by-devang --template redux)

Code: npm start

-> Accounts Required : Github, Firebase or Heroku-

Redirect URI- http://localhost:3000/ - DONE

-> Coding, Coding and Coding: MOST Imp and Fun: 1 Hr 15 Mins-

-> Push to Github: 5 Mins-

-> Hosting on Heroku (Deployment on Prod): 10 Mins-

-> npm install and npm start commands (Local and Prod Builds)-

LIVE DEMO of Clone We Will Build:

---> React Routers:

Install:

npm install react-router-dom@5

OR

yarn add react-router-dom@5

---> NAV BAR

-> Tesla Logo:

(1) react-reveal Package

https://www.npmjs.com/package/react-reveal

npm install react-reveal --save

(2) styled-component

npm install styled-component --save

(3) material-ui

npm install material-ui --save

-> ColorZilla Chrome Extension

-> Es7 VS Code Extension (Type rfce and Enter)

-> object-fit: contain

(PRO Tip to Make Responsive Web Pages)

LIVE DEMO of Clone We Will Build:

CODING:

  • Create Login Page

Flipkart -> Pay -> Paytm -> Payment -> Flipkart

Github Push

  • DO NOT PUSH Node-Modules

Two Methods: (1) Github Desktop (2) Git Command

git status git add . (Don't Use Node Modules) git commit -m "Added Tesla Clone" git push

Host on Heroku (1) Create Profile On Heroku (2) Create Repo (3) Create Heroku App (4) Select Region - US ot Europe (5) Select Github Repo (6) Deploy on Heroku

Ending:

(1) Post About it on Linkedin: DONE (2) Github Link and recording (3) Certificate (4) Newton School


πŸš€ Practical Example:

Client -Server Architecture

Dine in a Restaurant ?

"I want a Cheese Margharita Pizza"

Client: Making Request: Me

Server: Give Response: Kitchen

  • Logic: Add Cheese + margharita to the topping
  • DB: Ingredients + Crust + ....

API: Get Results from Server and Give it to Client: Waiter

UI: Size of Pizza, Looks, ...

UX: Taste of Pizza, How Crusty it is....

πŸš€ Web Applications:

Front End:

  • Languages: HTML, CSS, JS, Typescript
  • Frameworks: React, Angular, Vue

BackEnd:

  • Languages: Java, Node.js, Python, C++, C# etc
  • Framework: Django, Spring Boot etc

Mobile Application:

  • Android (Google): Java, Kotlin
  • iOS (Apple): Swift

New things: Flutter, React Native : BOTH for Android and iOS


This project was bootstrapped with Create React App.

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

npm run eject

Note: this is a one-way operation. Once you eject, you can’t go back!

If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

Code Splitting

This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

Analyzing the Bundle Size

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

Making a Progressive Web App

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

Advanced Configuration

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

npm run build fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

Credits ⭐️

⭐️ All Credits Owned and reserved by DEVANG SHARMA, and in Collaboration with Newton School. Must Seek Author Approval before use.

⭐️ From DEVANG SHARMA

Thankyou for Visting My Profile :)

With Love,

Devang