WIP food planning app.
Live on heroku as myfoodplanner
- Ruby
- Rails
- Postgres
- Standard (Ruby), which supports the VSCode extension
- RSpec
- Bootstrap 4.1.3
- Material Icons
- Dependabot dependency manager
- List of recipes & ingredients
- Display full recipes
- Display ingredient breakdown for meal prep
- ERD https://dbdiagram.io/d/5d6ea192ced98361d6de29cd
- Fork & Clone
bundle
- Set up DB:
rake db:setup
(Runsdb:create
,db:schema:load
anddb:seed
) - User: In development, see the seeds file for the user credentials so you can log in
- Run
rails s
to start the server
Standard RB is used for enforcing style guide
- Run with:
standardrb
orstandardrb --fix
- Tests:
bundle exec rspec
This project uses these linters in CI:
Run them locally on your machine like this:
bundle exec reek
bundle exec scss-lint app/assets/stylesheets/**.scss
standardrb --fix
# or
rake standard:fix
- Devise
- Uglifier in harmony mode
- Shoulda Matchers
Heroku runs a cron job to add the weekly shopping_list items to the grocery list. This is accomplished with a rake task plus the cron job. The job is set to run daily because heroku doesn't offer a weekly interval. The rake task has a condition to only allow it to run on a specific day of the week. Configure the cron job.
This feature is dependent on my account having both a list named "grocery" and another list named "weekly items." Without either of those specifically-named lists, this job will error.
Never open the master.key
or credentials.yml.enc
in atom. This will add newline characters that you can't remove and it will not be able to be unencrypted.
To edit this file, run:
EDITOR="code --wait" bin/rails credentials:edit
If this file gets borked, this post and this post will help.
- log into Heroku CLI with
heroku login
- assuming your local copy of the
main
branch is up to date, rungit push heroku main
- API docs: https://ndb.nal.usda.gov/ndb/doc/index
- Ex Food show page: https://ndb.nal.usda.gov/ndb/foods/show/01009?fgcd=&manu=&format=&count=&max=25&offset=&sort=default&order=asc&qlookup=01009&ds=&qt=&qp=&qa=&qn=&q=&ing=
- Ex Nutrient show page: https://ndb.nal.usda.gov/ndb/nutrients/report/nutrientsfrm?max=25&offset=0&totCount=0&nutrient1=324&nutrient2=&subset=0&sort=c&measureby=g