GithubHelp home page GithubHelp logo

streetsupport / streetsupport-web Goto Github PK

View Code? Open in Web Editor NEW
23.0 4.0 61.0 158.9 MB

Helping people facing homelessness across the UK to find services in their area, and connecting people who want to help to where it is needed most.

Home Page: https://streetsupport.net

License: MIT License

JavaScript 66.14% HTML 0.01% Shell 0.07% Handlebars 27.70% SCSS 6.08%
js es6 hogan knockoutjs homelessness metalsmith gulp sass

streetsupport-web's Introduction

StreetSupport Website

This repository is for the Street Support website, found at https://streetsupport.net. The website helps people facing homelessness find services in their area, as as well as sign-posting people wanting to help, to where it is needed. The site acts as a gateway into Street Support's broader remit of helping connect organisations, people with lived experience, policy-makers, and businesses to co-produce lasting solutions.

Contributing

I will be adding any updates we receive from our users as issues on Github. Please fork and work in the develop branch. Once the update is completed, submit a pull request into develop. Travis CI automatically builds on each commit to develop, uat and prod.

I would also appreciate any issues/PRs for bugs you may come across, and general fixes/refactorings. Where possible, please write a test that covers your code change.

Build Status

Install

  • Install the latest stable Node version,
  • Run in Terminal: npm i gulp-cli -g (Gulp does not need to be installed globally),
  • In your command line terminal, navigate to the street support project folder,
  • Run: npm i

See Installation Troubleshooting section if Installation fails

See https://github.com/fephil/garrus for more information about the Frontend workflow.

Optional Installs

In your editor of choice, the following plugins are recommended but not required. Note the plugin names might be slightly different depending on your editor.

  • editorconfig,
  • tabs-to-spaces,
  • linter,
  • linter-handlebars,
  • linter-js-standard,
  • linter-stylelint.

Usage

Run these tasks in your command line Terminal:

gulp [--production] [--debug]

gulp deploy [--production] [--debug]

gulp auditcode

  • The gulp task builds the website, watches for changes and starts up a sever,
  • The gulp deploy task builds the website without watching for changes or running the server,
  • The gulp auditcode task runs various linting on the project source files,
  • The gulp jsdev task only checks and builds javascript with associated tests,
  • The --production flag builds minified assets with no sourcemaps,
  • The --debug flag shows the files being created in each task (if the task has a pipe).

Environments

There are three API environments: CI, UAT and LIVE. You can alter the API your local instance is running from by editing /blob/develop/src/js/env.js:

  • 0: locally running API instance
  • 1: CI
  • 2: UAT
  • 3: LIVE

Day-to-day development should point at CI.

Development

Workflow

On running the default gulp task from the terminal, it will run tests and linting, build the site into the /_dist/ directory, and then launch in your default browser. As you edit files in the /src/ directory, the site will refresh automatically.

Pages

Each page of the site is found under the /pages/ directory. Each page is represented by a handlebars file index.hbs, in a directory named after the page's url. In each .hbs file, meta data is entered to define the page:

  • title: the page's title tag
  • description: the page's meta description
  • layout: the master layout file (found in /layouts/)
  • permalink: ???
  • jsBundle: the js bundle that will be loaded into the page. Bundles are defined in /webpack.config.js and each one points to a js file in /src/js/. For basic pages, use generic.
  • section: the top level navigation item this page belongs to. See /src/scss/modules/_variables.scss for list of sections
  • page: the navigation item for this page. See /src/scss/modules/_variables.scss for list of pages

Page templating is done using Hogan. Note: template parts need to be escaped eg:

\{{myVariable}}

Knockout data-binding is also used in some pages.

Javascript

Page code-behinds are written in plain ol' Javascript, or use Knockout. Knockout view models are found in /js/models/ are mostly tested. ES2015 syntax is transpiled using Babel.

Testing

Tests reside in the /spec directory, and are written using Jasmine and Sinon. Please ensure any features submitted via pull request are covered by tests.

A number of happy paths are covered by automated browsers tests at: https://github.com/StreetSupport/web-automated-testing.

Styling

CSS styling is written in SCSS, based on Susy, in the BEM style, and is auto-prefixed. Build with a mobile-first approach, using sass-mq for media queries. Each component's styles should reside in its own file. Avoid nesting of elements and modifiers (although there are many cases of nesting at the moment!).

Installation troubleshooting

Gulp Native Code Crashes

gulp[62193]: ../src/node_contextify.cc:631:static void node::contextify::ContextifyScript::New(const FunctionCallbackInfo<v8::Value> &): Assertion `args[1]->IsString()' failed.

Caused by: One of gulp's dependencies are out of date

Solution: Uninstall and reinstall Node Modules

rm -rf node_modules
npm i

Node Sass

ERROR in Missing binding <PROJECT_DIR>/node_modules/node-sass/vendor/darwin-x64-11/binding.node
Node Sass could not find a binding for your current environment: <ENVIRONMENT> with Node <NODE_VERSION>

Caused by: switching node versions

Solution: Rebuild Project

npm rebuild

Cannot download PhantomJS

Caused by: network blocking download

Solution: use an alternative network (best to run npm i before attending)

Others

If there are problems that aren't mentioned here, post in the slack channel so we can help out and update these docs.

Supported by

Browser Stack

streetsupport-web's People

Contributors

anywhereiromy avatar bnmrly avatar cazgp avatar code-danp avatar cowlingj avatar davebaines1 avatar fephil avatar fsakita avatar furzeface avatar gary-i avatar hanrufan avatar hvish avatar james-cross avatar mikecoram avatar nickpettican avatar o-seliuchenko avatar pcaldredbann avatar rob-anythingagency avatar rob3rth avatar samuelcotterall avatar sashv avatar sean12697 avatar simonpioli avatar smollet777 avatar snyk-bot avatar szappacosta avatar tim-borrowdale avatar timborrowdale avatar vincelee888 avatar vivslack 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

Watchers

 avatar  avatar  avatar  avatar

streetsupport-web's Issues

create sitemap page

to aid people finding the content they need, create a new sitemap page.

this should be generated as part of the build process. see tasks/ for all the build steps.

Link from the footer, and also to T&Cs.

NB Categories would ideally be pulled from the DB as can change, but static will do for now.

Full list of pages and links here: https://docs.google.com/spreadsheets/d/1x6OCCD1avbpiHKD7eNnnPHEEz438neAtazjXhgD1giQ/edit?usp=sharing

Sitemap Desktop:
https://sketch.cloud/s/xK2P8/all/sitemap/sitemap-desktop
Mobile:
https://sketch.cloud/s/xK2P8/all/sitemap/sitemap-page-mobile

see _cards.scss and make a variant

Fix print styling on organisation listing

Improve use of space when printing the org listing page eg https://streetsupport.net/find-help/meals/timetable/ by adding print media query to the components:

  • remove entire search box (titled "To find organisations in your area...")
  • remove entire search organisation by name form
  • remove view type tabs (list, map)
  • remove drop shadow from card
  • add print button underneath heading synopsis, giving it a class of .js-print-btn
  • hide print button in print styling

new organisations print friendly view

create new print-friendly page for https://streetsupport.net/find-help/all-service-providers/, which lists org title, synopsis, and addresses

add print button underneath heading synopsis, giving it a class of .js-print-btn

hide irrelevant items:

  • remove entire search box (titled "To find organisations in your area...")
  • remove entire search organisation by name form
  • remove view type tabs (list, map)
  • remove drop shadow from card
  • hide print button in print styling

create task/build step to create sitemap.xml

to improve search engine optimisation, create a sitemap for crawling robots.

the site is built using https://metalsmith.io/. keep in mind a number of pages are created as part of the build process - take a look in tasks/ and any files called generate...

there's probably a plugin for metalsmith that will crawl its own files and generate one, otherwise, create a gulp task that can be run post-build that builds it!

host app link images locally

currently uses apple's linkmaker which takes a while to resolve. just re-create the image and host them in the site

fix horizontal scroll in mobile view

when viewing the site on a mobile device, you can swipe left and move the site body across, revealing a yellow box. this is an issue with how the mobile nav works.

extract find organisations form from location homepages into partial

For each location home page (eg https://github.com/StreetSupport/streetsupport-web/blob/develop/src/pages/manchester/index.hbs) take out the form after the "You're in {location-name}" and put it into a partial (https://github.com/StreetSupport/streetsupport-web/tree/develop/src/partials/locations)

Currently supported locations:

Bolton
Bournemouth
Bradford
Bury
Leeds
Liverpool
Manchester
Oldham
Portsmouth
Rochdale
Salford
Southampton
Stockport
Tameside
Trafford
Wigan

Please also do https://github.com/StreetSupport/streetsupport-web/blob/develop/src/pages/locations/_home-page.hbs - which is used in the scaffolding of new location pages.

organisations sharing the same postcode do not show up on map view

reproducing the issue:

  1. go to https://streetsupport.net/find-help/all-service-providers/map/
  2. enter the postcode "M4 1LE"
  3. hit "find help" button
  4. zoom in the map

clicking on the icon shows info for Centrepoint. However, there is also the organisation Coffee4Craig there, as they share office space.

TODO:

  • aggregate the data, grouping organisations that share a lat/long
  • remove the purple (? i'm colour blind!) heading
  • list organisations in the white remaining white section:

eg

button - "x" (close marker)

h1 - "Centrepoint - Greater Manchester"
p - "Homelessness charity for 16 - 25 year olds."
a - "view details"

h1 - "Coffee4Craig"
p - "Holistic homelessness support"
a - "view details"

ensure:

take a look at:

https://github.com/StreetSupport/streetsupport-web/blob/develop/src/scss/partials/_card.scss
https://github.com/StreetSupport/streetsupport-web/blob/develop/src/js/pages/all-organisations/map/app.js

wire up organisation search to API endpoint

on the org listing page (find-help/all-service-providers/) wire up to the search org form to query the API (currently, it just does a client-side filter of the orgs returned by the postcode proximity search)

this requires a GET request being sent to the API endpoint via the following URL: /v1/service-provider-locations/?name={org-name}

review webpack caching

Not sure if webpack is caching stuff correctly when it chunks everything. can then get rid of our custom cache busting in the pipeline

(S) CSS | WEB - tidy up org listing page

example page to replicate (on dev): /find-help/organisation/?organisation=barnabus

###opening times

on a location's opening times listing, each day should be listed vertically, and multiple opening times (eg 09:00 - 12:00; 13:00 - 17:00) should be listed horizontally

###errant drop shadow

remove the drop shadow that is floating about when a location does not have any services

consider removing backstop/visual regression testing

As part of an effort to make SSN V1 more efficient dev side, we should consider dropping visual regression testing as:

  • we don't use it,
  • a fair few dependencies,
  • the version is very old and would probably need redoing anyway.

Add link to donate directly to Street Support

Fix print styling on timetabled service listings

Improve use of space when printing a services timetable page eg https://streetsupport.net/find-help/meals/timetable/ by adding print media query to the components:

  • remove entire search box (titled "to find services near you...")
  • remove view type tabs (listing, timetable, map)
  • extend cards to full width
  • remove drop shadow from card
  • add print button underneath service category synopsis, giving it a class of .js-print-btn
  • hide print button in print styling

list an organisation's accommodation that they provide (if any)

from an org's details page (eg https://streetsupport.net/find-help/organisation/?organisation=riverside)

create a section that lists the accommodation entries they provide.

have a look at:

consider:

  • extracting the markup for the accommodation card into a partial used in both views
  • perform the query and templating separately to existing loading/templating

Fix print styling on service listings

Improve use of space when printing a services timetable page eg https://streetsupport.net/find-help/meals/ by adding print media query to the components:

  • remove entire search box (titled "to find services near you...")
  • remove view type tabs (listing, timetable, map)
  • extend cards to full width
  • remove drop shadow from card
  • add print button underneath service category synopsis, giving it a class of .js-print-btn
  • hide print button in print styling

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.