Check it out in action at shuttles.rpi.edu.
- Install Go. Shuttle Tracker targets Go 1.7 and newer, but we recommend using the latest Go stable release.
- Ensure your
$GOPATHis set correctly, and
$GOPATH/binis in your
go get github.com/wtg/shuttletracker
go get -u github.com/kardianos/govendor
- Switch to the Shuttle Tracker directory (
- Ensure you have Postgres downloaded, installed, and running. On macOS, prefer installing it with Homebrew.
createdb shuttletrackerto create a Postgres database.
conf.jsonwith 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.
- 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.
- Start the app by running
go run cmd/shuttletracker/main.goin the project root directory.
- You can optionally add yourself as an administrator by using the
make-admin.shscript in the example_database folder, passing it your RCS ID as the first argument.
- Visit http://localhost:8080/ to view the tracking application and http://localhost:8080/admin to view the administration panel
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.
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