Giter VIP home page Giter VIP logo

arcadia's Introduction

Arcadia (Ecommerce Website)

A one-stop-shop for the stylish wear

App Features

Home

Pop-up for Newsletter (React Modal)

modal

  Pop-up to for newsletter. 
  Stops popping up after ~10 user visits or if they have already registered for it.

Newsletter & Discount code

news

  Used email.js to send email, which icludes a one time $20 discount code per user.
  Collects emails in firebase (scalability)

Cart & Stripe

cart product checkout stripe

  Product items with sale prices & categories.
  Payment through Stripe.

User Authentication & Authorization

user

  Email, google & github login. Signout with firebase.

Packages, Libraries, Techonolgies & APIs Used

Icons

    React Icons, icon8 & heroIcons

Routing

React router

APIs

Fake store API for json products. Axios for handling http requests from node.js 

State management

Redux Tookit, Persist & Devtools.

Rather than setting up & connecting the state management and then praying that it works, redux devtools is as critical as the Postman & chrome devtools.

Persist to store cache (redux store payload-> states -> initialValues & action to mutate with action in reducers) on user's local storage. 
Keeps states on browser refresh on unencrypted async storage on React native's store

Notifications

React Toastify to handle notifications

Storage

    Firebase to stores user info for authentication & authorization 

Payments

    Stripe to handle payments with auth in node.js.

Main programs used

TailwindCss, React, Node, Express

Lessons Learned

Refactoring

  Did not account for all edge cases with the redux reducers as I added more features to the project like the discount, modals & tax.
  Had to revise the reducers & states multiple times. I always create flowcharts & a sketch mock-up of what I want my project to be 
  however, it would be best to compile all the resources online of all the features I want to implement before I begin.
  Would save me a lot more time.

Stripe

  When testing the server with simple http request with POSTMAN, it worked until I tried to make payments through the UI.
  I tried the in-build resource fetch API instead of axios, with a bearer & stripe token from the UI but it not work.
  Also solutions included specified the which domains could make requests to the server but that also failed. 

  I knew I was getting close to the solution when the error on chrome devtool went from 'Network error' to 'Network Refused'.
  This told be that it was a cors error, that made STRIPE to block the authorization. The solution was to explicitly allow
  domains to make requests '*' & a header for the 'POST' request. 

    //Force cors & stripe error
    res.header('Access-Control-Allow-Origin', '*');
    res.header('Access-Control-Allow-Headers', '*');
    res.header('Access-Control-Allow-Headers', 'POST');

Run Locally

Clone the project. Add environment variable for STRIPE & public API keys for email.js

Client

  npm run dev

Client

  nodemon index.js

Server

Deployed on Render

https://github.com/hakeem0114/Arcadia_server

arcadia's People

Contributors

hakeem0114 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.