Giter Club home page Giter Club logo

betterbus's Introduction

Better Bus

I live in Washington DC, where the Bus System is pretty robust. I have 5+ bus stops literally within eye distance of my house; yet I have found it difficult to find a resource which easily shows where each of those stops can take me all on one screen. The two options availible are:

  • Aggregate time tables for all buses, which don't show the geospatial path of the bus route
  • Map resources which allow you to show an individual bus route on a map one at a time

I wanted to make an app where I could type in the bus numbers that service a particular stop, and see where I could get to from that particular stop. I built this with a few technologies I was interested in taking a deeper look at.

The App

Screenshot
This app builds a very simple application which allows you to type in the name of a bus route and see it on a map. The magic is that you can do this for multiple bus routes at a time, without having to clear the map.

  • Search for multiple bus route, add it to the map
  • View multiple routes on the same map
  • Tap on the route to remove it from the map

Running and Deploying the App

Per usual, use npm install to get all the dependencies.

Add a WMATA_API_KEY to a .env file

You can get your own (developer API key from WMATA)[https://developer.wmata.com/] and put that in a .env file stored in the root directory. In the project directory, you can run:

WMATA_API_KEY=[your API key here]

Get a Mapbox token

You will need to get a Mapbox Access Token for an application. I stored mine in a file called mapboxaccesstoken.js at the root of the directory, and then exported that string to be used in /components/Map.js.

npm run dev

Runs the app in the development mode.
Open (http://localhost:3000)[http://localhost:3000] to view it in the browser.

The page will reload if you make any edits.

npm run build

Creates an optimized production build. I didn't use this capability as I needed to utilize API Routes of NextJS to hide my API keys, so I ended up using the Now CLI, developing with now dev and deploying with now prod. I then used their Zero-Config deployments dashboard to store my API Keys.

betterbus's People

Contributors

danmostudco 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.