Skip to content

Flatiron | Mod 2 Project | Vanilla JavaScript and Ruby on Rails

Notifications You must be signed in to change notification settings

MusicMeier/restaurant-frontend

Repository files navigation

mysterEAT

An app to help you decide where to eat on a whim.

General Info

mysterEAT is a cutting-edge single-page web-based application that allows users to discover Denver's premier restaurants through an extensive catalog spanning your favorite cuisines. mysterEAT delivers a user experience catering to our inner spontaneity by offering users the opportunity to be surprised with a random restaurant suggestion via our mysterEAT card. Additionally, users have the ability to dynamically search through the catalog with our cuisine search algorithm. Our mission is to become your app of choice when deciding where to eat with loved ones feels like a mystery.

❤️

Inspiration

Have you ever found yourself in a situation where you were so hungry that everything sounds good, making it a lot harder to choose a restaurant? You're not alone! Our app was born with the sole purpose of helping you during those moments of indecisiveness.

Intro Video

Technologies

  • Ruby: version 2.6.5
  • Rails: version 6.0.3
  • SQLite3: version 1.4
  • Puma: version 4.1
  • JavaScript: version 1.1.1
  • JSON: version 2.3
  • Rack CORS: version 1.1.1

Setup

To run this project, create a folder on your local environment where you can clone the "restaurant-frontend" and "restaurant-backend" GitHub repositories. Open both in your code editor.

From your backend folder perform the following commands:
  • Use the command to install all required gems: bundle install
  • Use the Rails command: rails db:migrate
  • Seed your backend database tables using the following command: rails db:seed
  • Run the backend with command rails s

  • From your frontend folder perform the following command: lite-server

    You are now ready to start using the first iteration of mysterEAT!

    *Please note that some features are still a work in progress.

    Instructions

    1. Explore our catalog of Denver's highly-rated restaurants.
    2. If you're in a hurry & feeling spontaneous, take a chance with our mysterEAT button.
    3. Otherwise, use our search to narrow down the field of restaurant cards by cuisine.
    4. Still undecided? Allow us to help you by making a restaurant suggestion via our state-of-the-art mysterEAT feature.
    5. Interested in a different cuisine? Try searching for a new one in the top right or simply click on our logo to return to the main catalog.

    Code Examples

    Randomize Function:

    function surpriseRestaurant() {
        fetch(restaurantURL)
        .then(response => response.json())
        .then(restaurants => {
            let randomNumber = Math.floor(Math.random() * (restaurants.length));
            document.getElementById("surpriseCard").innerHTML = `
            <p><strong>${restaurants[randomNumber].name}</strong></p>
            <img id="back-image" src="${restaurants[randomNumber].logo}">
            <div class="card-info">
                <p><label>Rating: </label>${restaurants[randomNumber].rating}</p>
                <p><label>Price: </label>${restaurants[randomNumber].price}</p>
                <p><label>Location: </label>${restaurants[randomNumber].location.neighborhood}</p>
            </div>
            <button id="suprise-card-info-button-back" onclick="surpriseRestaurant()">Meh... Next?</button>
            `
        })
    }
    

    Onclick Button for Randomize Function:

    <button id="suprise-card-info-button" onclick="surpriseRestaurant()">Your MysterEAT here!</button>
    

    Search Filter:

    def index
        if params[:search_term] 
            @restaurants = Restaurant.joins(:cuisine).where(
                "cuisines.name LIKE '%#{params[:search_term]}%'"
            )
        else
            @restaurants = Restaurant.all
        end
            
        render json: @restaurants,  include:[ :location, :cuisine ]
    end
    

    App Preview




    Status

    We're looking forward to rolling-out the following features:

  • Create a user sign-in workflow.
  • Ability to select your favorite restaurants.
  • Introduce a search filter by location.
  • Contact

    Music MeierMusic Meier 🎼
    Jon NoriegaJon Noriega 🌊

    About

    Flatiron | Mod 2 Project | Vanilla JavaScript and Ruby on Rails

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published