Giter VIP home page Giter VIP logo

thepeej / concoctail-react-app Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 259 KB

A react app that allows users to find cocktail recipes based off what they already have in their home bar. Users can select from a set of bar essentials that they might already have, and the app will provide cocktails that can be made with those essentials. Built using HTML, CSS, Javascript, Ruby on Rails, React, and Materialize CSS framework

Home Page: https://youtu.be/N7T00x1aQm4

License: MIT License

Ruby 86.16% HTML 1.31% CSS 0.23% JavaScript 12.29%
react rails react-server cocktails materializecss redux ruby-on-rails rails-api

concoctail-react-app's Introduction

Concoctails

A React Portfolio Project for Flatiron School


The project is a react app that allows users to find cocktail recipes based off what they already have in their home bar. Users can select from a set of bar essentials that they might already have, and the app will provide cocktails that can be made with those essentials.

Built using HTML, CSS, Javascript, Ruby on Rails, React, and Materialize CSS framework

Installation Instructions

Setup Rails API backend

Clone this repo, and then navigate to the repo directory in your terminal.

Run bundle install to install all gem dependencies.

Run all rake migrations with rake db:migrate

Run in Rails Console (rails c) to set up database:

drinks = eval File.open('db/drinks.rb').read

drinks.each do |d|
  recipe = Recipe.create(
    {
      name: d[:strDrink],
      category: d[:strCategory],
      glass: d[:strGlass],
      img_url: d[:strDrinkThumb],
      instructions: d[:strInstructions]
    }
  )

  items = []
  quantities = []
  ingredient_counter = 0
  measure_counter = 0

  d.each do |key, array|
    if key.to_s.include?('strIngredient')
      items.push(d[key])
    elsif key.to_s.include?('strMeasure')
      quantities.push(d[key])
    end
  end

  items.each_with_index do |item, index|
    ingredient = recipe.ingredients.build()
    ingredient.item = Item.find_or_create_by(name: item)
    if quantities[index]
      ingredient.quantity = quantities[index]
    end
    ingredient.save
  end
end

Start up a rails server on port 3001: rails s -p 3001

Setup React server frontend

Change directories into client folder: cd client

Run npm install to install all package dependencies

Start up React server and enjoy the app! npm start

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ThePeej/concoctails-react-app. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

concoctail-react-app's People

Contributors

thepeej avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

katiewilday

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.