Tracks and maps RPI's shuttles with Go, Postgres, Vue.js, TypeScript, and Leaflet. Check it out in action at shuttles.rpi.edu.
Looking to contribute? Please review our Contribution Guidelines.
More project documentation can be found on the Repository Wiki.
If you encounter issues setting up, check the Common Installation Problems for potential solutions.
git clone https://github.com/wtg/shuttletracker
.sudo apt-get install postgresql
createdb shuttletracker
. If there is an error createdb: could not connect to database postgres: FATAL: role "<username>" does not exist
, it is due that adminstrator has not created a PostgreSQL user account for you. It can be fixed by psql -U postgres
in terminal, CREATE USER <username>;
, ALTER USER <username> SUPERUSER CREATEDB;
in postgres=#
. And you can confirm the success by running \du
in postgres=#
.cd shuttletracker
)conf.json.sample
to conf.json
conf.json
with the following, if necessary:
Postgres.URL
: URL where Postgres is located. This will generally look like postgres://user:password@localhost/shuttletracker?sslmode=disable
where user
and password
are replacedsudo apt-get install nodejs
.node -v
.npm install -g n
.apt-get remove nodejs
to remove all versions of node installed through apt-get.n stable
to install the latest version of nodejs. Type node -v
after to verify../frontend
directory.npm install
npx vue-cli-service build --mode development
npx vue-cli-service build --mode development --watch
in another terminal to continuously watch for changes and rebuild.go build -o shuttletracker ./cmd/shuttletracker
./shuttletracker
./shuttletracker admins --add RCS_ID
, replacing RCS_ID
with your RCS ID. See the "Administrators" section below for more information.git clone git@github.com:wtg/shuttletracker.git
. If you receive a "permission denied" error, ensure you have added your SSH key to your GitHub account.cd shuttletracker
)conf.json.sample
to conf.json
conf.json
with the following, if necessary:
Postgres.URL
: URL where Postgres is located. This will generally look like postgres://user:password@localhost/shuttletracker?sslmode=disable
where user
and password
are replaced./frontend
directory.npm install
npx vue-cli-service build --mode development
npx vue-cli-service build --mode development --watch
in another terminal to continuously watch for changes and rebuild.go build -o shuttletracker ./cmd/shuttletracker
./shuttletracker
./shuttletracker admins --add RCS_ID
, replacing RCS_ID
with your RCS ID. See the "Administrators" section below for more information.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 PACKAGE_KEY
. For example, overriding the iTRAK updater's update interval could be done with a variable named UPDATER_UPDATEINTERVAL
.
The database URL is a special case. Following the above convention, it can be set with POSTGRES_URL
. However, for ease of deployment on Dokku, it can also be set with DATABASE_URL
.
The admin interface (at /admin
) is only accessible to users who have been added as administrators. There is a command-line utility to do this: shuttletracker admins
. It has two flags: --add RCS_ID
and --remove RCS_ID
. Replace RCS_ID
with a valid RCS ID.
> ./shuttletracker admins
No Shuttle Tracker administrators.
> ./shuttletracker admins --add naraya5
Added naraya5.
> ./shuttletracker admins --add lazare2
Added lazare2.
> ./shuttletracker admins
naraya5
lazare2
> ./shuttletracker admins --remove lazare2
Removed lazare2.
> ./shuttletracker admins
naraya5
Open your System Properties by searching Edit the system environment variables
then press Environment Variables...
.
GOPATH
variable is set correctly in the User variables for (Username)
. Path
under User variables for (Username)
and make sure %GOPATH%\bin
is on the list. GOROOT
is set correctly under System variables
. Path
under System variables
Make sure GOROOT\bin
is on the list. This step should be done for you already.
cmd
and hit ok, or search for command prompt.go get github.com/wtg/shuttletracker
. $GOPATH/src/github.com/wtg/shuttletracker
). shuttle
. Use default options for everything else. Remember your password. shuttletracker
and hit Ok. $GOPATH/src/github.com/wtg/shuttletracker
) and rename conf.json.sample
to conf.json
conf.json
with the following, if necessary:
Postgres.URL
: URL where Postgres is located which will be the default with postgres:password@localhost added before the database name, where password is your password from step 8. For example: "URL": "postgres://postgres:shuttle@localhost/shuttletracker?sslmode=disable"
. $GOPATH/src/github.com/wtg/shuttletracker/frontend
). npm install
npx vue-cli-service build --mode development
npx vue-cli-service build --mode development --watch
in another terminal to continuously watch for changes and rebuild.cd ..
) and build Shuttle Tracker by running go build -o shuttletracker.exe cmd/shuttletracker/main.go
shuttletracker.exe
in the project root directory. shuttletracker.exe admins --add RCS_ID
, replacing RCS_ID
with your RCS ID. See the "Administrators" section above for more information.