Skip to content

Latest commit

 

History

History
323 lines (239 loc) · 27.5 KB

README.md

File metadata and controls

323 lines (239 loc) · 27.5 KB

Pet Rescue Adoption Application

All Contributors

The Pet Rescue 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. Pet Rescue 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!

Docker

Install a containerization app, such as Docker Desktop.

Clone the repo to your local machine and navigate to the 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.

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

To run postgresql as a service:

brew services start postgresql

Installing via docker

A docker-compose.yml is provided that will run postgres inside a local docker container without requiring a full OS install.

Before bringing the image up, you'll need to choose a database username and password by exporting the following environment variables.

Using direnv is recommended here, to manage environment variables locally.

export DATABASE_USERNAME=[your username]
export DATABASE_PASSWORD=[a password]

Once your environment has been set, you may launch the postgres database, and any other dependencies, by running docker compose up -d

Install & Setup

Clone the codebase

git clone git@github.com:rubyforgood/pet-rescue.git

Create a new config/application.yml file from the config/application.example.yml:

cp config/application.example.yml config/application.yml

Update your config/application.yml by replacing the places that say REPLACE_ME. If you installed and configured PostgreSQL as discussed above you can use your username and leave the password blank for development.

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

🧪 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. Pet Rescue 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 Pet Rescue, 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:

  • Identify an unassigned issue

  • Only work on one issue at a time

  • 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

Pet Rescue 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.


📚Knowledge Base

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

💻

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