Git Product home page Git Product logo

got-hops's Introduction

Got-Hops

A craft brewery search application

Table of Contents

Contents
  1. Description

  2. User Story

  3. Preview

  4. Website

  5. Contributions

  6. Built With

Description

Search by city for local breweries! Type in your city to find contact information and websites for breweries close by. Star the breweries you like to save them to your favorites!

User Story

AS AN avid connoisseur of crafted beer from around the world.
I WANT a web application that finds nearby breweries with pricing and a list of the types of craft beers available.
SO THAT I can find nearby ones, but also ones that are off the grid and not as well known.

Preview

desktop-demo

Website

View Live Site

Credits

Click to see Contributors

Built With

html css js jquery tailwind-css

© 2021 Mianta McKnight, Alex Marten, Scott Rohrig | All Rights Reserved

got-hops's People

Contributors

alex-d-marten avatar roguestorm7 avatar scottrohrig avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

got-hops's Issues

Show launch page when all favorites are removed

Description

  • When a user has removed all favorites and the clicks the favorites button, the console will show the following error:
Uncaught TypeError: Cannot read properties of undefined (reading 'name')
    at makeFirstResult (script.js:256:24)

Requirements

  • Add validation check for empty favorites
  • Simple solution, refresh the page so the default empty results card shows
  • Longer/cleaner solution, make a function to dynamically generate that default view card from script.js

Dynamic results cards populated from js

Description

  • the results card elements will be created from a function call

Requirements

  • store variables for brewery info: name, id, tel., address., etc.
  • create elements for each of the required items
  • set the classes and attributes
  • add the created elements to their necessary parents
  • finally add the elements to the card and add the card to the appropriate results section.

Add favorites html page and scripts

  • This task should come after the MVP
  • Create a Favorites link so that when a user clicks on the Favorites they are taken to a separate html page that displays the favorite breweries
  • There needs to be a link to take back to the original index html

Make default text for page load

Description

  • When page loads, the cards should have a default view
  • If there are no favorites..
  • There should be a blank note on the first results card
    • e.g., 'search to show breweries'
  • If there are favorites, the favorites should load in

Update modal functionality

  • the brewery API is only capable of functioning correctly in England, France, Scotland, Ireland, and the United States.
  • If a user enters a city not in these countries the results will be inaccurate. We should add some conditionals to check the country of the search and prompt the user if the country is not one of the ones above.
  • This prompt should be in the form of a modal

Format contact information

Issue

  • phone numbers displaying as single set of numbers without separators (555) 555-555 etc.
    • Use string formatting and '...'.slice(start, stop) to format them (may require validation).
  • web urls have the protocols http...w., but should display simply the domain name
    • Use regex to replace any protocol substrings with empty strings ''
    let urlStr = 'https://www.example.com'
    // either use URL constructor && regex
    let urlDomain = new URL( urlStr ).host.replace(/^www./, '')
    
    // or regex only
    let regex = /.*www.|.*\/\//
    urlStr.replace(regex, '')

One Page Proposal

Description

  • One-page proposal that contains a project title, project description, user story, wireframe or sketch of the design, APIs, and rough breakdown of tasks

Application Flow

Application Flow

on document ready
  • 1. load page, load default views ('no results')
  • 2. load favorites from storage
  • 3. create cards from favorites
  • 4. wait for search input
on search input submit
  • 5. validate response
  • a. show modal popup
  • b. return early if empty string
  • 6. fetch position data from openweather
  • a. validate country is in ['usa', 'eng', 'fr', 'scot', 'ire']
  • b. show modal popup if not in acceptedCountries
  • c. clear search field if successful search
  • 7. use coords to fetch brewery data
  • 8. parse brewery data
  • 9. store brewery data in results array
  • 10. create card elements from results array
  • a. create elements
  • b. add class list or attributes
  • - check if brewery is in favorites
  • - add star state
  • c. assign data-id
  • d. set element text
  • e. append elements to DOM
  • 11. wait for user input
on fav star icon pressed
  • 12. add/remove brewery from favorites array
  • - validate brewery is not null/undefined
  • a. check if brewery is in favorites array
  • b. remove brewery if in favorites
  • c. otherwise add brewery
  • d. save array to storage
on load fav button pressed
  • 13. clear search input field first
  • 14. clear results cards
  • 15. load favorites
  • 16. create cards
  • ...

Saving to favorites does not validate properly

Issue

  • favorites array can get null values which breaks the app
  • Occasionally the brewery can get added twice to the array, then it won't be removed during toggle

possible fix

  • validate null values while looping thru data and removed them from the array
  • validate fav toggle using brewery.name

Determine alternative css framework

Description

  • Find an alternative css framework to use instead of Bootstrap
  • List the benefits of at least 2 other frameworks
  • Note some basic syntax

Add favorites to local storage

  • Add functionality to the "Star" button on the results to save that result to local storage
  • We would want the brewery name, the brewery address, and type of brewery saved
  • We should be mindful of if the Star is clicked multiple times it may add more than one of the same brewery to local storage (conditional to filter out maybe?)

Add search functionality

Description

  • When the submit button is clicked and there is a city in the search field, a fetch request retrieves the data from the appropriate api

Make style.css skeleton

Description

  • basic styling to organize the elements of the page
  • add comments to note the sections

Make HTML skeleton

Description

  • create the outline of all the static elements that will be on the page
  • assign appropriate class names and ids
  • link required script imports (ie., cdnjs...)
  • make sure comments delimit the various sections

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.