Giter Club home page Giter Club logo

react-shopping-cart's Introduction

Description

  • Online video game shopping website that uses RAWG.IO API for video game data, where you can view the catalog and add items to your cart.

Applied skills

  • React routes
  • React hooks
  • React props
  • Handling inputs and rendering lists
  • Calling third-party APIs

Resources

Issues

  • the first issue had to do with the build environment.. updating the Build command from npm run build to CI=false npm run build worked in solving the build issues on Netlify

  • Attempting to use Netlify's serverless function

    • API call not working on server, but working on local
    • I spent many hours trying to figure out why my API calls were working on my local development environment and not on Netlify. I followed the freeCodeCamp Netlify tutorial linked in the resources, and my project worked locally using netlify dev. However, I ran to issues when deploying my project on netlify.
    • By following the freeCodeCamp tutorial, I created a .js file in netlify/functions so Netlify knows where to locate my functions. And, I used try-catch with axios.get for the API call. This worked locally, but caused issues on the server. I ended up commenting out the code in the .js file in netlify/functions and used fetch instead of axios directly in the component I was working in. I also set api key in .env the REACT way, and the API call ended up working both locally and on Netlify.
      • I learned more about serverless functions and was able to get the functions working properly locally by following this and this tutorial
        • adding netlify.toml and renaming the netlify folder to .netlify
        • by following the tutorials step by step, I was able to build up my knowledge and get my APIs working properly with the serverless functions
        • it seems that most of the local errors had to do with syntax such as using /.netlify/functions instead of ./netlify/functions and running the local server on localhost:8888 and not localhost:3000
  • third party API calling using serverless functions is not working.. trying to fetch/axios into /.netlify/functions/gif-get isn't working properly

    • the data comes out in some unreadable form
    • axios into /.netlify/functions/helloWorld does work and the data is readable

Todo

  • style
  • test app using React Testing Library

react-shopping-cart's People

Contributors

raymart-evangelista 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.