Code Monkey home page Code Monkey logo

mehboobali98 / human-essentials Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rubyforgood/human-essentials

0.0 1.0 0.0 29.56 MB

Human Essentials is an inventory management system for diaper, incontinence, and period-supply banks. It supports them in distributing to partners, tracking inventory, and reporting stats and analytics.

Home Page: https://humanessentials.app

License: MIT License

Shell 0.04% JavaScript 1.58% Ruby 68.37% HTML 29.07% SCSS 0.93% Procfile 0.01%

human-essentials's Introduction

Human Essentials

All Contributors

View performance data on Skylight FOSSA Status Knapsack Pro Parallel CI builds for RSpec tests

πŸ’– Mission

Human Essentials is an inventory management system that was built to address the needs of Diaper Banks as directly and explicitly as possible and later adapted to meet the need of other Essentials Banks. Essentials Banks maintain inventory, receive donations and other means of intaking human essentials supplies (e.g. diapers, period supplies), and issue distributions to community partner organizations. Like any non-profit, they also need to perform reports on this data and have day-to-day operational information they need as well. This application aims to serve all those needs, as well as facilitate, wherever possible the general operations of the Diaper Bank themselves (eg. through using barcode readers, scale weighing, inventory audits).

🌟 Impact

Human Essentials has over 200 registered banks across the United States at no cost to them. It is currently helping over 3 million children receive diapers and over 400k period supply recipients receive period supplies. Our team is in partnership with the National Diaper Bank Network (NDBN) and can be found in their annual conference that brings numerous of non-profit organizations that distribute essential products to people.

We are proud of our achievements up to date but there is much more to do! This is where you come in...

πŸŽ‰ The Digital Public Goods Alliance recognizes Human Essentials as a digital public good (DPG)

DPG Approved

This project supports the following Sustainable Development Goals:

  • SDG 1 - End poverty in all its forms everywhere
  • SDG 3 - Ensure healthy lives and promote well-being for all at all ages
  • SDG 10 - Reduce inequality within and among countries

Ruby for Good

Human Essentials is one of many projects initiated and run by Ruby for Good. You can find out more about Ruby for Good at https://rubyforgood.org


GitHub Stats at a Glance


Use as an Organization or Contribute as an Individual/Team to this Project

NGO Adoption Info - information about how to use this DPG

Skills Based Volunteering Info - information about how to volunteer


πŸ‘‹ Welcome Contributors!

Thanks for checking us out!

If you're new here, here are some things you should know:

  • We actively curate issues and try to make them as self-contained as possible for people new to the application; those ones are tagged "Help Wanted"
  • We're actively watching for Pull Requests and you shouldn't have to wait very long for a review. Try to make sure your build passes (rubocop -a is a frequent need) and that you've addressed the requirements in the issue
  • Check the Contributing Guidelines section for a guide on how to get started
  • This is a 100% volunteer-supported project, please be patient with your correspondence. We do handle issues and PRs with more fervor during Hacktoberfest & Conferences, but most (all?) of us have day jobs and so responses to questions / pending PRs may not be immediate. Please be patient, we'll get to you! :)

πŸ’¬ Join us on slack

Please feel free to join us on Slack! You can sign up here and find us in #human-essentials.

There are numerous other folks that can chime in and answer questions -- please ask and someone will probably be there to help!

πŸ› οΈ Getting Started

Install Ruby

You will need to first install the required ruby version specified in the .ruby-version file. GoRails has a very detail oriented guide for installing ruby on Ubuntu, Windows, and macOSX. You can check out that guide here. Follow only the Installing Ruby step, as our project setup differs

It is highly recommended you use a ruby version manager such as:

You can verify that your ruby installation was successful and matches the version in .ruby-version in the project directory:

ruby -v

Once you've successfully installed ruby. You may proceed to the next section!

Troubleshooting

My RBENV installation did not work The rbenv repository provides a rbenv-doctor script to verify the state of the rbenv installation and if a ruby version is installed

Install Postgres

You must install postgres and run the database locally. Instructions differ depending on the operating system.

Follow one of these guides to install postgres: This app uses PostgreSQL for all environments. You'll also need to create the dev and test databases, the app is expecting them to be named diaper_dev and diaper_test respectively. This should all be handled with rails db:setup. Create a database.yml file on config/ directory with your database configurations. You can also copy the existing files called database.yml.example and .env.example as an example and just change the credentials.

After completing this step, you should have both ruby and postgres installed. Now you can proceed to the next step which is to setup the application.

Run Setup

Run the following command should run all the neccessary steps to get up and running.

bin/setup

Run the application

Run the following command to start the server locally.

bin/start

You should be able to open up a browser and goto http://localhost:3000/ and see the human essentials page.

Login as a sample user

To login to the web application, use these default credentials:

Super Users

username: [email protected]
password: password!

Bank users

Organization Admin
  Email: [email protected]
  Password: password!

User
  Email: [email protected]
  Password: password!

Partner Users

Verified Partner
  Email: [email protected]
  Password: password!

Invited Partner
  Email: [email protected]
  Password: password!
  
Unverified Partner
  Email: [email protected]
  Password: password!
  
Recertification Required Partner
  Email: [email protected]
  Password: password!

Let's recap! You should now be able to run bin/start and login as one of the sample users to see their dashboard. If you've gotten to that point, you are ready to start contributing!

🀭 Something went wrong in the setup process?

Please let us know by opening up an issue! We have many new contributors come through and it is likely what you experienced will happen to them as well. Documentation often goes out of date... documentations... ama'right?

🀝 Contributing Guidelines

Please feel free to contribute! While we welcome all contributions to this app, pull-requests that address outstanding Issues and have appropriate test coverage for them will be strongly prioritized. In particular, addressing issues that are tagged with the next milestone should be prioritized higher.

To contribute, do these things:

  • Identify an issue you want to work on that is not currently assigned to anyone
  • Assign it to yourself (so that no one else works on it while you are)
  • (If not already a Contributor, fork the repo first)
  • Checkout a new issue branch -- there's no absolute requirements on this, but we encourage the branch name format XXX-brief-description-of-feature where XXX is the issue number.
  • Do the work -- discuss any questions on the Issues as needed (we try to be pretty good about answering questions!)
  • (If you created a new model, run bundle exec annotate from the root of the app)
  • Create tests to provide proof that your work fixes the Issue (if you need help with this, please reach out!)
  • Commit locally, using descriptive commit messages that acknowledge, to the best of your ability, the parts of the app that are affected by the commit.
  • Run the tests and make sure they run green; if they don't, fix whatever broke so that the tests pass
  • Final commit if any tests had to be fixed
  • Push up the branch
  • Create a Pull Request - Please indicate which issue it addresses in your pull-request title.

Squashing Commits

Squashing your own commits before pushing is totally fine. Please don't squash other people's commits. (Everyone who contributes here deserves credit for their work! :) ). Also, consider the balance of "polluting the git log with commit messages" vs. "providing useful detail about the history of changes in the git log". If you have several (or many) smaller commits that all serve one purpose, and these can be squashed into a single commit whose message describes the thing, you're encouraged to squash.

There's no hard and fast rule here about this (for now), just use your best judgement.

Pull Request Merging

At that point, someone will work with you on doing a code review (typically pretty minor unless it's a very significant PR). If TravisCI gives πŸ‘ to the PR merging, we can then merge your code in; if your feature branch was in this main repository, the branch will be deleted after the PR is merged.

In-flight Pull Requests

Sometimes we want to get a PR up there and going so that other people can review it or provide feedback, but maybe it's incomplete. This is OK, but if you do it, please tag your PR with in-progress label so that we know not to review / merge it.

Becoming a Repo Contributor

Users that are frequent contributors and are involved in discussion (join the slack channel! :)) may be given direct Contributor access to the Repo so they can submit Pull Requests directly, instead of Forking first.

Stay Scoped

Try to keep your PRs limited to one particular issue and don't make changes that are out of scope for that issue. If you notice something that needs attention but is out-of-scope, please create a new issue.

πŸ§ͺ Testing

Writing Tests/Specs

Run all the tests with:

bundle exec rspec

Run a single test with:

bundle exec rspec {path_to_test_name}_spec.rb

This app uses RSpec, Capybara, and FactoryBot for testing. Make sure the tests run clean & green before submitting a Pull Request. If you are inexperienced in writing tests or get stuck on one, please reach out so one of us can help you. :)

The one situation where you probably don't need to write new tests is when simple re-stylings are done (ie. the page may look slightly different but the Test suite is unaffected by those changes).

Tip: If you need to skip a failing test, place pending("Reason you are skipping the test") into the it block rather than skipping with xit. This will allow rspec to deliver the error message without causing the test suite to fail.

example:

  it "works!" do
    pending("Need to implement this")
    expect(my_code).to be_valid
  end

On Writing Browser/System/Feature Specs

If you need to see a browser/system spec run in the browser, you can use the following env variable:

NOT_HEADLESS=true bundle exec rspec
Use magic_test to simplify browser/system/feature spec writing

We've added magic_test which makes creating browser specs much easier. It does this by giving you the ability to record actions on the browser running the specs and easily paste them into the spec.

For example you can do this by adding magic_test within your system spec:

 it "does some browser stuff" do
   magic_test
 end

and run the spec using this command:

MAGIC_TEST=1 NOT_HEADLESS=true bundle exec rspec <path_to_spec>

See videos of it in action here

πŸš€ Deployment Process

The human-essentials & partner application should be deployed ideally on a weekly or bi-weekly schedule. However, this depends on the amount of updates that we have merged into main. Assuming there is updates that we want to ship into deploy, this is the process we take to getting updates from our main branch deployed to our servers.

Requirements

  • You will need SSH access to our servers. Access is usually only given to core maintainers of the human-essentials & partner projects.

Running delayed jobs

You can run delayed jobs locally by running the rake jobs:work command. You'll need to do this to see any e-mails (they should pop up in your browser). Alternatively, you can run a specific delayed job by opening a Rails console and doing something like:

Delayed::Job.last.invoke_job

You can replace the last query with any other query (e.g. Delayed::Job.find(123)).

In-flight Pull Requests

Sometimes we want to get a PR up there and going so that other people can review it or provide feedback, but maybe it's incomplete. This is OK, but if you do it, please tag your PR with in-progress label so that we know not to review / merge it.

Additional Notes

  • The generated schema.rb file may include or omit id: :serial for create table, and null: false for t.datetime. According to Aaron, this can safely be ignored, and it is probably best to commit the schema.rb only if you have committed anything that would change the DB schema (i.e. a migration).
  • If you have trouble relating to SSL libraries installing Ruby using rvm or rbenv on a Mac, you may need to add a command line option to specify the location of the SSL libraries. Assuming you are using brew, this will probably result in a command looking something like:
rvm install 2.6.4 --with-openssl-dir='brew --prefix openssl'

Becoming a Repo Contributor

Users that are frequent contributors and are involved in discussion (join the slack channel! :)) may be given direct Contributor access to the Repo so they can submit Pull Requests directly, instead of Forking first.

Deployment Process

The human-essentials application should be deployed ideally on a weekly or bi-weekly schedule. However, this depends on the amount of updates that we have merged into main. Assuming there is updates that we want to ship into deploy, this is the process we take to getting updates from our main branch deployed to our servers.

Requirements

  • You will need SSH access to our servers

    • Access is usually only given to core maintainers of the human-essentials project
  • Login credentials to our Mailchimp account

Tag & Release

  1. You'll need to push up a tag with the proper semantic versioning. Check out the releases to get the correct semantic versioning tag to use. For example, if the last release was 2.1.0 and the update is a hotfix then the next one should be 2.1.1
git tag x.y.z
git push --tags
  1. Publish a release associated to that tag pushed up in the previous step. You can do that here. Make sure to include details on what the release's updates achieves (we use this to notify our stakeholders on updates via email).

Send Update Email To Human Essential Users

We will now want to inform the stakeholders that we've recently made a deployment and include details on what was updated. This is achieved by accessing all the user records and sending out a email via our Mailchimp account.

  1. Fetch all the emails of our users by accessing our human essentials production database
cap production rails:console
emails = User.all.pluck(:email) 
puts "Email Address\n" + emails.join("\n") # Copy this output
  1. Use the list of the emails copied from the output from the previous step to send a update audience via Mailchimp. Go to Audience > Manage Audience > Import Contacts and select "Copy and paste" option. Then paste the output of step 1. Complete the subsequent steps.

  2. Draft the email and send it with updates.

Acknowledgements

Thanks to Rachel (from PDX Diaperbank) for all of her insight, support, and assistance with this application, and Sarah ( http://www.sarahkasiske.com/ ) for her wonderful design and CSS work at Ruby For Good '17!

License

FOSSA Status

✨ Contributors ✨

Thanks goes to these wonderful people (emoji key):

Edwin Mak
Edwin Mak

πŸ’» πŸ“† πŸš‡ πŸ€” πŸ’¬ πŸ›‘οΈ
Sean Marcia
Sean Marcia

πŸ’» πŸ’Ό πŸ’΅ πŸ” πŸ“‹
Aaron H
Aaron H

πŸ“† πŸ’»
Dmitry
Dmitry

πŸ’»
Adam Bachman
Adam Bachman

πŸ’»
JC Avena
JC Avena

πŸ’»
mdworken
mdworken

πŸ’» πŸ“†
Marius Pop
Marius Pop

πŸ’»
Elayne
Elayne

πŸ’»
Amy Detwiler
Amy Detwiler

πŸ’»
Gia
Gia

πŸ’»
Amina Adewusi
Amina Adewusi

πŸ’»
albertchae
albertchae

πŸ’» πŸ€”
Keith Walters
Keith Walters

πŸ’»
Chase Southard
Chase Southard

πŸ’»
Brock Wilcox
Brock Wilcox

πŸ’»
danquill
danquill

πŸ’»
Keith Bennett
Keith Bennett

πŸ’»
Benjamin Reynolds
Benjamin Reynolds

πŸ’»
jtu0
jtu0

πŸ’»
Juarez Lustosa
Juarez Lustosa

πŸ’»
Julien A.
Julien A.

πŸ’»
Emerson Manabu Araki
Emerson Manabu Araki

πŸ’»
Ben Klang
Ben Klang

πŸ’»
karolina
karolina

πŸ’»
Josh Cano
Josh Cano

πŸ’»
Julian Macmang
Julian Macmang

πŸ’»
Philip DeFraties
Philip DeFraties

πŸ’»
GabrielRMuller
GabrielRMuller

πŸ’»
Lucas Hiago
Lucas Hiago

πŸ’»
Lanya Butler
Lanya Butler

πŸ’»
Eduardo Moreira
Eduardo Moreira

πŸ’»
Alicia Barrett
Alicia Barrett

πŸ’»
Bob Forcha
Bob Forcha

πŸ’»
William Murphy
William Murphy

πŸ’»
Kate Donaldson
Kate Donaldson

πŸ’»
Matthew Russell Dodds
Matthew Russell Dodds

πŸ’»
Allison McMillan
Allison McMillan

πŸ’»
Ashley Jean
Ashley Jean

πŸ’»
Eduardo Alencar
Eduardo Alencar

πŸ’»
Thomas Hart
Thomas Hart

πŸ’»
Bart Agapinan
Bart Agapinan

πŸ’»
Monique
Monique

πŸ’»
Valerie Woolard
Valerie Woolard

πŸ’»
zak-kay
zak-kay

πŸ’»
Jason LaHatte
Jason LaHatte

πŸ’»
Dave Tapley
Dave Tapley

πŸ’»
Meghan
Meghan

πŸ’»
Andy Thackray
Andy Thackray

πŸ’»
Felipe Lovato Flores
Felipe Lovato Flores

πŸ’»
Marcel Kooi
Marcel Kooi

πŸ’»
Lee Sharma
Lee Sharma

πŸ’»
Scott Steele
Scott Steele

πŸ’» πŸ€”
Sam Weerasinghe
Sam Weerasinghe

πŸ’»
Gerald Abrencillo
Gerald Abrencillo

πŸ’»
Rodolfo Santos
Rodolfo Santos

πŸ’»
Gabriel BaldΓ£o
Gabriel BaldΓ£o

πŸ’»
Melanie White
Melanie White

πŸ’»
Melissa Miller
Melissa Miller

πŸ’»
Marc Heiligers
Marc Heiligers

πŸ’»
Joe Hunt
Joe Hunt

πŸ’»
Meg Gutshall
Meg Gutshall

πŸ’»
Andrew H Schwartz
Andrew H Schwartz

πŸ’»
Joseph Glass
Joseph Glass

πŸ’»
Reese Williams
Reese Williams

πŸ’»
Santiago Perez
Santiago Perez

πŸ’»
Sirius Dely
Sirius Dely

πŸ’»
Heather Herrington
Heather Herrington

πŸ’»
Moacir Guedes
Moacir Guedes

πŸ’»
CraigJZ
CraigJZ

πŸ’»
Semih Arslanoğlu
Semih Arslanoğlu

πŸ’»
Mauricio de Lima
Mauricio de Lima

πŸ’»
David Curtis
David Curtis

πŸ’»
Natalia GalΓ‘n
Natalia GalΓ‘n

πŸ’»
Anderson Fernandes
Anderson Fernandes

πŸ’»
Gabriel Belgamo
Gabriel Belgamo

πŸ’»
Jorge David C.T Junior
Jorge David C.T Junior

πŸ’»
Seth Lieberman
Seth Lieberman

πŸ’»
Jorge Oliveira Santos
Jorge Oliveira Santos

πŸ’»
Drinks
Drinks

πŸ’»
Bruno Castro
Bruno Castro

πŸ’»
Carlos Palhares
Carlos Palhares

πŸ’»
Clifton McIntosh
Clifton McIntosh

πŸ’»
Daniel Beigelman
Daniel Beigelman

πŸ’»
Meg Viar
Meg Viar

πŸ’»
Svetlana Vileshina
Svetlana Vileshina

πŸ’»
Ben Reed
Ben Reed

πŸ’»
Emily Giurleo
Emily Giurleo

πŸ’»
Alem Getu
Alem Getu

πŸ’»
Dejan Bjeloglav
Dejan Bjeloglav

πŸ’»
Cassiano Blonski Sampaio
Cassiano Blonski Sampaio

πŸ’»
Greg
Greg

πŸ’»
finn
finn

πŸ’»
Jayson Mandani
Jayson Mandani

πŸ’»
Stanley Liu
Stanley Liu

πŸ’»
Curtis Bartell
Curtis Bartell

πŸ’»
Libby Rodriguez
Libby Rodriguez

πŸ’»
joshuacgraves
joshuacgraves

πŸ’¬ πŸ“†
Himanshu
Himanshu

πŸ’»
Mohamed Hegab
Mohamed Hegab

πŸ’»
Alejandro AR
Alejandro AR

πŸ’»
hatsu
hatsu

πŸ’»
Matt Glover
Matt Glover

πŸ’»
js-sapphire
js-sapphire

πŸ’»
lasitha
lasitha

πŸ’»
Patrick McClernan
Patrick McClernan

πŸ’»
Marc Bellingrath
Marc Bellingrath

πŸ’»
Daniel Orner
Daniel Orner

πŸ’»
Bob Mazanec
Bob Mazanec

πŸ’»
Mark Yen
Mark Yen

πŸ’»
Rachael Wright-Munn
Rachael Wright-Munn

πŸ’»
Ítalo Matos
Ítalo Matos

πŸ’»
Alvaro Sanchez Diaz
Alvaro Sanchez Diaz

πŸ’»
mbrundige
mbrundige

πŸ’»
Robert Greene
Robert Greene

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

human-essentials's People

Contributors

seanmarcia avatar armahillo avatar dependabot[bot] avatar dependabot-preview[bot] avatar edwinthinks avatar mdworken avatar cielf avatar abachman avatar ilindmitry avatar awwaiid avatar jcavena avatar mlpinit avatar aliciawyse avatar giacoelho avatar ejuten avatar lokisk1155 avatar cattywampus avatar kev-kev avatar nirvikalpa108 avatar albertchae avatar danquill avatar chaserx avatar dependabot-support avatar cheddar-godaddy avatar keithrbennett avatar cotabas avatar benreyn avatar bobmazanec avatar allcontributors[bot] avatar scooter-dangle avatar

Watchers

 avatar

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.