Skip to content

rubyforgood/homeward-tails

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1,776 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Homeward Tails Adoption Application

All Contributors

The Homeward Tails app is derived from the Baja Pet Rescue Dog Adoption Application created by @kasugaijin who wanted to give back to the grassroots organization from where he adopted his dog in Mexico by building them a web application. Homeward Tails is an application that makes it easy to connect shelters with people who are looking to adopt or foster pets.


๐Ÿš€ Getting Started

Let's get your machine setup to start up the application!

Clone the codebase

git clone git@github.com:rubyforgood/homeward-tails.git

Docker

Install a containerization app, such as Docker Desktop.

Navigate to the project directory and run:

docker-compose build to build the base image.

docker-compose up to start the containers. You can add the -d flag to run silently without logging.

docker-compose run --rm app bin/setup to set up and seed the database.

If you need to run migrations at all: docker-compose run --rm app bin/rails db:migrate

Visit localhost:3000 in your browser.

Docker Database

This application can be run locally while using a docker database. Review the docker compose file. You will need to start three databases:

docker compose up -d postgres
docker compose up -d cable
docker compose up -d queue

You may need to set the correct ports - review the environment variable instructions.

Example:

DATABASE_PORT: "54320"
CABLE_PORT: "54321"
QUEUE_PORT: "54322"

Debugging in Docker

You need to attach to an interactive shell on the app service docker attach pet-rescue-app-1

Place debugger in your code and hit it. You should be able to interact in the attached shell.

Local Installation

โš ๏ธ We assume you already have ruby installed with your preferred version manager. This codebase supports rbenv and asdf.

PostgreSQL

Installing PostgreSQL is required to run the application.

Installing on MacOS

Instructions: [https://wiki.postgresql.org/wiki/Homebrew]

brew install postgresql@14

To run postgresql as a service:

brew services start postgresql@14
Set up PostgreSQL role

Setting up a PostgreSQL role is beyond the scope of this README. If you do need help, we recommend Setting up PostgreSQL from The Odin Project.

Set environment variables

You must set the environment variables DATABASE_USERNAME and DATABASE_PASSWORD for a role running your PostgreSQL instance (this is not necessary if running via Docker compose). There are many tools to help manage environment variables:

This project also ships with figaro if you would like to use it to set these environment variables.

Figaro instructions for setting environment variables:

  1. cp config/application.example.yml config/application.yml
  2. code config/application.yml or vi config/application.yml or nano config.application.yml
  3. Replace REPLACE_ME with your PostgreSQL role credentials

Run the setup script to prepare DB and assets

bin/setup

To run the app locally, use:

bin/dev

You should see the seed organization by going to [http://localhost:3000/alta/]

Login Credentials

All users are scoped to an organization. Hence, you must login via the correct login portal per organization.

You can use the following login credentials to login to [http://localhost:3000/alta]:

Use the following login Adopter

  • email: adopter1@alta.com
  • password: 123456

Staff

  • email: staff@alta.com
  • password: 123456

Viewing Mail

Go to http://localhost:3000/letters to view mail in development.

๐Ÿงช Running Tests

Run unit tests only

./bin/rails test

Run system tests only (Headless)

./bin/rails test:system

Run system tests only (Not-Headless)

CI=false ./bin/rails test:system

Note: If system tests are failing for you, try prepending the command with APP_HOST=localhost. Your host might be misconfigured.

APP_HOST=localhost ./bin/rails test:system

Run ALL tests:

./bin/rails test:all

Troubleshoot

Test Errors - System tests Error TCP Connection refused

Fix: chromium install

Case in point

๐Ÿ’… Linting

We use standard for linting. It provides a command for auto-fixing errors:

rails standard:fix

Authorization

If you find yourself writing a conditional checking the question, "Is the user allowed to view/do this?" that is an authorization concern. Homeward Tails utilizes the gem Action Policy as our authorization framework. If you are familiar with Pundit, you will see many similarities. If you want to learn more about authorization or have questions about how Action Policy works, their documentation is excellent. If you would like a quick onboarding to how Action Policy is used in Homeward Tails, see our wiki page on authorization.

๐Ÿ”จ Tools

This google sheets contains a list of tools, their purposes, and who has access to grant permissions.

๐Ÿค Contributing Guidelines

Please feel free to contribute! Priority will be given to pull requests that address outstanding issues and have appropriate test coverage. Focus on issues tagged with the next milestone for higher priority.

To contribute:

  • Only work on one issue at a time

  • Identify an unassigned issue

  • Request assignment of an issue by adding a comment on the issue

  • Fork the repo if you're not yet a contributor

  • Ensure that the application runs locally in your browser. When you run the test suite locally, it should pass

  • Create a new branch for the issue using the format XXX-brief-description-of-feature, where XXX is the issue number

  • Make code changes related to the assigned issue

  • Commit locally using descriptive messages that indicate the affected parts of the application

  • Add tests related to your work(most of the time)

  • Ensure all tests pass successfully; if any fail, fix the issues causing the failures

  • Make a final commit if any code changes are required

  • Push up the branch

  • Create a pull request and fill out the description fields

  • We like to make sure people are recognized for their contributions, so please attribute others by commenting on a pull request with

    @all-contributors
    please add @<username> for <contributions>. 
    please add @<username> for <contributions>.
    

    Replace <contributions> with code or review

๐Ÿ“– About

Ruby for Good

Homeward Tails 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]

๐ŸŒŸ Core Values

While vision is the destination, and strategy is how we'll get there, core values are what we'll use to handle times of change or uncertainty (both of which are expected, guaranteed to happen, and positive signs of growth!).

We are committed to promoting positive culture and outcomes for all, from coders and maintainers and leads to pet rescue and adoption administrators -- and animals everywhere.

We will lean on the following as guiding principles when interacting with others -- stakeholders, as well as current and future maintainers, leads, and collaborators -- and we ask that anyone engaging with this project in any capacity to do the same. Know that we do want to know how and when (not if) we can improve upon these values and/or the way in which we live by and act in accordance with them, so please comment here and in PRs when you have ideas.

Here are our core values defined by early contributors and leads:

Code Quality and Collaboration

Write maintainable code that is accessible and enjoyable (for beginners and seasoned coders alike), supports and encourages contributors and their contributions, and ensures long-term sustainability of this project and the efforts it supports.

Communication and Perspective

Prioritize clear communication, embrace diverse viewpoints, and always engage feedback -- all with a commitment to timely responses and ongoing improvement for all. Rescue and adoption partner perspectives will be prioritized over abstracted conceptualization of their needs.

Engagement and Practicality

Build upon stakeholder partnerships to foster and encourage their active involvement, focusing constructive discussion and dispute resolution on the practical impact of our collective work.


๐Ÿ“š Useful resources

These are some resources that may help with contributing to the codebase

Contributors โœจ

Thanks goes to these wonderful people (emoji key):

Ben
Ben

๐Ÿ’ป
Marlena Borowiec
Marlena Borowiec

๐Ÿ’ป
Piotr Borowiec
Piotr Borowiec

๐Ÿ’ป ๐Ÿ‘€
Yuri Pains
Yuri Pains

๐Ÿ’ป
Jarrod Reyes
Jarrod Reyes

๐Ÿ’ป
Erin Claudio
Erin Claudio

๐Ÿ’ป
Edwin Mak
Edwin Mak

๐Ÿ’ป
Jade Stewart
Jade Stewart

๐Ÿ’ป
Vernes
Vernes

๐Ÿ’ป
Michael Marchand
Michael Marchand

๐Ÿ’ป
Yuji K.
Yuji K.

๐Ÿ’ป
Justin
Justin

๐Ÿ’ป
Goran
Goran

๐Ÿ’ป
Phong Pham
Phong Pham

๐Ÿ’ป
Diego Linhares
Diego Linhares

๐Ÿ’ป
Egemen ร–ztรผrk
Egemen ร–ztรผrk

๐Ÿ’ป
Alisa
Alisa

๐Ÿ’ป
Sree P
Sree P

๐Ÿ’ป
Eric Tillberg
Eric Tillberg

๐Ÿ’ป
Tomaszabc
Tomaszabc

๐Ÿ’ป
BALAJI . A . T
BALAJI . A . T

๐Ÿ’ป
Ken Maeshima
Ken Maeshima

๐Ÿ’ป
Mason Roberts
Mason Roberts

๐Ÿ’ป
Mayank Bhatt
Mayank Bhatt

๐Ÿ’ป
Jeevika Sirwani
Jeevika Sirwani

๐Ÿ’ป
Jade
Jade

๐Ÿ’ป
Mehran Javid
Mehran Javid

๐Ÿ’ป
Bryan Witherspoon
Bryan Witherspoon

๐Ÿ’ป
David Wilson
David Wilson

๐Ÿ’ป
Gabe D
Gabe D

๐Ÿ’ป
Greggory Rothmeier
Greggory Rothmeier

๐Ÿ’ป
Tim Pope
Tim Pope

๐Ÿ’ป
Ian Candy
Ian Candy

๐Ÿ‘€
Vaughn Weiss
Vaughn Weiss

๐Ÿ’ป
Harshit Chaudhary
Harshit Chaudhary

๐Ÿ’ป
Lindsey Bieda
Lindsey Bieda

๐Ÿ’ป
Sean Dickinson
Sean Dickinson

๐Ÿ’ป
Oliver Coley
Oliver Coley

๐Ÿ’ป
Nidhi Sarvaiya
Nidhi Sarvaiya

๐Ÿ’ป
Evan Light
Evan Light

๐Ÿ’ป
Kirin
Kirin

๐ŸŽจ
albertabney
albertabney

๐Ÿ’ป
Tacabr0n
Tacabr0n

๐Ÿ’ป
Jamey Alea
Jamey Alea

๐Ÿ’ป
Naraveni
Naraveni

๐Ÿ’ป
maebeale
maebeale

๐Ÿ‘€
Meg Gutshall
Meg Gutshall

๐Ÿ’ป
Jaxon
Jaxon

๐Ÿ’ป
Alex Cohen
Alex Cohen

๐Ÿ’ป
Kristine Sevilla
Kristine Sevilla

๐Ÿ’ป
Chris Flipse
Chris Flipse

๐Ÿ’ป
Trevor Robinson
Trevor Robinson

๐Ÿ’ป
pshong79
pshong79

๐Ÿ’ป
Aaryan
Aaryan

๐Ÿ’ป
รtalo Matos
รtalo Matos

๐Ÿ’ป
Basil Gray
Basil Gray

๐Ÿ’ป
Noah Durbin
Noah Durbin

๐Ÿ’ป
Kate Higa
Kate Higa

๐Ÿ’ป
Cory Streiff
Cory Streiff

๐Ÿ‘€
Wuletaw Wonte
Wuletaw Wonte

๐Ÿ’ป
michascant
michascant

๐Ÿ’ป
Jordy Williams
Jordy Williams

๐Ÿ’ป
Tamir
Tamir

๐Ÿ’ป
palidii
palidii

๐Ÿ’ป
Isaac Alter
Isaac Alter

๐Ÿ’ป
Amy McCaughan
Amy McCaughan

๐Ÿ’ป
jrussell416
jrussell416

๐Ÿ’ป
Caitlyn Landry
Caitlyn Landry

๐Ÿ’ป
Jason Wang
Jason Wang

๐Ÿ’ป
Mikhail Grigoriev
Mikhail Grigoriev

๐Ÿ’ป
Cassie
Cassie

๐Ÿ’ป
Werner
Werner

๐Ÿ’ป
stefaanbeernaert
stefaanbeernaert

๐Ÿ’ป
Md Shafayet Jamil
Md Shafayet Jamil

๐Ÿ’ป
binarygit
binarygit

๐Ÿ’ป
Mike Rose
Mike Rose

๐Ÿ’ป
Jesse Berman
Jesse Berman

๐Ÿ’ป
Simmon Li
Simmon Li

๐Ÿ’ป
shubhIam-dev
shubhIam-dev

๐Ÿ’ป

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

About

Homeward Tails is an application making it easy to link adopters/fosters with pets. We work with grassroots pet rescue organizations to understand how we can make the most impact.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors