Giter Club home page Giter Club logo

woeip's Introduction

West Oakland Air Quality Project (WOAQ) TravisCI Codecov Code style: black

This project is idle. Please reach out to OpenOakland if you would like to learn more.


West Oakland Air Quality (WOAQ) aims to help West Oaklanders fight for better air by making their local air quality data more accessible and meaningful, and providing the digital advocacy tools needed to drive change in their neighborhood.

WOAQ is an OpenOakland project, co-created with the West Oakland Environmental Indicators Project (WOEIP), a community-based environmental justice organization that has been collecting air quality data for over a decade. WOEIP is dedicated to achieving healthy homes, healthy jobs and healthy neighborhoods for all who live, work, learn and play in West Oakland, California.

Readme contents

Code of conduct and values

To participate in this project, we ask you to abide by the OpenOakland Code of Conduct, and honor the 17 Principles of Environmental Justice.

Quickstart for developers and designers

Once you download the WOAP codebase from GitHub, there are two methods to allow you to run the application locally in your browser.

Node.js

The code you download from GitHub does not contain the Node.js libraries needed to run the site locally. You can install Node.js if you don't already have it installed and then run a command to get the needed Node.js libraries. This method allows you to run the front-end but does not install the back-end database. With this method, you can make and submit front-end edits to the project, but you won't be able to upload GPS and datalogger files nor see these data on the map. This is a good method for designers and folks with computers with 4GB or less of available memory.

Docker

Alternatively, you can install Docker which allows creation of virtual machine instances within your computer configured to run the app. Running the Docker configuration files in the WOAP codebase, all four needed instances are created -- the front-end and Node libraries, the database back-end, the API, and the proxy to manage all the connections between them -- allowing you to use the application locally as if you were using it in production, and to make and submit edits to the project. Docker uses more active memory (4GB typically) and disk space (60GB) than running the app with Node.js only. See the Docker requirements for Mac or Windows for more information.

Getting the project code

The starting point for either of the two install methods is to get the current WOAQ project code.

git clone https://github.com/openoakland/woeip.git
cd woeip

This will pull in the current project code from the develop branch and bring you into the installed directory, setting it up with git to allow you to manage versions, push edits, etc.

Next, to start the app, use either Method 1 or Method 2 to get the project running locally.

Starting the app locally with NPM (Method 1)

The current recommendation to avoid compatibilty issues is to use Node.js version 16.14.0. Check to see if already have it installed.

node --version
  • If you get no response, Node.js is not yet on your system; see Node Downloads to download and install Node.js and the Node Package Manager (NPM).
  • If you get a number lower than 16.14.0, please upgrade to the version recommended for our project: nvm install 16.14.0
  • If you get a number higher than 16.14.0, you may wish to switch to this version: nvm use 16.14.0 See above to install if necessary.
  • If you get a response of 16.14.0, you have the correct version of Node.js and NPM installed; continue below.

Once Node.js and NPM are installed, simply do the following to go to the ..\web front-end directory, install all the needed libraries the app requires as listed in package.json, and then open up the app in a web browser locally with a script also defined in package.json

cd web
npm install
npm run start

Your browser should now open, navigating to the app running at http://localhost:3000/. Note that you won't be able to upload data files to the app or see them mapped, but you can see and interact with the front-end. You can now skip down to the section To update the front-end locally to learn about making and submitting changes to the code. See also the section Contributing as a non-developer if preferred.

Starting the app locally with Docker (Method 2)

Install Docker, if needed, then issue the Docker command while in the woeip directory to build the four instances needed to create the app.

docker-compose up -d --build

All the images will start downloading and the containers will start automatically. When complete, you can browse to http://localhost:3000/ to see the running app.

Go to the http://localhost:3000/upload page to upload a pair of data files that you can then view in the map. Load data files from one of the dated folders within the AQ Join Data folder in the WOAQ Google Drive collection. Load a *.csv and a *.log file. Note the date of the collection and then click Save. The Map page should then open showing your loaded data, or use the calendar interface to switch to the date of your uploaded collection.

With Docker Dashboard, you can start and stop the instances as needed. With any restart of the instances, you'll need to load data files again to see them on the map.

To update the front-end locally

After using either of the above two methods to install the code, you can make edits by the following method.

Create and check out new branch based on an existing branch

git status
git checkout {existing-branch, e.g. develop}
git pull origin develop
git checkout -b {new-branch-name}

Navigate to front-end directory

cd {directory path, e.g. web/src}

In text editor

Make desired changes to files in /src folder

Stage, commit and push changes

git add .

Don't forget that period!

git commit -m "{message text}"
git push origin {new-branch-name}

Open pull request (PR) in WOEIP repo

Go to https://github.com/openoakland/woeip/pulls. Create a new pull request to ask that your code be incorporated into the general codebase. Be sure to include a request for review from team member(s).

To access the back-end database

Please refer to the database schema (1/8/2020)

If you have Docker installed and have the WOAQ instances running, you can do the following to access the Postgres database.

docker-compose exec db bash enters the docker container, a mini-linux machine

psql -U postgres logs in to the database that is running on the mini-linux machine

\c woaq enters the woaq database

\dn list all schemas

\dt list all tables

Run any needed SQL commands here, like

SELECT * from air_quality_device;

\q to quit postgres database

exit to exit container and get back to shell

Services

Domains

With Docker installed and WOAP instances running, you can now open your web browser and access the services at the following lvh domains:

Front-end

Back-end

Code Quality Checks

Follow testing and linting instructions in the Pull Request Template

Contributing as a non-developer

Design & research options


We use Trello for project management (note that after February 2022, this may change):

  • Review and add a comment to any light blue “Design & Research” card currently sitting in the In QA column. Or;
  • Grab any card tagged with the light blue “Design & Research” label in the Ready to Work On column and get started.

Data science/analysis options


We use Trello to document and discuss data decisions (note that after February 2022, this may change):

  • Review and add a comment to any yellow “Data Q” card currently sitting in the Qs About Data Analysis column. Or;
  • Add a new yellow “Data Q” card to the Qs About Data Analysis column for any new questions you think of that might be important to answer.

Project documentation


Contact

Reporting security issues

Please do not report security issues in public. Instead, send an email to the WOAQ team at [email protected]. Or reach out via the #woaq Slack channel (complete this form for access).

License

MIT

woeip's People

Contributors

ajay-vishwanath avatar brooksjessup avatar clintonb avatar dabryant11 avatar dependabot[bot] avatar ethan-bradley avatar exchrotek avatar gsehrlich avatar ifed3 avatar jayqi avatar joshling1919 avatar kbrdsk avatar kiwisquash avatar mnorelli avatar nbilenko avatar ontoneio avatar r-b-g-b avatar sribbleinc avatar tangoyankee avatar temidayo32 avatar theecrit avatar wendy-wm-wu 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

Watchers

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

woeip's Issues

Forms Testing

Is your feature request related to a problem? Please describe.
Forms Testing

Describe the solution you'd like
Create test cases to validate design of Forms meet intended use cases

Additional context

  • Before beginning this task, the design of the forms must be finalized
  • Addressed in PR #57

Django Forms Testing Documentation

As a user, I'd like site pages to follow a consistent grid so it's easier to navigate.

Is your feature request related to a problem? Please describe.
Currently, certain views (specifically "Add Data") do not conform to a grid layout that matches other views.

Describe the solution you'd like
For a Foundation-based grid to be applied to all views consistently as appropriate.

Describe alternatives you've considered
Non-grid based layouts introduce inconsistencies, introducing cognitive load for the user and making the site harder to use.

Additional context
Screen Shot 2019-05-14 at 4 54 16 PM
Screen Shot 2019-05-14 at 4 54 24 PM

For Developers

Affected Components
TBD

Technical Resources
TBD

Design Documentation
TBD

Testing Outline
TBD

file page

Description

Create a file page where users upload dustrak and gps data files, which are joined together and saved.

Pieces:

  • A form which accepts
    • dustrak file
    • gps file
    • user data
  • A url which holds the path to the upload page
  • Templates
    • A base template that holds the meta, head, and body tags
    • An upload template which interfaces with the form
  • A view to hold the logic for the file page
  • Authentication, to prevent everyone from uploading a file
  • An indication of whether a user is authenticated
  • Messages
    • Successful upload
    • Access denied
    • Failure to upload

Note

We do not need a home page or a login screen. For now, users can manage their accounts and logins through the Django Admin page. Also, there can be a simple indicator on the page as to whether the user is authenticated.

As a user, I want to login with my email address

Is your feature request related to a problem? Please describe.
Remembering an additional username can feel cumbersome. I would like to sign in with my email.

Describe the solution you'd like
Email to be the primary user account information

Describe alternatives you've considered
A username as the primary login method.

Additional context
TBD

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add additional labels as needed

For Developers

Affected Components
User models

Technical Resources
Will Vincent: Email Login Tutorial

Design Documentation
Wireframes or other design resources

Testing Requirements

As a user, I want to upload a pair of files via an easy interface

Is your feature request related to a problem? Please describe.
The current interface depends on clicking on a button, which opens up file explorer. I would like to already have my location open and then drag the files onto the page.

Describe the solution you'd like

  1. Upon navigating to the add data/upload page, I should see an area where I can drag and drop files.
  2. In its initial state, the box should let me know that I can drag my gps and dustrak files into the drop box
  3. When dragging the files, if I hover for a few seconds, the page should instruct me to let go of the mouse to drop the files
  4. As the files are uploaded, I should receive feedback that the files are being processed
  5. If there is an error in the upload process, I should receive feedback for the following cases:
    • The incorrect number of files were uploaded (too many or too few)
    • The incorrect combination of files were uploaded (not one csv and one gps file)
    • General error message
  6. There will still be a button that can optionally be used to upload the files
  7. The upload process should be triggered automatically- once two files of the correct type are identified

Describe alternatives you've considered
We are replacing the current style where the upload button is the only option

Additional context

  1. In the wireframes, there is a need help button. This button will be saved for later iterations.
  2. There is an additional error state, in which the dates of the gps and dustrak files don't match. As this demands parsing through the files, it will be reserved for another issue.

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add additional labels as needed

For Developers

Affected Components
The entire upload page will require a view, form, and template. However, this issue should be limited to the user interface build in javascript, on top of the other parts. For this issue, the affected components are:

  • upload.html
  • app.js

Technical Resources
This issue is dependent on issue # , which establishes the view, form, url, and template on which the interface is built.

Possible framework: jQuery-File-Upload

Precedents and Tutorials:
Mozilla Developer Resource
Multiple File Upload tutorial
Multiple FIles Tutorial Source Code
Django Files Tutorial
JQuery File Upload Sample

Design Documentation
Wireframes V3

Bug: Log File

Describe the bug
Log File is not being generated when logging to file is enabled

To Reproduce

  • Within docker-compose.local.yml, under app -> environment, create the variable ENABLE_LOGGING_TO_FILE and set it to True

Expected behavior

  • The expected behavior was that an app.log file would be created and populated with a known error

Desktop:

  • OS: Ubuntu 18.04.2

Additional context
I am using the Docker Container for development

I changed Line 202 of settings.py to /app/woeip/app.log, to follow a path used by the Docker container. This created the expected behavior.

It may be an issue related to line 179 of settings.py... 'filename': environ.Path(LOG_FILE_PATH).path(filename)

Manage the django sites domain

Is your feature request related to a problem? Please describe.
Django has a domain variable, set when using the sites framework. By default, it is set to example.com. When sending password reset emails, the email template references the domain variable. It needs to be set, so that users are directed to the correct domain.

Describe the solution you'd like
Configure the site values to easily change between [local]:[port] for testing and woaq.org for production

Describe alternatives you've considered
Keeping the domain variables hard-coded in all their references

Additional context
The domain in the password_reset_email.html is currently hard-coded with localhost:8080. It will need be changed to woaq.org

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add additional labels as needed

For Developers

Affected Components

  • settings.py
  • password_reset_email.html domain
  • See also #116

Technical Resources
Sites framework

Design Documentation
Wireframes or other design resources

Testing Outline
Describe the testing methods appropriate for this feature

docker compose environment

Description

Development credentials for AWS and future services should be managed in a convenient location, hidden from version control

Proposed solution

  1. .gitignore web-variables.env
  2. create web-variables.env.example, which is tracked by git
  3. make web-variables.env.example a template where developers simply need to insert their credentials
  4. instruct developers to create a web-variables.env from web-varibles.env.example
  5. insert private credentials into untracked web-variables.env
  6. set env_file to web-variables.env

As a developer I want to be able to designate which tests should be run as part of acceptance criteria for a given issue

Is your feature request related to a problem? Please describe.
We'd like to implement a consistent principle of testing your own code, by designating which tests should be run at the time an issue is created. This ensures the tests are identified as part of Issue definition and serves as a reminder to test for whoever chooses to implement the Issue.

Describe the solution you'd like
As a developer, I'd like to have a place in the New Issue template to add the specific tests that should be run as part of acceptance criteria.

Describe alternatives you've considered
Hoping the developer runs appropriate tests is likely to cause delays/blockages.

Additional context
n/a

Labels

For Developers

Affected Components
Contributing.md
issues template for features

Technical Resources
Add links to appropriate documentation. Describe possible code implementations.

Design Documentation
n/a

As a user, I need to manage my password (1/2)

Is your feature request related to a problem? Please describe.
An ability to reset forgotten password. There is also a need to change the password originally set by the developer that created the account.

Describe the solution you'd like
Reset the password using the default django forms and email workflow

Describe alternatives you've considered
A magic login link. This flow is not as well established and not supported from django, "out of the box"

Additional context
Will require an integration with an email server. This is the second issue associated with password reset. This issue will send "emails" to a folder.

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add additional labels as needed

For Developers

Affected Components

  • html templates
  • urls
  • account from which to send email

Technical Resources
Will Vincent Tutorial
Simple is better than complex tutorial
Django Send Email
Django Auth Documentation

Design Documentation

  • Grid structuring of elements, similar to signin page
  • Stock Foundation styling
  • Stock Django templates and views

Testing Outline

  • Using stock Django. Minimal integration testing required.

As a user, I want to upload air quality and location data to the website

Is your feature request related to a problem? Please describe.
After collecting air quality data, I would like to upload it to WOAQ to be stored.

Describe the solution you'd like
I will have two files:

  1. A csv file which contains air quality measurements taken by a dustrak sensor
  2. A log file which contains GPS location data taken by a ....gps?... @theecrit, what's the device?

As a signed in user, I can navigate to an upload/add data page. On this page, there is a button find files on my computer. Clicking this button will open a file explorer where I can select the correct files. I will receive feedback on whether the process was a success. If it was a failure, I will be told and given another chance.

Describe alternatives you've considered
Previous version had numerous fields on the form, each for a different value. However, having the user input each value is considered too tedious. It may even be overwhelming to ask so many questions. This method is preferred because the data will be parsed automatically.

Additional context
This issue is a prerequisite for issue #31. It provides the backed structure to the upload process.
In reference to the wireframes, it does not achieve the drag and drop functionality. However, it should achieve the find files on my computer functionality. Issue #63 depends on this process. It will be passed the URIs of the files in the S3 bucket.

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add additional labels as needed

For Developers

Affected Components

  • form for upload
  • view for upload
  • template for upload

Technical Resources
Django Forms
Django Messages Framework
Multiple File Upload tutorial
Multiple FIles Tutorial Source Code
Django Files Tutorial

Design Documentation
Wireframes V3

  • Input for this issue: the two user-uploaded files
  • Data processing in this issue: store the data files in the S3 bucket
  • Output for this issue:
    • On success: generate uris to the locations of the files in the S3 bucket. Later, these uris will be passed to data verification view (issue #63) for processing
    • On failure: generate as specific of an error message as possible, and return to the add data view. These error messages and their handling can be later refined as the javascript is added in issue #31.

As a developer, I would like to send emails programmatically to reset user passwords (2/2)

Is your feature request related to a problem? Please describe.
Users will be sent emails to with email reset passwords

Describe the solution you'd like
These emails should be sent with a service, such as SendGrid, MailGun or Mandrill.

Additional context
This is the second issue related to password reset. The first issue implements a development backend to store emails in a local folder. This issue implements a production-ready email service

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add additional labels as needed

For Developers

Affected Components

  • settings.py email service
  • password management for woaq email account

Technical Resources

  • Email service tutorial using SendGrid
  • Mailgun is being used for some existing OO projects, though not tied to an official OO account. While we do have a [email protected] email that can be used to create a Mailgun (or SendGrid et al) account, OpenOakland would prefer to keep services centralized if possible. That means using [email protected] to set up any new accounts for this. That email goes to members of the steering comimittee; if email access is needed to verify a new account or whatnot, contact Tom Dooner (@tdooner), Mike Ubell (@mikeubell), or Alison Lawyer (@anlawyer). If this ends up being a blocker, we may need to switch to using the [email protected] address.

Design Documentation
Wireframes or other design resources

Testing Outline
Describe the testing methods appropriate for this feature

Styling and Accessibility for Verification Page (3/3)

Is your feature request related to a problem? Please describe.
A page where users can view, verify, and edit the meta data that was automatically generated for the session.

Describe the solution you'd like
The user should be brought to a page where they are presented with a form, pre-filled with data. The user can change the values of the data in the fields. The user can either save the data or cancel the upload. Saving progresses to the session view page. Canceling returns the user to the upload page.

Describe alternatives you've considered
Manually entering all fields, when initially uploading data.

Additional context
This issue is only a basic, first pass at accessibility and responsive design

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add additional labels as needed

For Developers

Affected Components
This issue is one of three dealing with the verification page. The three issues will create a skeleton of the necessary components, fill the skeleton with data from the S3 bucket and Staging Table or handle errors, and finally add styling & accessibility to the page.

This issue adds responsive styling and basic accessibility to the page:

  • HTML template (tagging and linking tags to style classes)
  • app.css (Referenced in a way that localizes the changes)
  • app.js

Technical Resources
Django Templating Style

Design Documentation
WOAQ Approach to Accessibiliy
Wireframes

Testing
To be determined

Update WOEIP descriptions in README

Is your feature request related to a problem? Please describe.
The current description of WOEIP and its activities aren't necessarily accurate, and haven't been vetted by WOEIP.

Describe the solution you'd like

  • Under Organizations:

Replace

West Oakland Environmental Indicators Project (WOEIP) is an environmental justice nonprofit. Their mission is to help residents understand and influence the political and natural forces which impact their lives. WOEIP's overall goal is to empower West Oakland residents to revitalize the environment and economy of their neighborhood.

with

The West Oakland Environmental Indicators Project is a resident led, community-based environmental justice organization dedicated to achieving healthy homes, healthy jobs and healthy neighborhoods for all who live, work, learn and play in West Oakland, California. Through our Community-Based Participatory Research projects and our Collaborative Problem-Solving Model we build community empowerment and help local residents to achieve their own vision for healthy neighborhoods.

(pulled from WOEIP website; pending confirmation from Brian).

  • Under Project Description:

replace

The current AQ database is difficult to interact with and manage.

with

The original AQ database is no longer accessible to WOEIP, leaving them without access to collected data. As a result, they've suspended their citizen scientist data collection program.

Describe alternatives you've considered
n/a

Additional context
It's important that we allow our project partners to speak with their own voice, and are intentional about considering this when writing or speaking about them.

For Developers

Affected Components
README.rst

Technical Resources
Add links to appropriate documentation. Describe possible code implementations.

Design Documentation
n/a

Edited to increase readability by swapping quotation marks with block quotes.

Footer

Is your feature request related to a problem? Please describe.
A footer which navigates to external websites

Describe the solution you'd like

  • It should contain links to the websites of affiliated websites, displayed only with text (no logos)
  • It should respond to screen size

Describe alternatives you've considered
Considered using logos. However, this may confuse some users as to where the links go.

Additional context
The footer should be easy to read. It should be clear to the user what clicking on a link will do.

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add additional labels as needed

For Developers

Affected Components

  • File Structure:
    • file dedicated to the footer, labeled _footer.html
    • file is located in the includes folder
    • _footer.html is "included" in the __base.html file, just above the javascript <script> tags

Technical Resources
Video on responsive footers built with Zurb

Design Documentation

  • Look and Behavior:

    • The footer should be thin
    • It should sticky to the bottom, when the page content is too short to fill the whole page
    • It should be pushed to the bottom of the page, and off screen, when the page content goes beyond the screen size
    • On wide screens, such as laptops and landscape oriented phones, the text should be inline horizontally.
    • On narrow screens, such as portrait-oriented phones, the text should stack vertically
  • Follow Figma Parent File Styling -TY 12 Aug 2020

  • The displayed text and associated links are:

    • WOEIP, https://www.woeip.org/
    • OpenOakland, https://openoakland.org/
    • GitHub, https://github.com/openoakland/woeip
  • Wireframes
    WOAQ-wires-footer-20190326.pdf

As a WOAQ team member, I want to understand our approach to accessibility

Is your feature request related to a problem? Please describe.
When building a community-based tool intended to serve underrepresented populations, a11y becomes a fundamental issue of equity.

Describe the solution you'd like
A documented set of design principles that define our approach to and process for building an accessible solution. It should outline:

  • Core principles.
  • What standards/best practices we'll implement (I'd like to see us shoot for WCAG 2.1 AA, with fallback baseline when that's not possible).
  • A guide or checklist for implementing specific requirements within any given Issue/design that respects the iterative approach to our work.

Describe alternatives you've considered
Foundation's out-of-the-box "accessibility" is known to place the onus on the programmer, resulting in code that often doesn't meet best practice standards.

Additional context
While HTML and css implementation cover many a11y issues, best practices go well beyond that and impact UX and content, as well as code structure. Section 508 requires WCAG 2.0 compliance. However, CA law also requires compliance with “Web Content Accessibility Guidelines 2.0, or a subsequent version” (at the AA level)source. WCAG 2.1 was released mid-2018 and is additive to 2.0, to account for many digital realities not originally accounted for in 2.0. All of it is in service of four core principles: making the product perceivable, operable, understandable, and robust.

Because this may be prohibitive for an MVP launch, it’s worth proactively coming up with a plan to reach some baseline standards. I’m looking into whether C4A has any specific standards, but in the meantime there are lots of great resources out there to help us.

Technical Resources

As a user, I want to be able to sign into my account.

This issue covers the following features/flows

  • Account sign-in user interface (html template and CSS/JS styling)
    • Backend is already handled by Django built-in functionality
  • Account creation
    • "Account creation" should be changed to read "contact [insert email address] to request an account"
    • It should be plain text, rather than a hyperlink
  • Password hide/reveal
    • See note below

Not in this issue's scope*

  • Password reset / Forgot Password link
  • Footer
  • Visit WOEIP link

Notes on "Sign In" button

  • Ignore the "inactive state" in the wireframes.

Notes on password hide/reveal

  • Password field on sign-in form to default to obscuring the characters as they're entered.
  • Visual indicator/toggle to reveal characters (either eye icon right-aligned within input field, or a text label reading "Show", that changes to "Hide" on reveal).

Additional context
n/a
Edit: This is an enhancement to the built-in Django Form. - Tim

For Developers

Affected Components
The login template and any CSS and/or JS needed to style it

Technical Resources
Django Forms will need to be modified with css classes from Foundation
Zurb Foundation Show Password
W3 Schools Javascript Simple Reveal

Design Documentation
WOAQ-Wires-PasswordReveal-20180326.pdf

As a developer, I want to know which accessibility elements need to be implemented

Description

The WOAQ team is currently developing a set of accessibility guidelines. In the meantime, we want to make sure the tool is at least accessible to screen readers. This issue should cover putting together a draft set of minimum accessibility recommendations for an MVP launch.

Tasks to consider including

  • Attach aria-label to all buttons without explicit label to make them accessible to screen readers.
  • Keyboard shortcuts and tab orders
  • Contrast rules
  • ???

Affected Components

  • html files
  • API?
  • ??

Technical Resources

Design Documentation

Testing Outline

  • Run through common tasks on Windows OS, using: Jaws and Internet Explorer, and NVDA and Firefox.
  • Run through common tasks on iOS (mobile) using Voiceover.

Acceptance Criteria

  • [ ]

Organize technical instructions

Is your feature request related to a problem? Please describe.
The technical instructions in the README/contributing docs is a bit disorganized.

Describe the solution you'd like
README should contain enough for a moderately-experienced developer to go from cloning the repo to running the site locally.

Less experienced developers might want more detailed instruction, (links to git, docker, django tutorials). I suggest this go in the Code Development section of contributing.md. If even more detail is needed, we can make separate markdown documents, linked in contributing.md.

Added from Issue 61
The Getting Started section of the readme could be made more user-friendly by adding the following steps:

  • After make local.up, run make local.shell. Add ./manage.py createsuperuser to add in a username/password.
  • Go to localhost:8080 to access the site. Login with the username/password created above.

Labels

  • Add a status label
  • Add additional labels as needed

`make docker.build` fails

Describe the bug
Running make docker.build gives the following error:

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages 404 Not Found

To Reproduce
Steps to reproduce the behavior:

  1. Go to the local copy of the git repository on terminal
  2. Run make docker.build
  3. See the error, be sad

Screenshots
Screen Shot 2019-03-26 at 4 26 03 PM

Desktop (please complete the following information):

  • OS: macOS 10.14.4

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add a bug label
  • Add additional labels as needed

Use Session as foreign key to Data

A key design consideration for the database was to have each sample in a separate row of the Data table. An hour session sampled at 1 Hz would have 3600 rows then. 1000 of those sessions would need 3,600,000 rows. To avoid getting too big Data shouldn't have too many columns. It should also probably not have any many-to-many fields, since they would lead to very large bridging tables. Currently, Data is very lean: aside from the essential lat, lon, time, and value fields, it only has a single additional foreign key column to link it to the rest of the database, the SessionData model. SessionData contains the raw data file.

But Data rows can result from two raw data files -- e.g., air quality data coming from the Dustrak csv and the GPS location coming from a separate GPS log. My imperfect solution was to only link each Data row to the air quality measurement SessionData, conveniently forgetting about the GPS raw data file. Not great. Of course, you could always query other SessionData from that Session to find it, but this isn't perfect either, since there could be other unrelated SessionData entries.

@nbilenko made a suggestion that I hadn't considered, which is to use Session as the foreign key to Data. Now the database relationship looks like this:

Session A --------Data (lat=123.2943, lon=37.1334, value=0.3, session="Session A")
           \------SessionData (upload=dustrak.csv, sensor=<an air quality sensor>, session="Session A") 
            \-----SessionData (upload=gps.log, sensor=<a gps sensor>, session="Session A")

This will mean that a separate Session should exist for each "stream" of data. That is, if a participant walks around collecting two kinds of air quality measurements simultaneously, they will need to make two separate Session entries, which I think is fine.

Skeleton for verification page of metadata (1/3)

Is your feature request related to a problem? Please describe.
A page where users can view, verify, and edit the meta data that was automatically generated for the session.

Describe the solution you'd like
The user should be brought to a page where they are presented with a form, pre-filled with data. The user can change the values of the data in the fields. The user can either save the data or cancel the upload. Saving progresses to the session view page. Canceling returns the user to the upload page.

Login is required for this view

Describe alternatives you've considered
Manually entering all fields, when initially uploading data.

Additional context
Data is coming from an S3 bucket and a staging table. Only the meta-data is extracted and verified. After user confirmation of the meta-data, all of the air quality and its metadata are saved to the SQL database.

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add additional labels as needed

For Developers

Affected Components
This issue is one of three dealing with the verification page. The three issues will create a skeleton of the necessary components, fill the skeleton with data from the S3 bucket and Staging Table or handle errors, and finally add styling & accessibility to the page.

This issue outlines the components needed for the page:

  • Form
  • Form test
  • View (Excluding integration of staged data)
  • View test (Excluding integration of staged data)
  • url
  • HTML template, with minimal tagging
  • redirects to other web-pages

Technical Resources

Design Documentation

Testing Resources
Django Testing

Integrate Custom and Foundation CSS and Javascript

Is your feature request related to a problem? Please describe.
The website needs to be organized and structured in a way that is beyond the capability of HTML.

Describe the solution you'd like
Integrate the Zurb Foundation CSS framework and files for custom css and js. For development, I would like to integrate Foundation using a CDN. The custom css and js would live in a file saved locally to the project. For production, the CDN would be exchanged for an a-la-carte download of all the components used in development

Describe alternatives you've considered
I considered downloading the whole framework. However, this would take more time to install. I also considered downloading each component as its needed. However, we aren't sure exactly which components we will need.

Additional context
CDNs are quick to integrate because it only requires one line of code to implement. However, they create vulnerabilities for production code. For example, the hosting site could experience an outage, the content could be updated and break compatibility with our site, or it could modified in a way that creates a security vulnerability.

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add additional labels as needed

For Developers

Affected Components

  • Create an app.css file in a ./woeip/static/css/ folder
    • The name comes from Zurb's use of app in their demo of custom css
    • Even though it's currently a single file, I want to have a dedicated folder for when the css and js files have multiplied
  • Create an app.js file in a ./woeip/static/js/ folder
  • Place the CSS CDN link and custom CSS link in the html head, with the Custom CSS after the CSS CDN
  • Place the corresponding javascript links just before the closing </body> html tag

Technical Resources
Zurb Foundation CDN
Article on adding custom css to a framework
Django Static Files
Human who codes JS placement

Design Documentation
Trello Card discussing CSS Frameworks

As a user, I want my starting point to be the sign-in page

Is your feature request related to a problem? Please describe.
The user needs a starting URL to begin their experience.

Describe the solution you'd like
Redirect /index to /signin (I'd prefer to use "sign in" language consistently over "log in" because it's more user-centric, as opposed to system-centric).

Describe alternatives you've considered
The resources to scope, design, and implement a proper home page at /index is better used for core MVP functionality.

Additional context
We've got a backlogged issue for the /index landing page once MVP has shipped. This will also buy us time to finalize some of the open questions around project positioning and team roles.

Edit: Sign in already redirects to index. If we have index redirect to signin, then it will be an endless circle. Alternatively, we could redirect from index to upload. If the user is logged in, they continue seemlessly to add data. If they are not signed in, they are gracefully redirected to the sign in page. Once signed in, they are advanced to the upload page. This is bad django. But, it's good UX. We'll pay for our sins, after MVP. Changes are updated in the Technical Resources Section
-Tim

For Developers

Affected Components
air_quality/views.py index function

Technical Resources

  • The index view should return redirect ('upload') redirect('[insert name of sign in page]')
  • Alternative approach from simple is better than complex Django Login Views
  • StackOverFlow
    Design Documentation
    TBD

As a user, I want to view my password as I reset or change it

Is your feature request related to a problem? Please describe.
On the login page, users are able to view their password as they enter it. However, the show password option does not exist anywhere else in the password reset or change workflows.

Describe the solution you'd like
Users should be able to reveal their password anytime they need to enter it.

Describe alternatives you've considered
Keeping the passwords obscured

For Developers

Affected Components

  • The showpassword function in app.js
  • HTML templates which contain a password field
  • Dependent on #199

Technical Resources
The showpassword javascript function works by grabbing a specific element id. Consequently, it cannot be used for other password fields. The functionality needs to be generalized to reveal other password fields

Design Documentation
Refer to existing show password style on homepage, to generalize to other password fields

Testing Outline
Describe the testing methods appropriate for this feature

Views Testing

Is your feature request related to a problem? Please describe.
Views Testing

Describe the solution you'd like
Create tests to check whether views are accomplishing their intended design

Additional context
Previous task that must be completed: Finalize functionality of views
Views Testing Documentation

Navigation bar

Is your feature request related to a problem? Please describe.
Create a navigation bar for users to find top-level pages.

Describe the solution you'd like
A top bar menu that transforms into a hamburger menu on smaller screens.

Describe alternatives you've considered
A list of links and their descriptions in the body of the homepage. This may provide context for new users. However, it goes against established best practices. Additionally, it would require users to navigate back to the homepage to find any other page.

Additional context
The majority of users should interact via the desktop site. However, we should accommodate mobile users.

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add additional labels as needed

For Developers

Affected Components

  • Top-level links are currently housed in the _header.html file, under the includes directory.
    They should be moved a dedicated file named _navigation.html, still within the includes directory.
  • Also part of this issue, please refactor _header.html to _messages.html, as that is all this file will contain.
  • Within __base.html "include" includes/_navigation.html just below the <body> tag, above includes/_header.html
  • Refactor includes/_header.html to includes/_messages.html

Technical Resources
Django Template Structuring Convention
Zurb Responsive Header

Design Documentation

Reference pages using their names: ie) "{% url 'index' %}", to make it easier to refactor later

Links in the navigation bar:

  • 'Brand' link should float left and be displayed on all screen sizes
    • WOAQ, name: 'index' (Displayed to all users)
  • 'List' links should float right on larger screens and turn into a right-sided hamburger menu on smaller screens. From left to right, they are:
    • Add Data, name upload (Displayed to all users.)
      • Only logged in users can upload data. However, always displaying it allows users to understand their options.
    • Log in Sign In, name login (Displayed only if user is logged out)
    • Log out Sign Out, name logout (Displayed only if user is logged in)
    • View Maps, links to # until page is built
    • More links (such as Sessions) will be added, as the site grows.
    • Remove the Request Account link

Edit: Updated links based on wireframes

Wireframes or other design resources
Nav Bar Wires
Prototype Branch: ty/toggle-navigation
WOAQ-Wires-Nav-20190325.pdf

Google Analytics

Description

We want to be able to track visitor behavior across the site via tracking analytics. Some options:

Considerations

  • Account should be tied to [email protected]
  • Dashboard needs (e.g. what goal paths need to be set up)

Simplification of Getting Started part of readme

The Getting Started section of the readme could be made more user-friendly by adding the following steps:
After make local.up, run make local.shell. Add ./manage.py createsuperuser to add in a username/password.

Go to localhost:8080 to access the site. Login with the username/password created above.

As a WOAQ contributor, I want to know how to visually style front-end components.

Is your feature request related to a problem? Please describe.
The current contributing.md file contains a section titled "Style Guides." It does not yet reflect the latest decision to use default/out-of-box Foundation visual styles.

Describe the solution you'd like
Add a bullet item under "Style Guides" for "Visual/CSS styling: Foundation 6 Global Styles

Describe alternatives you've considered
Not including it (increases likelihood of rogue styles being implemented).

Additional context
Add any other context or screenshots about the feature request here.

For Developers

Affected Components
contributing.md

Technical Resources
n/a

Design Documentation
n/a

Testing Outline
Standard PR review.

Contribution workflow

Create Issue and PR templates. The concept is to standardize the workflow of identifying issues, discussing solutions, and implementing code. It should slow down coding and speed up development.

Static assets port mismatch

Describe the bug
The static files are being stored on port 8080. The web browser is looking at port 8000, resulting in a 404 error.

To Reproduce
Steps to reproduce the behavior:

  1. Create a custom.css file, with css, in static/css folder
  2. Load static into head of html template
  3. Link to stylesheet using <link rel="stylesheet" href="{% static 'css/custom.css' %}">
  4. Collect static files, using make local.shell -> make static
  5. Start program and look in developer tools for stylesheet
  6. Stylesheet will be at http://localhost:8080/static/css/custom.css. However, program will look for stylesheet at http://localhost:8000/static/css/custom.css

Expected behavior
The port where the stylesheet lives and where the program looks should be the same

Additional context
Add any other context about the problem here.

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add a bug label
  • Add additional labels as needed

Affected Components (For Developers)

  • Settings.py
  • docker files

Technical Resources (For Developers)
Add links to appropriate documentation. Describe possible code implementations.

As a user, I would like the website to automatically know about my data

Is your feature request related to a problem? Please describe.
Information about the dataset is available in the uploaded files. I would like the website to look through the files and automatically extract the data.

Describe the solution you'd like
A script that parses the data from the files and places it in a staging table

Describe alternatives you've considered
An alternative design requires all of the data to be manually inputted by the user.

Additional context
This script comes after the upload process. It accesses the files, after they have already been placed in an S3 bucket/folder. The parsed data is placed in a staging table. This issue comes before the page where the data values are confirmed by the user.

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add additional labels as needed

For Developers

Affected Components
List what pages or backend files will need to be added, removed, or changed

Technical Resources
Add links to appropriate documentation. Describe possible code implementations.

Design Documentation
Wireframes or other design resources

Discuss the how data session will acquire information about the sensors that were used in data collection.

Initial TODOs:
forms.py

TODO: Include Sensor fields that are seen by client when uploading the files.

  1. It is more transparent to the user what data is being loaded and why.
  2. It is easier to generalize the website, once other sensors are available.

views.py

TODO: Include Sensor fields that are seen by client when uploading the files.

  1. It is more transparent to the user what data is being loaded and why.
  2. It is easier to generalize the website, once other sensors are available.
    TODO: Rather than hardcode the value of the Sensors, present it as an option in
    the form the client sees. However, have it pre-filled with the pre-loaded objects
    of Dustrak and GPS. This will also achieve the goal of outsourcing some of the
    view code to other modules. ie) The object call will be done in the form, instead

Integrate data into verification page and handle errors (2/3)

Is your feature request related to a problem? Please describe.
A page where users can view, verify, and edit the meta data that was automatically generated for the session.

Describe the solution you'd like
The user should be brought to a page where they are presented with a form, pre-filled with data. The user can change the values of the data in the fields. The user can either save the data or cancel the upload. Saving progresses to the session view page. Canceling returns the user to the upload page.

Login is required for this view

Describe alternatives you've considered
Manually entering all fields, when initially uploading data.

Additional context
Data is coming from an S3 bucket and a staging table. Only the meta-data is extracted and verified. After user confirmation of the meta-data, all of the air quality and its metadata are saved to the SQL database.

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add additional labels as needed

For Developers

Affected Components
This issue is one of three dealing with the verification page. The three issues will create a skeleton of the necessary components, fill the skeleton with data from the S3 bucket and Staging Table or handle errors, and finally add styling & accessibility to the page.

This issue integrates the data from the Staging table, handles extensive errors, and "prepares" the data for the SQL Database (Actual upload of the data to SQL is the next issue).

Affected components:

  • Staging Table
  • View
  • View test (including integration of staged data)
  • Error Handling (Including loss of internet connection, failure of web browser, or accidental early navigation away from page)

Technical Resources
TBD

Design Documentation
Wireframes
Status of Data Trello Card

Testing Resources
Django Testing

As a WOAQ team member, I want a single public contact option with multiple fallbacks.

Is your feature request related to a problem? Please describe.
Currently, there's no direct contact info in the ReadMe doc, other than for reporting security issues, and that directs people directly to Tim's email address. This poses two problems:

  • Visitors don't know how to reach WOAQ for general inquiries.
  • Only one person is alerted of security issues, which means if that person is unavailable the security issue may go unaddressed in a timely fashion.

We now have a general email address that forwards to both Jess and Tim, so two people will always be notified of any security issues or incoming communication.

Describe the solution you'd like

Describe alternatives you've considered
Leaving Tim's email as-is, but that poses potential security issues.

Additional context
Add any other context or screenshots about the feature request here.

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add additional labels as needed

For Developers

Affected Components
ReadMe.rst

Technical Resources
Add links to appropriate documentation. Describe possible code implementations.

Design Documentation
Wireframes or other design resources

As a data uploader, I want to verify the information I've uploaded to the system.

Is your feature request related to a problem? Please describe.
Currently, the system automatically pairs uploaded csv and log files based on the data within the files. We want to make sure the system has gotten it right, provide the user with an opportunity to make corrections, and request additional data from the user that the system can't collect from the files themselves.

Describe the solution you'd like
A form-based UI with the following functionality:

  • Confirmation message (notification/alert bar) that indicates if file upload was successful and provides feedback about what took place.
  • Form containing fieldsets for as many sessions as were uploaded
  • Within each fieldset:
    • Date field (pre-populated w/ session date pulled from file), including date picker to ensure formatting
    • Start time field, pre-populated with extracted start time, including time picker to ensure formatting
    • End time field, pre-populated with extracted end time, including time picker to ensure formatting descoped
    • Device field, pre-populated with device name extracted from file and matched to DB
    • Collected By field, pre-populated based on logged-in user name (type-ahead input should suggest name based registered users, potentially revealing a drop-down or other list style alphabetized by first name...see example).

Additional considerations/use cases:

  • Uploading multiple sessions at once: If sessions reflect different routes, start and end times are more easily identified. If multiple sessions are uploaded from the same route, we need to figure out how to define start/end time.
  • Accessibility: Identify which WCAG guidelines apply, and define a plan to implement them

Describe alternatives you've considered
Investigated placing manual field entry on same screen as drop zone but felt it was better to get the user into the upload flow as quickly as possible (lower the barrier to entry), and present manual data entry as part of a confirmation experience so it feels a little more rewarding. UI also gets clunky if it's added to the drop zone screen.

Additional context
n/a (see flow under Design Documentation)

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add additional labels as needed

For Developers

Affected Components
List what pages or backend files will need to be added, removed, or changed

Technical Resources
Add links to appropriate documentation. Describe possible code implementations.

Design Documentation
See "Data Confirmation" wireframe: WOEIP-UploadFlow-v3.pdf

Edit by Tim: Formatted fields as sub-list, to differentiate

As a user, I want to view my data set on a map

Description

Once I’ve uploaded single CSV/GPS log pair and have confirmed the data ingested by the system is accurate, I want to be redirected to a map view of the data set.

Acceptance criteria

  • Map is defaulted to be zoomed into appropriate scale to view full route at once.
  • User can zoom in/out and move location on the map.
  • Data points are displayed as dots on their associated geolocations.
    • Geolocations with multiple sensor recordings display an aggregated dot.
  • All open questions in Issue have been answered or moved into new Issues.

Dependencies

  • Requires identification of mapping framework.
  • Related to #159

Related documentation

Wireframe, page 4: WOAQ-Wires-ViewMaps-v2.pdf (Note: Metadata display in wireframe is not a requirement for this issue)

Open questions

As a developer, I want to understand the team's approach to styling the frontend

Is your feature request related to a problem? Please describe.
I would like to know the guidelines for styling elements on the website

Describe the solution you'd like
I would like the styling to default to the Foundation built-in styling, for the MVP.

  • It requires no custom code
  • The colors are currently at an 8.59:1 contrast ratio (meeting certain accessibility requirements)

Custom css should be used sparingly

Describe alternatives you've considered

  • Creating a redline for each page. This is time consuming for the design team
  • Implementing the CfA style guidelines. This is time consuming for the frontend team

Additional context
The wireframes outline the structure of the frontend. However, they are not intended as a pixel-by-pixel request for design and styling. That is the role of a "redline".

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add additional labels as needed

For Developers

Affected Components
app.css

Technical Resources
Add links to appropriate documentation. Describe possible code implementations.

Design Documentation
Wireframes or other design resources

Testing Outline
Describe the testing methods appropriate for this feature

Mental Model for Contributing Doc

Is your feature request related to a problem? Please describe.
The motivation of the contributing workflow is to help create a shared mental model of the code and its implementation. The contributing document fails to explicitly state this. This may lead to confusion over its intentions and a hesitation to follow its guidelines. I would like the motivation to be explained in the workflow.

Describe the solution you'd like
I would the Issues Section of contributing.md to explain the importance of shared mental models, with a link to the associated Medium Article

Proposed Explanation:

Code for America attracts diverse developers with ephemeral tenures. (Maybe convey 'short stints' it in a less pretentious way?) This adds a breadth of knowledge that can greatly enhance a project. However, it also adds a layer of social complexity to an already technically complex project. By discussing the code in GitHub issues, we clarify a shared mental model of the code, outline pseudo-code, and pair program. We also document the design process and preserve it through several generations of developers. To learn more, read Effective Mental Models for Code and Systems by Cindy Sridharan.

Describe alternatives you've considered
A lack of explanation

Additional context

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add additional labels as needed

For Developers

Affected Components
Issues section of Contributing.md

Technical Resources

Design Documentation
Effective Mental Models for Code and Systems

Landing Page

Is your feature request related to a problem? Please describe.
The website needs a page to occupy the base (/) url.

Describe the solution you'd like
TODO: Design a simple, text only landing page. @theecrit, could this just be:

Welcome to WOAQ
West Oakland Air Quality (WOAQ) puts local air quality data in the hands of West Oaklanders

[Updated 3/26/19] Content requirements should be dictated by project positioning and core user need. When we're ready to pick up this issue, I recommend we start from the Core Model approach, something I've used to help keep pages focused and avoid too much Subjective Stakeholder Shiny Object Syndrome™ (not that we'd ever have such a problem).

  • With this implementation, we'll also need to remove existing redirect of /index to /upload.

Describe alternatives you've considered
The previous design had the home page dedication to the login functionality. This goes 'against the grain' of the Django built-in authorization module. While it would be possible to modify the Django module for authorization, it would be time intensive and could generate bugs.

Additional context

  • We are waiting to implement Accessibility related features
  • Styling should be done mostly done using functionality built into foundation
  • Dimensions of the content should be responsive to screen size.

Labels

  • Add a status label
    • backlog
    • discussing
    • ready
    • implementing
  • Add additional labels as needed

For Developers

Affected Components

  • ./woeip/templates/index.html

Technical Resources
Zurb Documentation

Design Documentation
@theecrit, please link to updated wireframes
Home page structure Trello Card

Account Request Email

  • Establish whether new accounts will truly be generated after making a request through email.
  • Decide the email account which will receive requests
  • Change the link in the navigation section to a valid email address

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.