Code Monkey home page Code Monkey logo

frontier's Introduction

Stories in Ready

Frontier

Frontier is an app that lets you give it your location and then returns a list of accessible resources nearby. For example, it might tell you the nearest open restaurants, the nearest open gas stations, the nearest public wifi hotspots, the nearest public restrooms, or the nearest open towing/mechanic shops.

Tech

This project is built using node.js. It uses the express web application framework on the backend to serve the website and provide APIs for the website to access data. The frontend is built using React & Bootstrap. The frontend assets are compiled using the Webpack module bundler and Babel compiler to allow the use of JSX and next generation Javascript features.

Setup

  1. install node.js on your computer
  2. setup git on your computer
  3. clone this repository: git clone https://github.com/codeforhuntsville/Frontier.git
  4. npm install in the cloned directory to install the required packages
  5. obtain a Google Places API Key (see instructions below)
  6. copy the file config/default.js to config/local.js, then fill in the googlePlacesApiKey property value with your key
  7. npm start to run the server

Google Places API Key

We use the Google Places API as a source for some of the data in Frontier. In order to make requests to the API, you must obtain an API key and configure Frontier to use it.

  1. Navigate to the Google Developers Console
  2. Create a new project, (e.g. "Frontier")
  3. Select APIs on the left
  4. Click "Google Places API Web Service" under the "Google Maps APIs" section
  5. Enable the API
  6. Go to "Credentials" on the left
  7. Create a new "Public API Access" "Server" key. Don't worry about IP restrictions for now
  8. Plug this key into the config in Frontier.

Join our community

License

MIT

frontier's People

Contributors

chadxz avatar chrisbeaman avatar dannagle avatar dustywusty avatar git-madhav avatar itsamenathan avatar mjcarroll avatar nedlinin avatar spearna avatar syjulian avatar tessellator avatar tomcasaletto avatar waffle-iron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

frontier's Issues

Delegation

I had some time to spare, so I set up VM, forked the project, installed the packages, launched Node.js, and my immediate result was:

Error retrieving restaurants
TypeError: restaurants.map is not a function

I started to track down the bug, but I found this project seems pretty bare-bones. Could we discuss task delegation at the next meeting? I don't want to step on anybody's toes at such an early state.

As a user, I'd like to be able to find gas stations near me

Description

I'd like to be able to choose the "gas stations" category on the home page (http://lrdy2r.axshare.com/#p=home) and then click the Search button on the bottom of the home page and see a list of gas stations in search results.

Definition of Done

  • Gas stations within the distance range selected by the user are displayed in search results
  • In the List View (wireframe: http://lrdy2r.axshare.com/#p=list_view), gas stations are displayed in order of closest to the user > furthest from the user
  • Distance from the user (in miles: ie. 0.4 mi.) is displayed directly below the name of the gas station

Technical Details

Gas stations can be pulled from the Google Places API: https://developers.google.com/places/supported_types

As a user, I'd like to see the restaurants near me denoted on a map

Description

Currently we have the ability to retrieve the user's location via the HTML5 Geolocation API. We take this information, and retrieve a list of restaurants in a radius around that location, displaying the name of each to the user.

We would like to enhance this experience by displaying some sort of graphic to indicate where the restaurant is located, overlaid on top of a map.

The design of the UI/UX should take cues from the mockups that can be seen here: https://kivo.com/p/uLtqwYf8. Note: this ticket is not to implement the entire UI/UX for the mockup, only enough to meet the following requirements:

Definition of Done

  • for each restaurant, a graphic is displayed at it's coordinates on a map

Technical details

This will require the backend to be modified to include the geo coordinates of each restaurant so that they can be mapped.

As a new developer, I would like to see project workflow

I documented what I learned in addressing my first Issue. I think it would be useful to new members and will expand it to include project resources and group philosophy. My plan is to update the README.md with this info but if it goes elsewhere (or nowhere) per the group, that's fine with me. I will be looking to the more experienced members to contribute their favorite web links on the technologies we use.

As a user, I'd like to click/touch a button to give my location

Description

We would like to provide a location button that gives the app the user's location when the user touches/clicks it.

Definition of Done

  • The user clicks/touches the location button and their location is displayed in text below the input field as "Near: 123 Main St, Huntsville"

See example: Click the location button in this wireframe: http://lrdy2r.axshare.com/#p=home

Technical Details

Wireframe: http://lrdy2r.axshare.com/#p=home

In this wireframe, the "give location" button is to the right of the input box containing the words "Enter an address"

The user would touch/click this button and the app would get the user's location via some native function of their device, or some other mechanism. You'd need to figure out how to achieve this for Apple iOs, Android, Chrome, Firefox, Internet Explorer, Safari, etc. Is there a single method that works for all browsers/OS'?

As a user, I'd like to see more details about each restaurant near me

Description

We currently only pull the names of each Restaurant near the user. We would like to enhance this by providing more rich information about the establishment. We would like to display this information on the List View screen of the app.

Wireframe: http://lrdy2r.axshare.com/#p=list_view

Definition of Done

  • distance from the user is displayed directly below the restaurant
  • description of the establishment is displayed in a dismissible modal dialog when it is clicked

Technical details

The backend changes for this work may overlap some with #27, so be sure to collaborate with whomever is working on that ticket if you want to avoid stepping on toes. Otherwise there may be merge conflict resolution in your future ๐Ÿ˜‰ The description information may not be readily available from the Google Places web-service API, so that data may need to be retrieved from somewhere else (like Yelp, for example).

We have not chosen a UI framework for doing things like creating modal dialogs, but we are using React, so some options would include using react-bootstrap or material-ui. Whatever choice is made will affect #29 so be sure to collaborate.

For the UI/UX, you can take cues from the mockups at https://kivo.com/p/uLtqwYf8. In general, it needs to be a list, with 2 rows for each restaurant: the first row containing the restaurant name, and the second row containing the distance from the user in miles or feet. The final product doesn't necessarily need to be pixel perfect, it just needs to work. Tightening up the look and feel of the UI can be done over time.

CLA for the project

in #10 it was brought up that we should consider adding a CLA to the project. I'm not a lawyer, so I don't know if it is needed for our project. If it is, I think it would probably be important to get an actual lawyer to help us write the CLA document and know what information to collect from the person to make the CLA actually viable in court.

I did a cursory search online, and it wasn't really clear to me if a project with multiple contributors that wasn't backed by any specific business would need a CLA. I know of plenty of open source projects that are MIT-licensed that have tons of contributors that do not require a CLA to contribute to.

Anyway, would probably be worth consulting a lawyer about it if it's a cause for concern.

Abort server start when not properly configured

In #18 @clarkda suggested that we detect any critical configuration that is missing and just abort the server start if any of it is missing. I agree that this would be better than what we have now (reporting it on the api response). Let's get it done!

Ideally an error should be printed to the console describing what is wrong and how to fix. There are some details in #9 (comment) for the specific issue of setting the Google Places API key.

Move configuration validation out of config/default.js

The default configuration file is meant to be a template that can be copied and pasted to an environment name like production.js or local.js (see the node-config module docs for more info). The logic that is in that file complicates the structure and detracts from the simplicity that a config file should have.

If we want the config validation to be in its own file, we can use a simple module pattern to do that, like validateConfig(config) or something. As far as I'm concerned though, we can just validate the configuration inline in the main entry file.

Evaluate ESRI Koop as a data provider middleware

ESRI has a suite of tools called Koop: https://github.com/Esri/koop

This is a node.js/express application that allows different data providers to be exposed as either GeoJSON or ESRI-style REST endpoints.

The advantage of using a tool like this is that there are already several providers for common geo-data (ArcGIS, Github, Gist, Socrata, Census data, CKAN), and it's pretty easily extensible.

The open question is whether it can interface with the city's ArcGIS instance, or if it is bound to ArcGIS online.

As a user, I'd like to be able to define the radius used to search for restaurants

Description

Currently the restaurant search is hardcoded to a specific radius. The mockups indicate the user's desire to be able to choose from a few pre-determined radiuses.

Definition of Done

  • prior to retrieving the restaurants list, the user is be presented with a list of 3 predetermined radiuses to search within
  • when the user clicks a button, the restaurant search is performed using the chosen radius
  • the results are accurate for the chosen radius

Technical Details

This work may overlap the backend work for #27 and #28, as well as the choice of UI framework needed in #28, so be sure to collaborate with the people working on these tasks.

As a user I'd like to have offline access

Taking the (finite) breadth of query data for Huntsville and Madison and putting it in a database that updates with the app could remove the need for online access, and possibly reduce search time in the event of variable mobile internet speed. Also, further in the future, it might circumvent the issue of Google API query fees (>1,000 in 24 hours, or >150,000 with ID verification). This would be an advantage of a local app like this over apps like Yelp and Google Maps that don't have the option of saving the breadth of their (global scale) data set offline to the user's phone without massive hard drive consumption.

discussion of front end tech to use

Soon we'll be building the front end for frontier, and i was just curious what approach people want to take for building the ui/ux. If we want to build something that feels more like an application than a content site, it may be a good idea to build the frontend using predominately ajax requests with client side rendering of the fetched data. There are a myriad different approaches to doing this. The most naive approach would be to just continue on the path that frontier has at the moment, which is just building the HTML as strings and concatenating everything to be inserted into a div. This can get messy very quickly.

There are a number of frameworks that aim to simplify the process and structure when building a client side JavaScript application. To name a few of the popular ones: Angular, Ember, Backbone, & React. I have used everything except Ember in the past. For this project I would prefer to use React to build the app.

Does anyone else have an opinion on this subject?

add LICENSE file and include license in package.json and README

There needs to be an explicit LICENSE file indicating MIT license, and list MIT as the license in the package.json of the project and the README.md. That way it is clear that the project is open source. Without explicitly specifying, it has an implicit copyright.

enhance README with details about project

The README needs more details about quite a few pieces of the project:

  • how to setup a google app with api access to the google places web api. See the hackathon-starter project for inspiration on how to provide this info
  • using the 'config' node module, and any other node modules that aren't obvious
  • the ngrok URL that is available when in development environment
  • installing node.js and npm
  • the versions of node.js/io.js this project works with
  • installing npm and bower packages

It may be better if some of these topics had wiki articles instead of just living in the README, so that should be done if it makes sense.

Error when Google Places does not return results

Reported in #17 but creating a new issue here as that one has a different primary theme.

The bug was this:

Error retrieving restaurants
TypeError: restaurants.map is not a function

Being reported on the client side. We can put in two fixes for this, one on the server and one on the client to be extra safe. The one on the server will need to watch for an empty results list, and the one on the client will need to make sure the restaurants are an array prior to trying to call map on it.

Create data models for common mapable objects

Based on last night's meeting discussion, create data models. This defines the mandatory and recommended fields for data sources in the backend. For now, we can start with a base model and a few derived models.

  • Common data model (base object that all mapable objects can inherit from)
  • Location data model
  • Event data model

As a user, I'd like to be able to enter an address

Description

We'd like to give users the option to input an address by typing it into an input field.

Definition of Done

  • If the user types in an address without inputting the town name or state name/initials, the app should read the address as the closest matching address (ie. if the user enters "123 Main St" and the user is in Huntsville, this should be interpreted as "123 Main Street, Huntsville, Alabama."
  • If the user inputs an abbreviation for street or road (ie. St, Rd, Cir, Pkwy, Blvd, etc) it should be interpreted correctly.
  • If the user inputs an invalid or misspelled address, a validation message should appear below the input box. "You have entered an invalid address." (How does Google handle this?)
  • If the user enters a zip code only, then this is interpreted as the midpoint of this zip code. (Not sure how to define this one)

Technical Details

Wireframe: http://lrdy2r.axshare.com/#p=home
The input field should be an |input type="text"| form element. Consider using a Google API for address detection/correction/misspellings/"did you mean...?"/etc. (Not sure if this is part of Google's API, this is just a suggestion in case it is).

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.