Coder Social home page Coder Social logo

sf-assets's Introduction

SF Asset browser

This project is a quick example to show how to take a publicly available dataset and to create a single-page mobile-friendly HTML app for exploring it in combination with location services.

Use-case: This use case comes from Robert Malmstein at Holberton School. According to Robert "sustainability is not just a trend, being green improves our environment and quality of live." - this dataset provides the geo-location of every publicly managed trash-can in San Francisco. Robert explained "Sometimes you just can't find a trash-can and that results in people littering, this app is a mash-up of public data from an SF survey of assets in 2016 - I want to make it accessible to everyone so they don't end up littering."

Robert's idea can be adapted to present any data-set to users in combination with Open Street Maps. It can be easily extended to allow crowd-sourcing and voting of new assets such as public benches for wellness breaks in a crowded city, or even for collecting evidence of potholes or other problems in public infrastructure.

OpenFaaS Functions

  • render - produces static HTML

The render function will make a call to the assets function for a certain asset like "Trash Cans", this matches up with a field called "Map Label" in the dataset.

  • assets - queries built-in CSV data-set

This function parses the CSV file and applies optional filtering depending on the query-string passed in via the ?map_label= querystring.

Instructions

  • Deploy to OpenFaaS Cloud

Add the OpenFaaS Cloud GitHub app to your account and push some code, that's it. HTTPS is built-in so location services will function as expected.

  • Working locally

In order to use location services you will need to work over HTTPS, so either set up a reverse proxy or use ngrok to front your API Gateway.

Acknowledgements

Inspiration - idea from Robert Malmstein - Holberton School.

Dataset - from SF Data

sf-assets's People

Contributors

alexellis avatar

Stargazers

Finnian Anderson avatar

Watchers

James Cloos avatar  avatar  avatar

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.