Giter Site home page Giter Site logo

survival / donation-system-webapp Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 1.0 280 KB

:computer: :iphone: :desktop_computer: Web UI for Survival's donation system

Home Page: https://donation-system-production.herokuapp.com/

License: MIT License

Ruby 55.14% CSS 14.70% HTML 9.70% JavaScript 18.28% Shell 2.18%
clean-architecture donation-form sinatra

donation-system-webapp's People

Contributors

depfu[bot] avatar fastmode avatar ketan-survival avatar octopusinvitro avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

fastmode

donation-system-webapp's Issues

Add form validation tests

This should check that the form can't be submitted if required fields are not filled in.

Just to be clear, there is no need to use javascript for this as the browser is equipped with validation logic. This is achieved by adding a required attribute to the field.

There might be other validations that we want to do apart from presence. For example, max="999" in the security code field. Hence this ticket to tackle the problem separately.

Add business logic for the credit-card expiry year

At the moment, the select element for the credit card expiry year in the donation form is hardcoded to show 18 years in advance from the current year. This has to be calculated automatically. We want to do it in the backend.

Update to Ruby 2.5

Ruby 2.5 is out:

https://www.ruby-lang.org/en/news/2017/12/25/ruby-2-5-0-released/

Our current Ruby version is 2.4.1. Switch the Ruby version to 2.5.0

To get started

  • Claim this issue by clicking the "Assignees" cog to the right and assigning yourself
  • Check out our contributing guides

Steps for this issue:

  • Install Ruby version 2.5.0 on your local system. How to do this depends on the Ruby version manager that you use. (this is an example for the rbenv manager)
  • Set your Ruby version to 2.5.0. This again depends on your Ruby version manager.
  • Change the Ruby version in the Gemfile of this project.
  • Install the bundler gem for that version: gem install bundler.
  • Run bundle install and check that the tests and the app work correctly.
  • You may or may not have to upgrade some gems. If you have to, do it one at a time, like this:
    • run bundle update GEMNAME
    • Run the tests (check README), they should be green
    • Run the app (check README), it should work
    • commit!
  • If everything works, update the Ruby version in the .travis.yml file
  • When you are finished, push your branch and submit a PR with your changes.

XSS protection

See our contributing guides.

Sinatra comes with some protection out of the box, but still there are some extra things we can do:

Input validation:

  • At the moment we have basic native validation. Are there any relevant restrictions we can add?

Input sanitization:

  • Some kind of tags stripping.

Output Escaping

Setting up CSP:

  • Either setting the HTTP headers in Sinatra or adding a meta tag:
get '/foo' do
    headers['Content-Security-Policy'] = 'script-src none'
<meta http-equiv="Content-Security-Policy" content="script-src none">

Using HttpOnly cookies:


Some useful guides:

Add setup instructions for mac and linux.

See our contributing guides.

image

Script will fail if required utilities such as npm and wget are not present on the system.

Presently, the script will carry on with the rest of the commands but it should halt if any of the previous commands fail.


(update by @octopusinvitro)

What to do:

Update the README section "To initialise the project" right after the title to indicate that wget and npm and ruby need to be installed to use the application. Provide helpful links, for example:

Google analytics

See our contributing guides.

It would be nice to have a new account for GA now that we are going to do a rewrite.
This is so that new data is not mixed with old data.
Also, the goals etc. are probably going to be different.

I have created a test GA account with our main account. We can use that and this repo to tune the configuration.

Discussion: to elm or not to elm

See our contributing guides.

Discussion open on incorporating Elm or not:

Pros

  • As opposed to JavaScript, Elm is a proper programming language
  • Also proper functional language
  • The error messages and time travel make it easy to debug

Cons

  • An extra layer of complexity
  • An extra language to learn for beginners wanting to contribute to the repo
  • An extra language to learn for designers

I don't think we should incorporate the new shiny technology just because it's shiny, but because it will solve a problem for us.

Discussion: make this a progressive web app

See our contributing guides.

I think it could make sense to try and serve a basic page when users are not connected to the internet, something that informs you that you can not do a donation at the moment but you can try again once you have internet back.

Discussion open on what to present the user with. Maybe the content of that page is more of a UX person decision, but it doesn't hurt to start thinking about it ourselves.

Add recaptcha

See our contributing guides.

Look into more human friendly solutions as the 'I am not a robot' thing has confused supporters in the past.

If we can't find one, maybe we will need to implement something simple that generates an image and compares the number

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.