Git Product home page Git Product logo

ecomm-app's Introduction

ecomm-app

Project Description

This is a mock ecommerce app that uses Firebase/Firestore as a database, built in React. (no create-react-app used for the fun of it, and assist my understanding of the tools)

How to run

The site has been deployed to herkou: https://packshoponline.herokuapp.com/ The site has been deployed to railway: https://ecomm-app-production-b205.up.railway.app/

You can also clone this repo but you will need to add your own .env config in order to connect to firebase. To develop this project, clone repo, run npm install. Then npm run dev to run a dev server.

MVP

  • 2 pages:

    • Home Page
      • Grid of products
      • Carousel of featured products
    • Product Page (with id parameter) - similar to a product page on another site, allows you to add to cart and select product variants
  • All products should be stored in Firestore, you should store the following information:

    • quantity
    • variants (could be colors, sizes, etc)
    • price per unit
    • name
    • image url
    • favourited or not (boolean)
  • All data should be stored in Firestore and fetched by the frontend, there should be NO static product data in the react application.

  • Bonus

    • Using Firestore and react, create a cart system. Create a cart page in your react app Add logic to prevent users from adding items to cart that are no longer in stock. You will have to check the current cart and the product quantity Cart page should have the following:
      • List of products in cart
      • ability to change quantity of products in cart
      • ability to remove items from cart
      • Make sure your site is scoped to one category of products.
    • maybe have a detailed product page

How it works

The App consists of 2 pages, a home page and a product detailed page. When the app is rendered a useEffect hook is called once to get the data from the database. This database-data lives in the App state and is passed as props to relevant components. React Router is used to simulate 2 pages.

Thoughts

It was a little tricky to decided on the structure of the data in the database. The MVP requires variants for products and in the end I've opted for a very simple colour variance. In real life these variances would cause different data to be reflected to the user. ie Changing the colour should change the qty avaliable for purchase or price. To improve this I would change the database such that each product varient would also hold price modifier data ( -10, or +10). The price would be calculated by the component based upon a base value as well as what inputs have been selected by the user.

Heroku free tier change

I didn't know how good I had it! I decided to use Railway just to try it out. I was using parcel to bundle the app, but I could not get it to work on railway. I switched to vite and ran into some trouble configuring the .env and connecting to firestore. With the help of the vite docs + stack overflow the problem was diagnosed and the app has been deployed successfully.

Screenshot

alt text

ecomm-app's People

Contributors

capsap avatar

Watchers

 avatar

ecomm-app's Issues

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.