Coder Social home page Coder Social logo

option26 / quarantine-hero Goto Github PK

View Code? Open in Web Editor NEW
50.0 5.0 16.0 106.65 MB

A platform that connects people that need help with those who offer help in their vicinity. The frontend is powered by React with the backend being Firebase.

License: GNU Affero General Public License v3.0

HTML 2.47% CSS 2.94% JavaScript 64.42% TypeScript 30.17%
react firebase non-profit neighbourhood javascript typescript

quarantine-hero's Introduction

QuarantineHeros

At quarantaenehelden.org we created a platform for people to support those in their community who might need a little extra help during this time of quarantine. The platform connects people who need help or cannot leave their homes, with those in their neighborhood who are able to run errands, deliver groceries, take pets on walks, and other tasks. On our website, you can register to ask for help or to provide help for others. Let's support those in our community!

A project brought to you with ❤️ and bootstrapped with Create React App.

Contributions

As a non-profit project run by volunteers we rely on the support of the open source community. We highly encourage contributions and we are trying to make this process as frictionless as possible. Please read our CONTRIBUTING.md for more details.

Everyone is very welcome to create issues, give feedback and contribute to the code base. If you'd like to work on an issue, please mention @tgraupne or @florianschmidt1994 in a comment and we will get in touch with you. We are constantly trying to maintain an up-to-date state of the project reflect in labels, reviews and comments.

Getting Started

This repository contains the source code of our website, and the following guide explains how to get started and what you need to improve and use this project.

You need the following libraries to get started: node, yarn, firebase cli. So please install them in an appropriate way on your host system. On macOS, you'd also need the Xcode command line tools.

Once you've installed those dependencies, run the following inside the project folder

yarn install

This will install all JavaScript dependencies.

Local web development

In the project directory, you can run:

yarn start

Runs the app in the development mode and automatically connects to our test instance of Google"s Firebase.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

yarn build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified, and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

Testing

Tests are written and executed with cypress. All tests are stored in the /cypress directory. Tests can be run locally in two ways:

  • yarn test will run the tests immediately in a headless browser and output the results to stdout
  • yarn cypress will open the cypress UI for interactive testing and test debugging

You need to have your development server running on localhost:3000 as the tests will not start a dev server

When contributing please make sure that:

  • All new features are covered by some kind of test
  • Existing tests do not break

Backend development

The following steps will explain how to set up your own Google Firebase project to develop and test cloud functions. Those cloud functions, together with the Firebase document store firestore, provide the backend of our project.

DISCLAIMER: The free Spark plan of Google's Firebase is sufficient for development purposes.

First, go to https://firebase.google.com/, take a look at the Getting Started Guide there and create your own Firebase project. At this point, we hope you already have a Google account, because you'll need one.

Firebase Console

Once your project is created, you need to configure the following things:

  • create a firestore database
  • configure the access rules of your database for proper access
  • create a collection called stats with the document id: "external"

Setup Authentication, the method is Email and Password.

Now you can add a Firebase App to your project, more precisely a Web App. Once created, you can edit and download the specific configuration of your app. This configuration contains API keys, backend URLs, and so on.

Please update the firebaseConfig.jsx file in the src folder of this project, to connect your local instance with your specific backend.

Local Backend Setup

Even though the free Firebase plan is ok for development, it has its downsides. The following feature does not work with this plan: scheduled firebase function.

However, since we use it in production we need to comment out the following line of code:

// exports.sendNotificationEmails = functions.pubsub
      .schedule('every 3 minutes')
      .onRun(async (context) => {}

In general, local development should not use the email system, and if you'd want to use it, you'd have to configure your own SMTP server. Or even better, replace all email-related source code with proper logging.

Deployment

After those changes, you should be able to initialize and deploy your own Firebase function to your specific backend. Within the project folder, run:

cd firebase/functions
...

npm i
...

firebase login
...

firebase init
...

firebase deploy
...

and follow the instructions.

With all that, you should be good to go. In case you missed something or some step was unclear, please create an issue in this repository.

Necessary Environment variables for CI / CD

  • TOKEN: A GitHub token used for committing code to the GH pages branch
  • FIREBASE_TOKEN: A Firebase token for deploying the functions to firebase
  • SENTRY_AUTH_TOKEN: A Sentry token used for creating a new release after deploying to production

quarantine-hero's People

Contributors

caopi avatar daangus avatar dependabot[bot] avatar florianschmidt1994 avatar funtonia avatar hvonzimmermann avatar jakobedding avatar janikga avatar kenodressel avatar koiranos avatar mauriceackel avatar niconomaa avatar tgraupne avatar thepiwo avatar timjb avatar tinobo avatar yorickreum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

quarantine-hero's Issues

Add Pagination to frontpage

Cloud Firestore has several features to help you manage queries that return a large number of results:

  • Cursors, which allow you to resume a long-running query.
  • Page tokens, which help you paginate the query results.
  • Limits, which specify how many results to retrieve.
  • Offsets, which allow you to skip a fixed number of documents. (DO NOT USE, 1 read per skipped doc)

Reactivate Google GeoLocation API

  • Migrate Database (plz --> geolocations)
  • Verify that the website still works when we flip the feature flag
  • Verify that the firebase functions still works when we flip the feature flag
  • make the repo backwards compatible so that we can always go back to plz with out migration

The backwards compatibility is enforce by only allowing users to input a plz in the "askForHelp" form and the "offer-help" form.

Feature: Add categories for posts

We could add the possibility to tag a post with a category, to improve the search and filter function. As a user offering help, you could filter the posts by category tag, e.g. in case if you are only interested in helping people to buy groceries. Not really necessary now for the limited set of available entries for a PLZ, but might be useful once there is more data :)

Based on existing entries, I would suggest the following categories to start with:

  • Einkauf
  • Babysitting
  • Arztbesuch
  • Andere

Phone Hotline – Umbrella-Issue

Phone Hotline
This is an umbrella issue to discuss technical and organizational aspects of how to implement a phone hotline. Please do not start implementing this feature until we've reached consensus about if and how we want to approach this topic.

With this being said, there are a few ideas and questions that we've discussed so far:

I'm happy to get all our peoples input on this!

Add counters

We collect two kinds of stats:

  1. How many people have registered as heros
  2. How many people have answered a specific request

We want to display those stats on the platform. There is already a design concept with three different versions, we need to pick one!

image

Important CSS classes and definitions are:

font-family: OpenSans;
font-size: 10px;
color: #87a544;
font-weight: bold;

Set requests to "fullfilled" instead of "deleted"

that shows when a person has been "helped"? Also then instead of deleting the message, people visiting could see how many people have been helped -- which makes it clear that the platform is "successful". Let me know what you think!

Onboarding dialog

We would love to have an onboarding dialog where people will be displayed a dialog when they first enter the page (independent from the entry url). This dialog should show the "important notifications" from the current front page.

The idea is that every new user sees our notifications for what to beware of when using the platform.

The dialog should be closable by clicking a button named "Verstanden".

Update Impressum

remove personal address and add

devize marketing GmbH
Chaussee Str. 13
10115 Berlin

Show error on no result

The FilteredList.js component should show an error if the search did not yield any results to inform the user that the search is completed.

Add login button

Add a login button in the header (i.e. next to press) and in the sidebar on mobile.

The login button should redirect users to /signup/:returnurl where :returnurl would for example be "notify-me" or "faq", i.e. whatever follows after https://quarantaenehelden.org/#/.

State Indication Button

currently the only option is to delete posts
a user should be able to flag posts as "resolved" to indicate a successful ending

Discuss and tighten eslint rules

In order for linting to pass for now I've disabled a couple of rules.

        "react/prop-types": "off",
        "react/destructuring-assignment": "off",
        "react/no-unescaped-entities": "off",
        "global-require": "off",
        "react/jsx-props-no-spreading": "off",
        "jsx-a11y/label-has-associated-control": "off",
        "prefer-destructuring": "off",
        "jsx-a11y/click-events-have-key-events": "off",
        "jsx-a11y/no-static-element-interactions": "off"

We should discuss which ones we want to turn back on and enable them and fix the code

Bug in sending mails to users by plz

Bei mir ist die erste Hilfesuche "in meiner Nähe" eingegangen. Ich lebe in München, die Anfrage kommt aus der Schweiz. Meine Postleitzahl ist 80335, die im Gesuch 8404.

Add end-to-end testing

I was thinking to add some end-to-end testing for our common flows through the platform. This would e.g. be from arriving on the page to signing up as a helper.

Something I had in mind which I think is worth checking out is https://www.cypress.io. I've never used this before but heard good things and from what it looks like it should be fairly easy to set up

Use react context api and/or hooks for user state

There are a few ways in which the current user logged in state could be improved in our codebase. Searching react firebase hooks or react firebase context will lead in the right direction and might help use discover some best practices in this regard.

I believe this might allow us to clean up the code base and hopefully have less of the flickering in the UI where some things are re-rendered because we check the user auth state in each view

Add rate limiting to posts

Idea:

  • A user can only have \d (2 for now) active posts at a time & coolDown + \d minutes
    Proposed implementation:
  • Frontend side check
  • Firebase function onAskForHelpCreate
    Things to note:
  • Possibly needs additional exceptions for specific accounts but out of scope for now

Map

To be documented

No emails received or emails delayed

It seems as if the signup emails are not received (potentially flagged as SPAM) by t-online mail.

We might need to improve our mail reputation (i.e. create SPF record, etc.)

Sendgrid redirect triggers thunderbird warning

(english thunderbird)

The link you just clicked seems to lead to another site than what the link text indicated. This is sometimes used for tracking whether you clicked the link, but it could also be a scam.

The link text indicated that the link would lead to www.quarantaenehelden.org, but it leads to (id).ct.sendgrid.net.

It could scare people away from clicking.

Typo on main

"Lokal" Section Haus Mitbewohner*innen > Haus-mitbewohner*innen

Security

Hi, I'm not too familiar with React and Firebase. Do those technologies prevent XSS or in other words, have you taken this into account?

Another question: Is there a limit to how many request someone can create? Otherwise malicious users could make your service a "Spam Bot" by creating dummy help requests and all registered people will receive emails.

Add a press page

We want to have a dedicated page where we can list notable press and social media mentions.
This task means that we need to

  • come up with a design for this page
  • compile an initial set of mentions from our marketing team
  • come up with a design on how to link this (navbar?, landing page?)
  • Implement in code

Timestamp sorting not working while searching

Filtered list should be sorted client-site if search is active.

Background: We can only sort by timestamp if we don't search in firebase. Hence, if the search flag is set, we need to do sorting locally.

Refine .gitignore

Extend gitignore to ignore more IDE-specific files.
Also check which other files make sense to be excluded.

Enable internationalization

Make app available in multiple languages, depending on the location of the user.

To be clarified: Should only the text be changed or should geofilters be applied.

Possible solution: One work stream for internationalization (text) and one for the data-related part.

Establish an arrow down button on the main page

Right now, the main page does not show the "Help"-Buttons. We should create an overlay "arrow" (similar to the one further down) that is tied to the screen bottom (unless one scrolls down) that visualizes that there is more content following.

Extension of /Presse

Add an extension to the bottom of the /Presse page to state "Und viele andere!"

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.