Coder Social home page Coder Social logo

renecapella / pantry Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 2.28 MB

Food waste reduction application across multiple points in the supply food chain. This is also my entry for the 2022 Solution Challenge 🎉

License: MIT License

Ruby 62.08% JavaScript 3.51% HTML 32.69% SCSS 1.72%
food-planner sustainable-software solution-challenge google-developer-student-club progressive-web-app rails bootstrap4 rails7 api barcode-scanner

pantry's Introduction

Pantry

The food awareness and tracking application designed to support planning from production to consumer

According to the national nonprofit ReFed, 35% of food per year is not sold or eaten, and that while 11% makes it to donation or recycle purposes, a whopping 54 tons (24%!) is completed unused and wasted.

How does Pantry help solve this?

Pantry is a solution dedicated at improving food waste tracking, donation awareness, and informatics for every level of the food supply chain: from producer to retailer to consumer.

The Motivation

The United Nations has 17 Sustainability goals for our planet. #12 is Ensure sustainable consumption and production patterns. According to the U.N., "Sustainable consumption and production is about promoting resource and energy efficiency, sustainable infrastructure, and providing Its implementation helps to achieve overall development plans, reduce future economic, environmental and social costs, strengthen economic competitiveness and reduce poverty."

The U.N. further lays out indicators and targets to achieve this goal:

  • Target 12.3: Halve global per capita food waste
  • Target 12.5: Substantially reduce waste generation
  • Target 12.6: Encourage companies to adopt sustainable practices and sustainability reporting
  • Target 12.8: Promote universal understanding of sustainable lifestyles

Get the application up and running!

Install Rails:

  • Rails 7.0.1
  • Ruby ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-darwin20]
  • Node v17.4.0

Install the gems

bundle install

Create the db

bundle exec rails db:create

Seed that db

bundle exec rails db:seed

Start the app

bundle exec rails s

Access the Rails console

bundle exec rails c

If you're running this locally:

You have some users: username: [email protected] password: tester

username: [email protected] password: tester

Now, I do not have barcodes or qr codes for you, but I do have 10 orders, ids 1-10 that you can enter into the field on the add food page. You could also generate a qr code or bar code easily with one number 1-10 and scan the code to see that funcitonality.

The producer views are still in the works:) But you can see all your batches, choose one batch, edit that batch (and update the foor recall).

.

Postman

Producer

Producer sends the batch. Batches 1-4 are premade in the db for you. To see these batches, in console, bundle exec rails c - here is an example batch you can send through: POST to url: http://localhost:3000/api/v1/batches.json

{
  "batch": {
    "producer_id": 1,
    "item_name": "Canned Beans",
    "best_by":"2022-01-01T00:00:00.000Z",
    "exp_date":"2022-02-01T00:00:00.000Z"
    }
}

Retailer

The retailer or store sends over the order when a customer makes a purchase POST to url: http://localhost:3000/api/v1/orders.json

{
  "order": {
    "store_id": 1,
    "food_items_attributes":[{
        "batch_id": 1
        },
        {
        "batch_id": 2
        },
        {
        "batch_id": 3
        },
        {
        "batch_id": 4
        }]
    }
}

Contribution Workflow

All work is written in a feature branch off of beta and submitted as a pull request pointing to beta Before doing work, please message René at [email protected] to be added a contributor.

  1. git checkout main
  2. git pull
  3. git checkout beta
  4. git pull
  5. git checkout -b PANTRY-<issue number>
  6. Write your amazing code, make sure it passes lighthouse accessibility tests, make sure tests are passing, clean up debug and: git add, git commit -m "PANTRY-<issue number> My detailed commit message here", git push
  7. Open a pull request
  8. Assign René to code review, add a detailed explanation of how test your feature, point to beta.

Future

Pantry is off to a great start, and I have several ideas I think will take this product to the next level.

  • push notifications for when food is marked as recalled
  • machine learning to help generate purchasing and planning for producers, retailers and consumers
  • Google cloud deployment for the machine learning, security and scalability

The Team

Pantry was born out of multiple brainstorming and research iterations while finding a solution that could be simple but impactful. René Capella lead the sessions, planning. René also designed and implemented the rails application.

The project was followed closely by Khalid who provided constant design feedback and encouragement. All progress was posted to a public discord community where members were encouraged to oversee and offer thoughts and impressions. A HUGE THANK YOU is due to all the members of the Google Developer Student Club at North Seattle College for the support and feedback.

The project was overseen by Bill Barry, the Computer Science Full-time faculty and Deptartment Coordinator at North Seattle College.

pantry's People

Contributors

renecapella avatar

Stargazers

 avatar  avatar

Watchers

 avatar

pantry's Issues

PANTRY-5 On registration, I should be able to pick a role, and it should be recorded

When a user signs up, the user needs to be able to determine whether they are a user (a consumer with a pantry), a food producer, or a store.

Perhaps the user does this on the same page they sign up or on a modal: the choice is yours.

  • When a user signs up, after the sign up process, the user will have a role
  • the roles are set in the database

All features should pass the lighthouse's accessibility test

PANTRY-4 UI User should be able to navigate the application

When a user interacts with the application, the user should be able to navigate to necessary pages

When a user signs in, they see their pantry or pantries (if they have more than one).
From this page, they should be able from the menu to view their user page, find local pantries to donate food, and sign out. This ticket is here to think about what we need in navigation and also to create the navigation for the application

  • Create the navigation for the application
  • For the links, either put in placeholders or real routes

PANTRY-1

Create a Readme

Create a readme with the following attributes:

  • Versions of all application components: Rails, Ruby, Yarn, Node & How to run the application locally
  • Workflow for contributors

PANTRY-7 I Need to be able to donate my food

  • From the menu, I should have clear access to a donate button
  • I need to be able to search for close food pantries
  • When I search for food pantries in my zipcode, matches appear on the page with clickable links to contact

Here's an API I think will be very helpful. A user might be able to type in a zip code, and multiple food pantries with clickable contact information appears (telephone number should call on click, emails should open email applications, etc)

PANTRY-11 Deploy to the gCloud

We need to start getting the rails app deployed to the cloud through app engine.

Research deployment, sensitive information management, resources needed and successfully deploy

PANTRY-10 As a store, I need to be able to create an order

A user is bringing their receipt home and scanning the barcode or qr code at the bottom of the receipt -- this barcode is a reference to an order id.

The order has to exist, then in our db, so that when the consumer scans this receipt, all the food items on that order are added to the consumer's pantry.

This ticket is for a store sending a payload to our API that contains all the food items in an order.

PANTRY-3 User should see their pantry after signing in or signing up

Using material design/bootstrap:

  • craft the main pantry page
  • make sure the page is set as the application's home page
  • display all the food items

This page should list all the food items in the pantry.
It should also display the best-by & expiration date if available.

This page is the first and main page of the application after a user signs in or signs up.

PANTRY-18 Recalled food should be handled: not donatable, push notification

Currently, if a producer marks an item as recalled, all the food items in the batch are flagged with the name "!!RECALLED!! "-- and while this is fine MVP, it needs to be more.

Push notifications to users when food in their pantry is recalled: it has to be immediate.
Recalled items cannot be donated. Logic to block this is needed. Perhaps a scope and separate section.

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.