Code Monkey home page Code Monkey logo

where2help's Introduction

Where2Help

Build Status Dependency Status

Development

Run the project locally

Install bundled gems

$ bundle install

Start up postgres (if not already running)

$ postgres -D /usr/local/var/postgres/

Setup the database

$ createuser --superuser postgres

$ rails db:setup

Populate database with sample data

$ rails db:populate

Start up rails!

$ rails server

Run the project in Docker

Make sure you have Docker and Docker-Compose setup and running.

Build the project

$ docker-compose build

Spin up the containers

$ docker-compose up

Setup the database

$ docker-compose run app rails db:setup

Populate database with sample data

$ docker-compose run app rails db:populate

Restart the server

$ docker-compose stop
$ docker-compose up

To run the server as an interactive shell (to use e.g. byebug or pry)

$ docker-compose run --service-ports app

Deployment

Heroku

Set up the following environment variables:

  • DATABASE_URL
  • SMTP_EMAIL_ADDRESS
  • SMTP_EMAIL_PASSWORD
  • FQDN
  • SECRET_KEY_BASE
  • RAILS_ENV
  • RAILS_SERVE_STATIC_FILE

CI

Travis CI is set up to automatically deploy to Heroku:

If you want to skip continuous integration for your commit, add this to your commit message:

[ci skip]

Contributing to Where2Help

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
  • Fork the project.
  • Start a feature/bugfix branch, master should always be stable.
  • Commit and push until you are happy with your contribution.
  • Make sure to add tests for it, if possible.
  • If you're interested in working on an issue that has been assigned to somebody, we encourage you to get in touch with them first!

Styleguide

Ruby / Rails

Translations

  • the application is bilingual: English & German
  • everything visible to end users needs to be translated
    • views
    • ActiveRecord model-names and -attributes
    • error messages
  • translation strings are kept in /config/locales
  • please stick to the naming conventions:
    • model-names and model-attributes go into active_record.<locale>.yml
    • view-specific translations go into views.<locale>.yml
    • human language defaults go into defaults.<locale>.yml
    • if a gem needs a certain amount of translation strings, these go into <gem_name>.<locale>.yml
    • anything else (helpers, etc.) goes into <locale>.yml

CSS

  • use the .scss syntax
  • use @import over to import styles in application.css.scss
  • keep to the conventions of the application.css.scss manifest:
  • the granularity of rules increases top to bottom (general styles on top, more specific ones last)
    • global rules go into base/
    • page specific styles into pages/
    • site-wide used component rules go into base/components.scss (extract a components/ directory if it gets to big)

Development Environment

Sample Data

To set up a development environment, you can run this command:

Warning, this will drop your database ๐Ÿ˜ฑ

bundle exec rake db:drop db:setup db:populate

This will:

  • drop your database
  • re-create it
  • load the schema (like running migrations but better)
  • run seeds
  • run the lib/tasks/db/populate.task command to load your database with fake data

On top of a bunch of other Event data and users, you will get:

Emails

You can use the gem letter_opener which opens your emails in a browser tab instead of just printing emails to the logs by running the app like this:

ENABLE_LETTER_OPENER=1 bundle exec rails server

If you run it without the ENABLE_LETTER_OPENER it will run as you would normally expect.

where2help's People

Contributors

arejdych avatar barbarafux avatar groe avatar haslinger avatar hola-soy-milk avatar klappradla avatar metakermit avatar mftaff avatar mraaroncruz avatar rowalth avatar sido378 avatar tamacodechi avatar thrillberg avatar vierlex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

where2help's Issues

API security

Securing the API, so that it is safe and we can allow connections of remote services.

NGO Registration

Current workflow to register as NGO:

  1. register as normal user
  2. contact admin, verify as NGO
  3. have admin change ur user-role to 'ngo_admin'

Problems I see:

  • hard for admins to keep track on NGO-requests when more (normal) users registering
  • NGO requests need to be verified / checked (to not have app trolled by idiots)
  • NGOs don't get the registration process without knowing/contacting an admin

Solution I'd propose: separate registration process for NGOs (as intended with 2nd button on landing page)

  • workflow:
    • NGOs register as NGO-user right away
    • account blocked, notice that account need to be verified
    • admins get mail on new NGO request (can verify email, phone)
    • admin approves request -> email to NGO, account open
  • technical
    • additional routes, extend/derive registration controller (minimal effort)
    • eventually STI on user model

Love to ๐Ÿ‘‚ ur feedback on that. Could work on it tomorrow on the train.

Update forms and routes

  • Use admin namespace for managing all resources globally
  • Use ngo namespace to set up and manage (own) needs
  • Use no namespace for public/volunteer view on needs
  • Remove unused devise/registrations or users routes (currently double).
  • Remove user/new (should not be possible due to devise)
  • Update user forms for ngos and volunteers

Format Registration Form

Format registration form, add classic validates :terms_and_conditions, acceptance: true for terms and condition, privacy stuff etc.

Add more than one category and count for each event

This will surely cause some UX changes but the way I see it is:

  • a link to add more categories in the add/edit form for a need
  • the needs list isn't listed by need, but instead by categories, then needs (so the same need may be multiple times on the list)

The reason for this is that I don't even know if it's possible right now to create two needs at the same time. Even if you can, this is an unnecessary step for the user.

Navigation webapp

The web interface still lacks proper navigation. I'd suggest a semantically different one for each user role, arranged in a classic bootstrappy way: logo (home), etc. on the left side and user specific stuff such as logout, profile, etc. in a dropdown in the right corner.

Means of navigation I think we need:

Already referencing a data model I suggested here

  1. normal user
    • Logo/Home -> feed view
    • Termine -> list of needs a user signed in (to allow hopping out again)
    • Dropdown
      • Profil -> edit form to change email / telephone
      • Logout
  2. ngo user
    • Logo/Home -> feed view (allows NGOs to check if other NGO already posted request)
    • Kalender -> calendar view
    • Events/Termine -> elaborate list view of events and needs (should be able to see who signed up, contact volunteers)
    • Dropdown
      • Profil -> edit form (maybe photo to better identify NGO)
      • Logout
  3. admin user
    • Logo/Home -> feed view (allows NGOs to check if other NGO already posted request)
    • Users -> user index
    • Events -> events index
    • Events/Termine -> elaborate list view of events and needs (should be able to see who signed up, contact volunteers)
    • Logout

What do you think?

Getting empty headers from /needs

A GET to /api/v1/needs returns empty HTTP headers.

10-22 12:37:36.365 27554-28119/app.iamin.iamin E/PullNeedsTask: Access-Token = null
10-22 12:37:36.365 27554-28119/app.iamin.iamin E/PullNeedsTask: Token-Type = null
10-22 12:37:36.365 27554-28119/app.iamin.iamin E/PullNeedsTask: Client = null
10-22 12:37:36.365 27554-28119/app.iamin.iamin E/PullNeedsTask: Expiry = null
10-22 12:37:36.365 27554-28119/app.iamin.iamin E/PullNeedsTask: Uid = null

Expiry, a date?

The "Expiry" header for validating tokens is a date or a time span?

(Interactive) Wireframes for user workflows

This is mostly brainstorming

  • ngo workflow story
  • ngo creating need
  • ngo editing need
  • ngo looking at need status
  • ngo deleting need (and how does this affect volunteers)
  • volunteer looking at needs
  • volunteer filterning at needs
  • volunteer signing up for need
  • volunteer canceling need
  • volunteer looking at needs they are part of
  • volunteer need history

500 error after logging in as admin - Staging

After logging in as an admin, heroku throws up the following:

2015-10-22T08:58:31.586286+00:00 app[web.1]: ActionView::Template::Error (undefined method `stringify_keys' for "/users":String):
2015-10-22T08:58:31.586288+00:00 app[web.1]:     14:   <% end %>
2015-10-22T08:58:31.586288+00:00 app[web.1]:     15: </li>
2015-10-22T08:58:31.586289+00:00 app[web.1]:     16: <li>
2015-10-22T08:58:31.586290+00:00 app[web.1]:     17:   <%= link_to 'Benutzer', users_path do %>
2015-10-22T08:58:31.586291+00:00 app[web.1]:     18:     <i class="fa fa-users fa-fw"></i> Benutzer
2015-10-22T08:58:31.586291+00:00 app[web.1]:     19:   <% end %>
2015-10-22T08:58:31.586292+00:00 app[web.1]:     20: <li>
2015-10-22T08:58:31.586293+00:00 app[web.1]:   app/views/application/_nav_admin.html.erb:17:in `_app_views_application__nav_admin_html_erb___611726443266481601_70087383669680'
2015-10-22T08:58:31.586294+00:00 app[web.1]:   app/views/application/_nav.erb:17:in `_app_views_application__nav_erb___2050051929353156741_70087384826140'
2015-10-22T08:58:31.586295+00:00 app[web.1]:   app/views/layouts/application.html.erb:41:in `_app_views_layouts_application_html_erb__361859152321145472_70087384494480'

Friendly forwarding

Friendly forward admins after signing in to the originally requested resource. Otherwise impossible to include links in emails.

Do not require authentication for viewing needs#list and needs#show

As discussed in #25 we should not require authentication for viewing needs. If clicking on a button to participate in a need, not signed in users should be forwarded to the sign in page and afterwards friendly forwarded back to the participation (as stated in #18 ).

This also requires changes to the navigation.

Renaming repository to where2help

I would love to see this particular repository to be renamed to where2help.
I believe it is the last naming inconsistency related to the project's old name.
Any opponents?

Send confirmations and calendar entries

Could be useful to send volunteers a reminder for needs they signed up for, including an entry (.ics) for their calendar. Could be digest mails (daily) or immediate ones.

Allow users to edit their profile and cancel their account

Allow users to edit their profile (including email and password) and cancel their account. Devise already handles all this for us. So we only have to to two things:

  • Link the respective views and adapt them to match the rest of the app
  • Add the missing fields to the views and the parameters to Devise' strong parameters

View own needs

List views for own needs for both, NGOs and Users. Currently linked to as 'Termine'.

UI on needs list looks like I am already signed up for need

I think "Helfen", green, with a check looks like I am already helping. Maybe "Ich will Helfen" without a checkbox, maybe a different color. I think of green in this context normally as a state of already committed. At the very least, I think the check should go away. But I also think the "x" may be ok to stay on "Absagen"

What do you think?

User Onboarding/Flow

The following pic shows the current user flow of the android app:
android_onboarding

But maybe we should force a user login/register on startup just like the web app since needs are not public anymore.

API extension

Documentation: More details on the /volunteerings end.
Extending endpoint: user#show : I would like to list all the needs the user is attending to inside the user profile.

Nicer update emails

Once a $period (e.g. week - should be configurable). Collect all new needs created since the last email (maybe by using a users_notified property on the needs) and send an e-mail with the description of all these batched needs to all the registered users.

Organisers should have access to "send notification to volunteers about this need" for a specific need immediately in case of urgency (e.g. volunteers needed in 2 hours).

People should be able to opt out of email notifications (we don't wanna be marked as spam).

Consistent menu and navigation

Come up with a consistent and intuitive menu and general navigation (including wording) for the three types of users: ngos, admins, volunteers

Best way to handle error messages?

Error responses vary by endpoint and deliver a mixed bag of german and english

auth/ is quite nice because of the detailed (and from the user understandable) infos inside the "full_messages" array.

  "errors": {
    "password": ["ist zu kurz (weniger als 8 Zeichen)"],
    "email": ["address is already in use"],
    "full_messages": ["Passwort ist zu kurz (weniger als 8 Zeichen)", "E-Mail address is already in use"]
  }

auth/sign_in on the other hand just returns "errors"

  "errors": ["translation missing: de.devise_token_auth.sessions.bad_credentials"]

So an option would be to use the error messages directly (But what about translation?):

  "errors": ["Passwort ist zu kurz (weniger als 8 Zeichen)", "E-Mail ist bereits vergeben"]

Or I assign my own set of strings to the keywords. (Would need a list of all the keywords though)

  "errors": {
    "password": ["too_short", "no_match", ...],
    "email": ["taken", "malformed", ...]
  }

Filter for list view

The list view should be filterable:

  • by category (dropdown)
  • by place/city (text input)

Both should be ajax and can easily be integrated with the already in place pagination mechanism.

I'd also suggest both for the iOS and Android App too.

Need show view

We need a need show view -> link from feed, showing description (yet to add) and map.
Static map image can be provided via Google Maps within seconds, but free contingent is limited.

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.