Shuttle tracking for RPI.
Clone or download
Permalink
Failed to load latest commit information.
api iTRAK data feed endpoint (#160) Sep 14, 2018
auth Authentication refactor (#143) Apr 15, 2018
cmd/shuttletracker iTRAK data feed endpoint (#160) Sep 14, 2018
config Refactor everything into services and move to Postgres (#152) Sep 11, 2018
example_database Refactor everything into services and move to Postgres (#152) Sep 11, 2018
log Restructure (#55) Jul 12, 2017
mock Refactor everything into services and move to Postgres (#152) Sep 11, 2018
postgres Return latest locations in reverse chronological order (#162) Sep 14, 2018
static Fix vehicle colors (#163) Sep 15, 2018
time Refactor everything into services and move to Postgres (#152) Sep 11, 2018
updater iTRAK data feed endpoint (#160) Sep 14, 2018
vendor Refactor everything into services and move to Postgres (#152) Sep 11, 2018
.bowerrc Fixes Polymer version issue Apr 8, 2015
.codecov.yaml Set ETag header (#123) Mar 23, 2018
.dockerignore Refactor everything into services and move to Postgres (#152) Sep 11, 2018
.gitignore Refactor everything into services and move to Postgres (#152) Sep 11, 2018
.hound.yml Vehicles admin interface (#82) Oct 20, 2017
.jshintrc Vehicles admin interface (#82) Oct 20, 2017
.travis.yml Bump Go versions to 1.11 (#159) Sep 12, 2018
CHECKS Redo config loading and Docker stuff Sep 8, 2017
Dockerfile Bump Go versions to 1.11 (#159) Sep 12, 2018
LICENSE Update LICENSE Dec 8, 2016
README.md iTRAK data feed endpoint (#160) Sep 14, 2018
admin.html Custom admin alert messages (#126) Mar 2, 2018
conf.json.sample Refactor everything into services and move to Postgres (#152) Sep 11, 2018
dummy_data.json added some more dummy data Mar 30, 2017
index.html Add query string to frontend.js resource (#167) Sep 20, 2018
location.go Refactor everything into services and move to Postgres (#152) Sep 11, 2018
message.go Refactor everything into services and move to Postgres (#152) Sep 11, 2018
model.go Refactor everything into services and move to Postgres (#152) Sep 11, 2018
route.go Refactor everything into services and move to Postgres (#152) Sep 11, 2018
stop.go Refactor everything into services and move to Postgres (#152) Sep 11, 2018
test.sh Compress responses (#140) Mar 26, 2018
user.go Refactor everything into services and move to Postgres (#152) Sep 11, 2018
vehicle.go Refactor everything into services and move to Postgres (#152) Sep 11, 2018

README.md

Shuttle Tracker Build Status codecov GoDoc Go Report Card

Tracking and mapping RPI's shuttles with Go, Vue.js, and Postgres.

Check it out in action at shuttles.rpi.edu.

Setting up

  1. Install Go. Shuttle Tracker targets Go 1.7 and newer, but we recommend using the latest Go stable release.
  2. Ensure your $GOPATH is set correctly, and $GOPATH/bin is in your $PATH
  3. Run go get github.com/wtg/shuttletracker
  4. Install govendor by running go get -u github.com/kardianos/govendor
  5. Switch to the Shuttle Tracker directory ($GOPATH/src/github.com/wtg/shuttletracker)
  6. Run govendor sync
  7. Ensure you have Postgres downloaded, installed, and running. On macOS, prefer installing it with Homebrew.
  8. Run createdb shuttletracker to create a Postgres database.
  9. Rename conf.json.sample to conf.json
  10. Edit conf.json with the following, if necessary:
  • API.MapboxAPIKey: Necessary for creating routes through the admin interface. Create your own token or ask a Shuttle Tracker developer to provide you with one.
  • Postgres.URL: URL where Postgres is located. The provided default typically won't need to be modified.
  1. Add data to your database. Example DBs are provided in example_database, as well as a simple import/export script to setup the database for you.
    • If using an example database, you might need to check the name of the imported database and change the Postgres URL accordingly.
  2. Start the app by running go run cmd/shuttletracker/main.go in the project root directory.
  3. You can optionally add yourself as an administrator by using the make-admin.sh script in the example_database folder, passing it your RCS ID as the first argument.
  4. Visit http://localhost:8080/ to view the tracking application and http://localhost:8080/admin to view the administration panel

Configuration

Shuttle Tracker needs configuration to run properly. The preferred method during development is to create a conf.json file. See conf.json.sample for an example of what it should contain.

Updater.DataFeed: API with tracking information from iTrak. For RPI, this is a unique API URL that we can get data from. It's private, and a Shuttle Tracker developer can provide it to you if necessary. However, by default, Shuttle Tracker will reach out to the instance running at shuttles.rpi.edu to piggyback off of its data feed. This means that most developers will not have to configure this key.

Environment variables

Most keys can be overridden with environment variables. The variables names usually take the format SECTION_KEY. For example, overriding database's Mongo URL could be done with a variable named POSTGRES_URL.