CZagrobelny / new_sanctuary_asylum

MIT License
51 stars 50 forks source link

New Sanctuary Coalition

Table of Contents

What are we building?

The New Sanctuary Coalition is a network of congregations, organizations, and individuals standing publicly in solidarity with families and communities resisting detention and deportation. This internal database software facilitates NSC's core programs and allows them to operate at increasing scale.

NSC's programs include:

Learn More

Getting setup

System Dependencies

Environment Variables

For local development, create a .env file in the root directory of the application and copy the environment variables contained in .env.example into your newly created .env file.

If you are using docker to run the application (as described below), add POSTGRES_PASSWORD=password to your .env file.

Using Docker to Run the Application (optional)

Docker is a way for you to run this application on your machine without changing any of your local settings or installing anything new (besides Docker itself).

More instructions here.

Ruby Dependencies

gem install bundler
bundle install

Database installation

This app uses a Postgresql database. Instructions diverge based on your operating system.

1. Mac OS

Install Postgres.app: https://postgresapp.com

2. All non-Mac OS

I recommend running Postgres in a docker container. To run Postgres on docker, you can do the following:

docker pull postgres:9.6
docker run --name new_sanctuary -p "127.0.0.1:5432:5432" -e POSTGRES_PASSWORD=password -d postgres:9.6

NOTE: If you are using psql instead of Postgres.app, create your user this way:

$ createuser postgres --createdb
$ psql
psql (10.2)
Type "help" for help.

yourname=# ALTER USER postgres WITH PASSWORD 'password';

Database setup

To run initial migrations and seed the DB:

cp config/database.yml.sample config/database.yml
rake db:setup

To switch from using docker back to using the rails server locally, run:

cp config/database.yml.sample config/database.yml

Running the test suite

rspec

CircleCI is set up for the app, and will run the full test suite when you push to github. There are still some flappy specs, unfortunately :/ ...so, if the specs pass locally, but not on CircleCI, feel free to leave a note when you create your PR.

Running the App Locally

rails server

User Roles

Regional Admin (has access to all communities within their regions)

Login as a Regional Admin with:

Community Admin Role (has access to everything scoped to their Community)

IF the Community is 'primary' (ie. primary = true), additionally:

Login as an Admin of a Primary Community with:

Login as an Admin of a Non-Primary Community with:

Community Volunteer Role (has limited access to their community)

IF the Community is 'primary' (ie. primary = true), additionally:

Login as an Volunteeer for a Primary Community with:

Login as an Volunteeer for a Non-Primary Community with:

Community Accompaniment Leader Role (only applicable to Primary communities)

Login as an Accompaniment Leader with:

Remote Clinic Lawyer Role

Login as a Remote Clinic Lawyer with:

How are we building it?

Test Coverage!

Aiming to cover the functionality we build with:

Staging App

We have a staging app here with seed data: https://frozen-sea-20640.herokuapp.com The data is refeshed occassionally, but activities/accompaniments are likely to be out of date.

Performance Monitoring

We are using Skylight for performance monitoring. View performance data on Skylight

Maintenance

When making changes to the README of this project, make sure to run the following:

rake toc

This will ensure the Table of Contents for this project is properly updated.

Contributing

  1. Add a comment on your chosen Github issue to let other contributors know that you have 'claimed' it.
  2. Fork the repo and download a clone of the forked repo: https://guides.github.com/activities/forking/
  3. Create a feature branch off master.
  4. Complete feature with tests!
  5. Check CircleCI to make sure tests are passing.
  6. Make a pull request and tag CZagrobelny to review.
  7. CZagrobelny will QA and leave feedback (usually within a few days of when the PR is opened) and merge into master upon approval of the pull request.

It can be really helpful to get notifications when new issues are opened! Here is how you subscribe to notifications:

how to get notifications

Code of Conduct

Here

Questions?

Contributors

We have an amazing group of contributors and organizations working to build out the software!