Skip to content

A clothing e-commerce website that allows users to create an account or login with a Google account, add products to their cart and checkout using Stripe API. Client-side created using React and SASS. Server-side created using Firebase for authentication and databse storage.

Notifications You must be signed in to change notification settings

HaylzRandom/clothing-ecommerce-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clothing E-Commerce Website

Table of Contents

Description

A clothing e-commerce website that allows users to create an account or login with a Google account, add products to their cart and checkout using Stripe API. Client-side created using React, SASS. Server-side created using Firebase for authentication and databse storage.

Technologies

HTML5 CSS3 SASS JavaScript React React Router Firebase Redux Stripe API Netlify

Packages

NameDescription
@reduxjs/toolkitUsed for state management to manage the state of the user, products in the cart and the categories and products.
@stripe/react-stripe-jsReact Stripe.js is a thin wrapper around Stripe Elements. It allows you to add Elements to any React app. Used to add Card Element for payment form and also the hook to safely pass payment information collected by the Card Element to the Stripe API.
@stripe/stripe-jsUsed to return a promise that resolves with a newly created Stripe Object. Allows connection of Stripe API.
dotenvUsed to load Stripe API keys from .env file.
firebaseUsed for user authentication via email and password and also Google sign in. Firestore database used to store product information and user information.
reactJavaScript library for building user interfaces
react-domPackage that provides DOM-specific methods for React
react-reduxUsed for state management to manage the state of the user, products in the cart and the categories and products. Specifically used for creating selectors of returning cart values and returning products to display.
react-router-domEnables client side routing navigation.
redux-loggerRedux middleware used in development to debug and track state using redux.
redux-persistUsed with redux to persist and rehydrate a redux store. Will persist cart products, user state and what products have been fetched.
reselectUsed with redux to create memoized selectors.
stripeProvides access to Stripe API to server-side code. Used specicially for netlify functions to connect to Stripe API using API key and also creating the payment object that is sent to Stripe.
sassUsed to style React App using SCSS
@fortawesome/fontawesome-svg-coreCore package for utilising FontAwesomeIcons in React
@fortawesome/free-regular-svg-iconsFontAwesome Icon pack for free regular icons
@fortawesome/free-solid-svg-iconsFontAwesome Icon pack for freesolid icons
@fortawesome/react-fontawesomePackage containing FontAwesome React component to allow easy use of icons in components
react-toastifyPackage for displaying stylish toast notifications

Install Instructions

To run locally on machine (assuming up to date Node Package Manager), first install dependencies:

npm install

npm install netlify-cli -g

To run locally in browser:

netlify dev

Stripe API

You will require your own instance of Stripe API for the code to function properly. Follow instructions below to run project locally:

  • Create account at Stripe
  • Create .env file and create two variables named:
    • REACT_APP_STRIPE_PUBLISHABLE_KEY
    • STRIPE_SECRET_KEY
  • Copy Publishable key from Stripe website and insert into REACT_APP_STRIPE_PUBLISHABLE_KEY
  • Copy Secret key from Stripe website and insert into STRIPE_SECRET_KEY
  • You should now be good to go if not feel free to contact me and I can try to help!

Roadmap

Features

  • Confirmation page after checking out
  • Attach orders to users (store inside Firebase)
  • Profile page allowing user to edit profile details
  • Add ability to pay via different options
  • Add a clear cart button

Optimisations

  • Have title of website point to current page
  • Redirect after sign up/login to account
  • Allow users to delete their account from database
  • On signing out, clear cart items
  • Use toast alerts for confirmation and errors
  • Empty cart after checking out

UI

  • Mobile Stylings
  • Colour Themes

About

A clothing e-commerce website that allows users to create an account or login with a Google account, add products to their cart and checkout using Stripe API. Client-side created using React and SASS. Server-side created using Firebase for authentication and databse storage.

Topics

Resources

Stars

Watchers

Forks