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
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.
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.
- Clone the repo:
git clone git@github.com:pantry-wizard/pantry_wizard_fe.git
- Install gems:
bundle install
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.
- Create a
.env
file within the app. This file should appear next to the .gitattributes foler and should not be nested. Add yourGOOGLE_CLIENT_ID
andGOOGLE_CLIENT_SECRET
to this file. You will also need to add aHOST_URL
.
GOOGLE_CLIENT_ID=xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxx.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
GOOGLE_MAPS_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
HOST_URL=http://localhost:4000
- Run
bundle exec figaro install
, then open theapplication.yml
file. Here you'll add yourX-RapidAPI-Key
.
X-RapidAPI-Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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
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!
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
-
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
-
-
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.
- 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).
- Select the date you would like to create a plan for and select
- 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
, orGenerate New Dinner Recipe
. That will replace the existing meal with another that adheres to your preferences.
- From the
Pantry Wizard was crafted to satisfy the requirements for The Turing Back-End Mod 3 group project, Consultancy.
See the official project requirements here.
- 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.
- 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.
- 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.
Chris Crane | Conner Van Loan | Caleb Thomas | Brian Hayes | Dawson Timmons |
GitHub |
GitHub |
GitHub |
GitHub |
GitHub |