Code Monkey home page Code Monkey logo

hacker-candles's Introduction

Hacker Candle

Project 4 - Chris Wilkening

App will be live soon!

image of app

Technologies

To make this app I used:

  • React
  • Express
  • Axios
  • Firebase
  • JavaScript
  • Bootstrap
  • HTML | JSX
  • Stripe

Take a look:

renderCart() {
    const cart = {...this.props.cart}; // grab the cart state
    const candle = {...this.props.inventoryObject}; //grab the candle inventory state
    var cartElements = []; //set empty array
      for(let key in cart) { //loop through the cart
        let item = cart[key]; //set item to the value of each key
        //push the items into empty array
        cartElements.push(
          <div className="cart-item" key={key}>
            <img className="cart-image" src={candle[key].image}></img>
            <div className="cart-container">
              <h4 className="cart-name">{candle[key].name}</h4>
              <p>price/candle: ${candle[key].price}</p>
              <p>scent: {candle[key].scent}</p>
            </div>
            <div className="quant-cont">
          <p className="quantity">quantity:</p>
          { this.props.cart[key] === null || isNaN(this.props.cart[key])
          //if the cart is empty set the default value to one, else set it to item.
          ?
            <div>
            <input className="quant-input" type="number" min="0" max="10" defaultValue="1" onChange={(e) => this.handleChange(e, key)} required></input>
            </div>
          :
            <input className="quant-input" type="number" min="0" max="10" defaultValue={item} onChange={(e) => this.handleChange(e, key)} required></input>
          }
          </div>
          <div className="x-button" onClick={() => this.props.removeCandle(key)}>X</div>
          </div>
        )
      }
      //return the elements
      return (
        <div>
        {cartElements}
        </div>
      )
  }

My Approach

The idea to build an e-commerce app came early to me during my time at General Assembly, but I didn't know what to sell. I chose to make candles and sell a real product, instead of building a site just for demonstration purposes. I whiteboarded the user flow of the app to help me choose the best way to structure the checkout process. I used Trello to structure the workflow.

Dependencies

  • React Stripe Checkout
  • Express
  • dotenv
  • axios
  • react-router-dom
  • history

Run npm install for the root folder and client.

For the Future

  • Go live with Hackercandle.com.
  • Add database for purchases and e-mail.
  • Add user accounts.
  • Add Facebook/Google auth.
  • Add subscription service with Stripe.

Written by Chris Wilkening

hacker-candles's People

Contributors

clwilkening avatar

Watchers

 avatar

hacker-candles's Issues

Incorporating Stripe Checkout

I am having trouble getting stripe to line up with express. The request is getting to the Stripe server, but I am not using the response properly.

I've looked at the Stripe docs, and the component docs.

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.