Contributors Forks Stargazers Issues


Logo

Pantry Wizard

An application that allows a user to create meal plans based on their Dietary Restrictions, Intolerances, and Cusine Preferences.
This is the backend service of the application.
Report Bug · Request Feature · Front End Repo

Table of Contents
  1. About The Project
  2. Getting Started
  3. How to Use (Walkthrough)
  4. Goals
  5. Contributors

About The Project


At Pantry Wizard, we believe that everyone deserves access to healthy, delicious food. We're on a mission to reduce food waste and alleviate food insecurity by providing personalized meal planning that simplifies the decision-making process and empowers individuals to take control of their nutrition. Our app is designed to meet the needs of neurodivergent individuals, picky eaters, and anyone facing time or resource constraints, so they can focus on what really matters in their lives. Join us in making a positive impact on our communities, one meal at a time.

(back to top)

Built With:

  • Ruby 3.1.1
  • Rails 7.0.4
  • Postgresql
  • Heroku

(back to top)

Getting Started

This is a Ruby on Rails application that's used together with the pantry_wizard_be repository. To run the application locally, both front-end and back-end repositories will need to be cloned and set up fully with required gems and environment variables.


Installation

  1. Clone the repo:
   git clone git@github.com:pantry-wizard/pantry_wizard_fe.git
  1. Install gems:
   bundle install

(back to top)


API Key Setup

In order to use this application you will API keys from both RapidAPI and Google Cloud Platform . You will have to enable the google places API and the google maps javascript API.

Once you have these keys, they will be stored in files that you create.

  1. Create a .env file within the app. This file should appear next to the .gitattributes foler and should not be nested. Add your GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET to this file. You will also need to add a HOST_URL.
    GOOGLE_CLIENT_ID=xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxx.apps.googleusercontent.com
    GOOGLE_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    GOOGLE_MAPS_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    HOST_URL=http://localhost:4000
  1. Run bundle exec figaro install, then open the application.yml file. Here you'll add your X-RapidAPI-Key.
    X-RapidAPI-Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

(back to top)


Testing with RSpec

Once pantry_wizard_fe is correctly installed, run tests locally to ensure the repository works as intended.


To test the entire RSpec suite, run:

   bundle exec rspec

(back to top)


All tests should be passing if the installation was successful.

If any tests are not passing, please report which tests are not passing Here. We will issue an update/fix as soon as possible!

(back to top)


Local Server Setup

Since this application is deployed to heroku, if you want to use PantryWizard locally you'll need to make some changes in the services folder. In each service file you'll need to change the url in the following method.

Current URL for heroku deployment:

    def self.conn 
      Faraday.new(url: "https://pantrywizardbe.herokuapp.com")
    end

Change to:

    def self.conn 
      Faraday.new(url: "http://localhost:4000")
    end

run rails s on both pantry_wizard_be and pantry_wizard_fe. The backend will be hosted on localhost:4000 while the front end will use localhost:3000

(back to top)


How to Use (Walkthrough)

Login

  • Using your preferred internet browser (chrome), visit localhost:3000.

    • You'll be asked to sign-in using Google OAuth, so a Google account is required.

    • Once logged in, you'll be redirected to the /dashboard


    Screen Recording Gif


User Preferences

  • Select all food Intolerances you have from the avaliable list.

  • Select up to one Dietary Restriction if you have one.

  • Next to each cuisine type there is a drop down menu, which you can select your Likes and Dislikes

  • When the form looks right to you, press submit at the bottom of the page. You can change these preferences later if you want.


    Screen Recording Gif


Meal Plans

  1. Select Create Meal Plan
    • Select the date you would like to create a plan for and select Create New Meal Plan.
    • 3 random meals will be assigned (1 breakfast and 2 main courses) based on your preferences.
    • You'll be routed to /dashboard where you'll see today's meal plan, and a button to edit it (if you've created one).
    • Below that you'll see the plans for the upcoming 7 days (if you've created them).

Screen Recording Gif


  1. View a Recipe
    • From the /dashboard select an upcomming meal plan, or select the name of a recipe.
    • On that recipes show page you'll see the meals ingredients, instructions, and a picture of the dish.
    • If you would like a different meal, then select either Generate New Breakfast Recipe, Generate New Lunch Recipe, or Generate New Dinner Recipe. That will replace the existing meal with another that adheres to your preferences.

Screen Recording Gif


(back to top)


Goals

Pantry Wizard was crafted to satisfy the requirements for The Turing Back-End Mod 3 group project, Consultancy.

See the official project requirements here.


Learning Goals

  • Impliment Google OAuth so users can log in easily.
  • Impliment CircleCI for continuous integration.
  • Utilize Service Oriented Architecture by creating an API with Rails.
  • Interact with two unique external API's.
  • Deploy both the frontend and backend on Heroku.

(back to top)

Future Goals

  • Add google calendar so meals can be scheduled in advance.
  • Integrating Swagger.
  • Integrating HoneyBadger for observability of backend queries.
  • Integrating Swagger to make endpoint testing easier.
  • /preferences rendering the form with the users current preferences (currently they're just stored on the backend).
  • New user directed to /preferences instead of /dashboard.
  • The ability to generate a new meal directly from the /dashboard instead of going into that meals show page.

Known Issues

  • Needs more sad path testing and refactoring.
  • The spoonacular API only allows a total of 50 requests a day, and it's primary search endpoint counts as 3 requests.

(back to top)


Contributors

Chris Crane Conner Van Loan Caleb Thomas Brian Hayes Dawson Timmons
GitHub
LinkedIn
GitHub
LinkedIn
GitHub
LinkedIn
GitHub
LinkedIn
GitHub
LinkedIn