Giter Club home page Giter Club logo

howlongistheline.org's Introduction

How Long is the Line?

Where the world goes to see how long the line is.

Running locally

Install Meteor

curl https://install.meteor.com/ | sh

Clone repository

git clone https://github.com/howlongistheline/howlongistheline.org.git

Note: if you want to edit things and send a pull request you should fork this project on GitHub first and clone your fork instead of https://github.com/howlongistheline/howlongistheline.org.git.

Install Dependencies

meteor npm install

Run meteor

meteor run

Insert the database if running locally (never for production)

Run this from within the project directory while Meteor is running (it must be running to serve the local MongoDB instance):

cd ..
tar -xvf howlongistheline.org/mongodump.tar.gz
mongorestore -h 127.0.0.1 --port 3001 -d meteor dump/meteor

(You will need Mongo to be installed on your system).

If you already have the database but want to update it to the latest version, do a meteor reset from within the project directory before running the above, otherwise you will recieve duplicate key error errors.

Mongo errors

If Mongo exits with status 1:

  • Quick fix: export LC_ALL=C
  • Proper fix: something is wrong with your OS locales, good luck.

Meteor errors

If you do a git pull and Meteor doesn't start, the first thing to do is run meteor npm install as there may be package updates.

Contributing to howlongistheline

A cardinal sin that many open source developers make is to place themselves above others. "I founded this project thus my intellect is superior to that of others." It's immodest and rude, and usually inaccurate. The contribution policy we use at howlongistheline applies equally to everyone, without distinction.

The contribution policy we follow is the Collective Code Construction Contract (C4)

If you're wondering why any of the rules in the C4 are there, take a look at the line by line explanation of everything in the C4, this explains the rationale and history behind everything in the protocol and makes it easier to understand.

Step-by-step guide to sending a pull request

  1. Read the contribution protocol and the line by line explanation of the protocol.
  2. Fork this GitHub repository under your own GitHub account.
  3. Clone your fork locally on your development machine.
  4. Choose one problem to solve. If you aren't solving a problem that's already in the issue tracker you should describe the problem there (and your idea of the solution) first to see if anyone else has something to say about it (maybe someone is already working on a solution, or maybe you're doing somthing wrong).

It is important to claim the issue you want to work on so that others don't work on the same thing. Make a comment in the issue: I'm claiming this issue before you start working on the issue, even if it is your own.

If at some point you want to abandon the issue and let someone else have a go, let people know by commenting on the issue.

  1. Add the howlongistheline repository as an upstream source and pull any changes:
git remote add upstream https://github.com/howlongistheline/howlongistheline.org.git # only needs to be done once
git checkout master # just to make sure you're on the correct branch
git pull upstream master # this grabs any code that has changed, you want to be working on the latest 'version'
git push # update your remote fork with the changes you just pulled from upstream master
  1. Create a local branch on your machine git checkout -b branch_name (it's usually a good idea to call the branch something that describes the problem you are solving). Never develop on the master branch, as the master branch is exclusively used to accept incoming changes from upstream:master and you'll run into problems if you try to use it for anything else.
  2. Solve the problem in the absolute most simple and fastest possible way with the smallest number of changes humanly possible. Tell other people what you're doing by putting very clear and descriptive comments in your code every 2-3 lines.
    Add your name to the AUTHORS file so that you become a part owner of howlongistheline.
  3. Commit your changes to your own fork: Before you commit changes, you should check if you are working on the latest version (again). Go to the GitHub website and open your fork of howlongistheline, it should say This branch is even with howlongistheline:master.
    If not, you need to pull the latest changes from the upstream howlongistheline repository and replay your changes on top of the latest version:
git stash # save your work locally
git checkout master
git pull upstream master
git push
git checkout -b branch_name_stash
git stash pop # this will replay your work on the new local branch which is now fully up to date with the howlongistheline repository

Note: after running git stash pop you should run Meteor and look over your code again and check that everything still works as sometimes a file you worked on was changed in the meantime.

Now you can add your changes:

git add changed_file.js # repeat for each file you changed. If you use -A to add everything, make sure you have your IDE stuff and local linting config etc in .gitignore, as we don't want that in the repo.

And then commit your changes:

git commit -m 'problem: <70 characters describing the problem # do not close the '', press ENTER two (2) times
>
>solution: short description of how you solved the problem.' # Now you can close the ''. Be sure to mention the issue number if there is one (e.g. #6)    
git push //this will send your changes to _your_ fork on Github
  1. Go to your fork on GitHub and select the branch you just worked on. Click "pull request" to send a pull request back to the master branch of the howlongistheline repository.
  2. Send the pull request, be sure to mention the issue number with a # symbol at the front (e.g. #1014).
  3. Go back to the issue, and make a comment:
  Done in #(PR_NUMBER)

Your change will be pushed to production, usually within a few hours. Everyone can then test your solution and whoever opened the issue can close it if it solves the problem.

What happens after I send a pull request?

If your pull request contains a correct patch (read the C4) a maintainer will merge it. If you want to work on another problem while you are waiting for it to merge simply repeat the above steps starting at:

@: git checkout master

Tests

Tests are not yet implemented, feel free to add tests if you wish. This will prevent others from breaking your changes later.

License

The license and contribution policy are two halves of the same puzzle. This project is licensed under the MPL v2.0 license. The code is owned (and Copyright) by all contributors. Contributors are listed in the AUTHORS file. Please add your name to the end of this file in your first pull request so that you also become an owner.

This license ensures that:

  1. Contributors to howlongistheline cannot have their code stolen and used by closed-source projects without their permission. It's very common for corporate software merchants to steal code from open source projects and use it in their closed source or even patented products and services in direct competition with the original project. For example, anyone who contributes code to a project released under a BSD/MIT style license effectively has no rights to their own code or any improvements made upon it.
  2. Anyone using any code from howlongistheline must also share their work under a share-alike license so that anyone else can use their improvements.
  3. No one can change the above, without explicit written permission from all contributors, which is practically impossible to get. That means even the founder of this project cannot ever relicense and sell howlongistheline or its code. It belongs to everyone who contributed to it (and it always will).

It is not permissible to use any code from this codebase in anything that isn't using a share-alike license. Violations of the license will absolutely not be tolerated, and the terms of this license will be enforced through a variety of very creative methods leaving the perpetrator in a state of deep regret.

howlongistheline.org's People

Contributors

akatrodiya avatar dependabot[bot] avatar gsovereignty avatar gurubobnz avatar ioioio8888 avatar jimkleine avatar madanbhandari avatar olliechick avatar steadylearner avatar success-master avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

howlongistheline.org's Issues

problem: some people add duplicate stores

problem: some people add duplicate stores because they don't notice that their store is already there.

solution: if the user is within 100 meters of an existing store, ask them the existing listing is the right one.

suggestion: ability to mark stores as favorites

Great work, thanks for being the person who did something useful with an idea!

I'd love the ability to mark a few stores as favorites. To continue with the concept of not using logins, the favourite information can be stored in a cookie.

You would then need a way of doing something with the favourite info, such as making the favorites appear at the top of the list on first-open/if no location was searched for, or a tab/toggle to just show favourites.

Keep up the good work!

problem: project structure is difficult to understand

Problem: project structure needs to improve
For example - in ui directory, pages and layout are in same directory.

Solution: we can update file structure and code structure to better understanding. also we can divide components in to separate files, so it can be reusable.
Also we can move client and server startup parts in imports.

problem: not all members are public

problem: not all members are public

This is a personal choice but it's usually a good idea for members of the github organisation public. It sets the tone for an open culture as more people start getting involved.

You can make yourself public by going to https://github.com/orgs/howlongistheline/people and changing the setting next to your name to public.

Anyone who contributes to the project should be invited to become a member of the organisation as it makes certain things easier (increased privileges etc). You can also see any pending invitations here: https://github.com/orgs/howlongistheline/people/pending_invitations

ping
@olliechick
@jimkleine
@ioioio8888

problem: stores added in wrong location

problem: some people are adding stores in the wrong location.

solution: when a user tries to update the line status but a location failure occurs, allow them to change the store coordinates to their current location.

problem: DOM is getting overloaded with too many objects

The search field is becoming laggy, even on relatively capable devices e.g. iPad Air. Possibly related to:

  1. An increasing number of stores in the DB vs the current Search bar behaviour of incrementally filtering candidates as you type (I'm seeing a lag in character display in the search bar); or

  2. More client processing of live status updates during filtering (is the slider UI more intensive in this regard? Could status updates be deferred during active filtering?)

problem: "Getting your location" pane doesn't auto-hide if location services are not available

If location services are not enabled (or the browser's Share location? Request is denied), a pop-up appears ("Cant get the location ..."; message is missing the apostrophe). That behaviour is working correctly, but the animated "Getting your location" should hide itself at that point.

solution: Auto-hide "Getting your location" pane if location services are not available.

problem: not showing exact numbers in line slider

problem: not showing exact numbers in line slider, while updating or done any movements on slider, it showing number of people after page refresh.

Solution: when need to change line, need to show slider position (in tooltip), with what will be result after updating.

problem: fetching geolocation can be very slow

problem: fetching geolocation can be very slow

After submitting the data to add a new shop, the geolocation can take a long time.

Solution: fetch the location using async upon loading the route. Use await to show the user that the browser is trying to find their location in the background.

problem: users can't upload pictures

problem: users can't upload pictures when updating the status.

solution: implement optional image upload on the status update view and use filestack.com (or whatever) to serve the images so that the server instance doesn't need to store any data.

enhancement: Reconsider text of line state labels

  1. One class of people best placed to keep the line status regularly updated is the door security folks, however the current "busy" status of "Busy. Stay Home." might not be acceptable for store staff to select (the "Stay Home" part).
  2. While trying to update line statuses today, I was offered two different criteria at two different stores (one said more than six; the other said more than 20). We should be clear how long the queue potentially is for people, so they can make an informed decision about whether they will wait e.g. Busy (>6) or Busy (>20), or even a fourth status of Very Busy (>20) (much beyond this gets difficult to count with a queue that may be moving).
  3. This factors into the store "size" problem. Of the two similar-sized queues at two supermarkets I observed this afternoon, one was moving significantly faster than the other. Curiously, the faster moving queue was at the smaller of the two stores. The critical element for shoppers is how long the wait time is, not necessarily the number of people in the queue, but we are currently using the latter as a proxy for the former.

problem: people can't show off their update stats

problem: people want to show off their additions and update stats

solution: implement user accounts so that stats can be tracked, create a basic profile page and profile ranking (based on additions and updates).

problem: many coordinates are wrong

problem: many coordinates are wrong (added incorrectly). This prevents other users from updating the status.

solution: instead of the toaster notification, send users to a view with:

Error: are you really at this location? It appears that either you are not at the shop, or we have the wrong coordinates for the shop.

If you are not at this shop right now: ask your friends on facebook etc to update this shop for you whenever they go.

If you are at this shop right now, please tap to reset the location.

Set the coordinates to the users coordinates, and append the existing coordinates to historical data.

When checking the users location matches the store, check historical coordinates too, and if any are a match let them update it.

problem: lines move at different speeds

problem: lines move at different speeds and this makes the same line numbers mean different things at different stores.

solution: allow users to add the number of checkouts available in store.

problem: search bar UI looks like an error

  1. There is a typo in the "location" bar: "getting your location" should probably be "Getting your location ..."
  2. The Search bar shouldn't have a red background colour: red should be reserved for errors etc.
    I appreciate that this is to highlight the search bar, but coloured backgrounds in text boxes can also present contrast issues that result in a need to "invert" the text colour e.g. white on blue etc. Would a coloured border be better? Some look and feel examples here: https://mdbootstrap.com/docs/jquery/forms/search/

Minor Home Screen Typos etc

problem: Unable to update queue status when actually at the store: "Are you really at this store?"

I visited 4 local supermarkets (I'm a cyclist) this afternoon to update queues, add new stores and hand out posters to the door security staff. Using Firefox on Android. I was able to add two stores without issue (GetFresh Mangere and Countdown Mangere Town Centre), but I was refused access to update the queue status at the two existing stores (Pak n Save Mangere and Countdown Auckland Airport) "Are you really at this store?". I recorded decimal GPS locations for each of the two stores so that we can identify whether this is a bad data or a location logic problem:

  1. Pak N Save Mangere: -36.96827783, 174.79745184
  2. Countdown Auckland Airport: -36.99765505, 174.78860649

Non-Code: Draft Guidance Facebook - How to Add a Shop

How to Add a Shop 101

  1. Stay safe –
    a. Wear a mask or homemade face covering if you are going out on foot. The science is in on masks they serve as a barrier to virus transmission.
    b. You can add shops from the relative safety of your car – so don’t be afraid to drive up close to the entry in a loading zone to add the store. This should take a minute or two not much longer so you likely won’t have to worry about loading zone concerns.

  2. Check to ensure your GPS on your browsers is enabled – this is usually in the privacy settings.

  3. Only add shops if you are physically there – check the maps application on your phone google maps or apple maps to ensure that your device is pinging directly at the store.
    a. Sometimes this may require a bit of patience depending on your signal and connection quality.
    b. Copy and paste the address of the shop from your maps tool and load it into the table below the shop name on the shop submission page.

  4. The app is programmed to detect around 100 meters of wherever the shop is added from.
    a. This means if someone has added the shop from the other side of the parking lot – that original upload point is what is captured as the shop. So please add locations as close to the main door as possible.

problem: stores do not have opening hours

problem: stores do not have opening hours and there's no status for "store closed".

solution: allow people to add opening hours, get store time zone from location coordinates

problem: there are many duplicate stores

problem: there are many duplicate stores

solution: allow users to remove duplicate stores:

  1. add a button to the card rendered for each store "this is a duplicate" or something
  2. create a new view where users can select all the other store objects that are referring to the same location (all the duplicates)
  3. Take all the data (name, address, coordinates) from all the duplicates. Ask the user which data is best, and combine these into a new object. So, which name is best, which address is best, and which coordinates are best (show a map for each, use openstreetmap).
  4. archive all the duplicates into the archived collection.

problem: Visual traffic light hints are missing from new slider queue UI

The old UI coloured the queue status green/orange/red for a quick visual indication. I'm aware we are making somewhat arbitrary choices re queue depth at this point, but 0 should be green, 50+ should be red and we need to nominate "breakpoints" for green/orange and orange/red boundaries.

solution: Colour the queue description text ("There were nn people in line ...") and or slider control (the latter might be more tricky, since it is an interactive control).

Problem: users cannot add the address for a new location

Problem: users cannot add the address for a new location

solution: provide an option for users to add a new location (related to #5) if the location they are currently at is not listed. Ask them to paste in the full official address given on the store's website or google maps.

problem: some stores have different capacity to others

problem: some stores have different capacity to others so the lines move at different speeds.

possible solution: add a capacity metric and allow users to add more fine grained details to now many people are in line

problem: search not implemented on /nearme

problem: search not implemented on /nearme

/nearme is a new view to refine all the good stuff from Index.jsx and also implement a new way of fetching data from mongodb (there are too many objects to just send everything to the client now).

This is intended to replace Index.jsx as the / route when all the bugs are gone.

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.