Git Product home page Git Product logo

scot's Introduction

CrowdRescue

Disaster response and relief management for volunteer teams

Prerequisites

You'll need Ruby and MySQL installed to be able to set CrowdRescue up locally.

Setup

  • Clone the repository and cd into the repository directory.
  • Install the required gems:
$ bundle install
$ cp config/settings.sample.yml config/settings.yml
  • Same for database config: copy and fill in your real username and password:
$ cp config/database.sample.yml config/database.yml
  • Run MySQL if it is not already running.

You can check if MySQL is running with

$ ps aux | grep mysql

On Linux, start MySQL with

$ sudo systemctl restart mysql

On Mac, use

$ mysqld
  • Set up the database:
$ rails db:create
$ rails db:schema:load
$ rails db:migrate
  • Run the server with
$ rails s

MySQL permissions setup

You may see an error about MySQL permissions. If you do, you need to set up your user's permissions within MySQL.

You'll want to log in to MySQL as root so you can make these changes. Make sure MySQL is running first. On MacOS, run:

$ sudo mysql

Enter your password (the one you normally use with sudo, not a MySQL related password).

On Linux, use:

$ mysql -u root -p

You'll now be in the MySQL console.

Change to the system database for MySQL.

mysql> use mysql;

List the MySQL users.

mysql> select user from user;
+---------------+
| user          |
+---------------+
| <your name>   |
| mysql.session |
| mysql.sys     |
| root          |
+---------------+

<your name> should be there; this should be the same name as the username listed in config/database.yml.

Look at the grants given to your user.

mysql> show grants for <your name>@localhost;

If you're having permission errors you probably do not have the needed grants.

Grant yourself all privileges on all tables on crowdrescue_dev. This will have been created when you ran the rails setup commands listed above.

mysql> GRANT ALL PRIVILEGES ON `crowdrescue_dev`.* TO '<your name>'@'localhost';

If you have other databases set up locally, like crowdrescue_test or crowdrescue_prod, grant yourself permission on those as well.

mysql> GRANT ALL PRIVILEGES ON `crowdrescue_test`.* TO '<your name>'@'localhost';
mysql> GRANT ALL PRIVILEGES ON `crowdrescue_prod`.* TO '<your name>'@'localhost';

Then tell MySQL to apply these changes with

Now make sure the privileges got added properly:

mysql> show grants for <your name>@localhost;
+--------------------------------------------------------------------------------------+
| Grants for <your name>@localhost                                                           |
+--------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON `crowdrescue_dev`.* TO '<your name>'@'localhost' WITH GRANT OPTION |
| GRANT ALL PRIVILEGES ON `crowdrescue_test`.* TO '<your name>'@'localhost'                  |
+--------------------------------------------------------------------------------------+

You can now leave the MySQL console.

mysql> exit
Bye

Now try running SCOT again, you should have the permissions you need.

License

SCOT - disaster response/relief management for volunteer teams
Copyright (c) 2017 Owen Jenkins and contributors

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

scot's People

Contributors

artofcode- avatar isaiahzs avatar thesecretmaster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scot's Issues

Incident Update

There needs to be a way to suggest edits to a rescue request and have them reviewed. In the old sheet, this was done by filling out a google form and the actions were manually done to the master by a volunteer who has that power.

View past reviews

We need to create tools to view past reviews of all types -- spam, dedupe, and suggested edit.

No role redirect from help form

Currently, if you have no role, after requesting help, you'll be redirected to the page with your info. Sadly, if you get to that page, you don't have the privileges to see it, and so it will be hidden from you.

Make edit notes formatted correctly

System case notes detailing edits to rescue requests aren't formatted correctly:

case-note

This requires HTML to format correctly, not \n joins, but doing that requires careful work to make sure there's no injection/XSS vulnerability.

While we're at it, we could ignore nil/empty being changed to nil/empty, and we can also ignore updated_at changing.

Two Content Boxes Side by Side

A different "quick fix" that might be easier? On the Input form - show the Content box already open for the Spanish niput and don't "hide" it

I'd really rather see - in the "View" page - the 2 content boxes side-by-side. Then, if there's no translation - the box is empty!!!

Filter by multiple statuses

The current filter option should allow a selection of multiple options in the dropdown to filter by multiple statuses.

Edit logging improvements with suggested edits

We should stop using case notes for edit tracking and instead use self-approved suggested edits. Those should then be listed with the case notes for each rescue request. This can't be started until #29 is merged.

This should also work in conjunction with #31 in that it should say "UserXXX edited (edit approved by userXXX)" and that should link to the suggested edit review.

Rescue request table view

We should add a RescueRequest table view that will show the values of some columns (e.g. name, case id, status) but hide other info behind a link labelled "Click to view more information. Access is logged.". That link should make a AJAX call to the backend where the request is logged in a PIIAccessEvents table and the values are returned.

Next feature: Volunteer management

The next big feature to build (because it's a feature we can start using now, even when we're not doing rescue ops) is a volunteer management system. Basically, a way to track who's who, what skills they have, what teams they're in and what roles they occupy, etc etc etc.

Credit to Alex for the idea.

Review Button

Instead of "Finish" - replace with "Review" and show a summary with an edit option. Then on the Summary page, have a button that says "Submit Rescue Request".

I mean, on the Summary page, there are TWO options: "Edit Request" and "Submit Rescue Request".

Triage is status

There triage field is really a status and should be renamed to such. Actual triage is used to mark urgency.

Resource Tracking

We should add a section to track various resources that could be useful to victims of disasters, for example shelter, food sources, etc. This is fairly low priority because fulcrum already does this well enough, and there's not a whole lot of room to improve.

Add Item

can you go to our current data entry form and move the "Add Item" link from the bottom of the page to the top of the page??

Edit improvements

We need to improve broadcast item edit functionality.

  • Add a belongs_to :user association to Broadcast::Item.
  • Let authors of broadcast items edit them at any time
  • Let people with the (new) BroadcastReviewer role edit any item, any time.

Restart Queues

We need to restart queues development, and with a plan this time. Here's the structure:

Each rescue request has 2 new attributes, dupe_of:integer and spam:boolean.

There's a new ReviewTask table to log reviews.

When somone hits /queues/spam it pulls a random record with RescueRequest.where(spam:nil).order("RAND()").first (modified so it doesn't grab anything with a reviewtask already created), creates a reviewtask with no outcome marked and renders it with buttons below it "Spam", "Not Spam", "Skip". It then posts the name of the button to /queues/spam/new where a reviewtask is updated with the outcome, and it is marked either spam:true or spam:false.

When someone hits /queues/dedupe it pulls a random record that has no dedupe review tasks and is not a dupe. It then renders that record and all similar record vertically aligned, each possible dupe with a button next to it, each with a value of the id of that record. There's also a skip button at the bottom. Those are the differences between that and the spam queue.

Column Width

Here's another "quick fix" for that page - please, change the column widths so that Content is perhaps twice its current width. And "Source" should have "wrap - cut off", instead of driving the column width on that page

Assign Volunteer to Case

It might be useful to be able to have each case be assigned to a volunteer so it's more consistent for the person on the receiving end. Either way, it can't hurt to build this in.

Duplicate item review

We need a way to track down and remove (deactivate) any items that are duplicates of those already entered.

  • When an item is submitted, if it has identical text to another item that already exists, ask the user to confirm that they want to submit it again.
  • Add a way to find similar texts - not identical, but there are a number of items that say the same thing that also need to be deactivated.

Link expansion

For twitter links that are stored, we should provide an embedded version of that tweet on the view for the RescueRequest.

Permit specific users edit access to a rescue request

We should create a system that allows admins to grant access to any user to edit a rescue request, regardless of what roles they have.

This will involve some fairly complex associations and security, but I have a pretty good idea of how to design it. I'll start working on this next week.

Country Outside of Hurricane Maria (Canada)

System asks where 'the person that enters' is but the person reporting may be at a different address

additionally Canada was not affected by Maria and shouldn't be ok? ??? ie should it be restricted to the area from NWS? or FEMA? or ???

Zip code format is different

Phone number should have Country Code Number before number

2017-10-01 7

2017-10-01 7

Add options to public triage/Tagging system

Here's a list of all the public triage options (comma delimited): Rescued, Declined to be rescued, Supply request only, Monitor status, Deceased, Missing, Rescue pending, Wellness Check, Pets Only

Allows playboy.com - should it?

Should playboy.com be allowed? should it be filtered out via adult filters? but then again Playboy mansion or strip club may need to be evacuated. Is this supposed to be public???

2017-10-01 5

Case comments

It should be possible to leave timestamped comments on a person/case which are labled by the person who made them. We could also use comments as a kind of update logging. E.g. "X updated a to be b and c to be d." and credit those comments to "System".

Incident Updates/Suggested Edits

We need to fill the need of having a "suggested edits" queue, where one group of volunteers can fill out an update form and other volunteers can process it. This could work like suggested edits or it could be a form which feeds a queue. Both would be similar, but the latter would require a new table. We need to get more feedback about this.

Each edit should get logged and possible have an attached note or reason. (Could be built through case notes, could be separate).

Editable View

It should be possible for a RescueRequest to be edited. Who edited, what they changed, and when they edited should be logged, possibly in a comment (see #8).

Color Coding

We should apply some kind of color coding to the rows. Currently, in the master sheet:

  • Dark Green = Rescued
  • Light Green = Declined rescue
  • Red = Not medical triaged and emergent
  • Pink = Emergent (red overrides)
  • Purple = Medevac
  • Yellow = Semi-Urgent
  • Orange = Urgent
  • Light Blue = Rescue Pending/Missing/Wellness Check

Count reports for each RescueRequest

Each RescueRequest should have a reports counter to keep stats. Each time one RescueRequest is merged into another, the master should have the dupe's reports added to its reports.

Add 'Projects' to Github

Can someone enable my permissions so that I can add Projects or can you add the following projects 'Rescue', 'Broadcast', 'Volunteer', 'Translation' 'ArcGIS'

Track Contacts

We should add a table, similar to case notes, where every time a person is contacted we can track how they were contacted, when, by whom, and what the conclusion of that contact (or failed contact attempt) was.

Replace Deprecate Button

Speaking of the broadcast table, can we replace the "Deprecate" button with a big red x box and can we merge the translated column into the "Add translation" link column by having it put a little star next to everything untranslated?

Unrestricted Update

Anyone who knows the ID (which is given in the URL) can update a rescue request. We need to use the key field to restrict that to only people who have either 1) created it or 2) are authenticated.

Medical Requirements

The medical people would like a couple things:

  • Editable, private field that's only viewable/editable for people with the medical role called "Chart Code"
  • Medical-only comments, only viewable/creatable for people with the medical role. Possibly filterable on the client side.
  • A special triage status that only medical can edit but is publicly viewable. The options are: Medevac, Emergent, Urgent, Semi-Urgent. Changes to this status and the user who made those changes needs to be logged and viewable by those with the medical role.

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.