# README
About
This is a small toy demo app using Go, React, Leaflet and Material UI. When the page is loaded, the app will get coordinates data from a back-end API every 2 seconds. These coordinates, generated by the Coordinates function, are random fake values representing the location of a GPS device attached to an object being tracked. The app shows that last 4 locations of the object. The most current location is represented by the marker with the biggest radius. Clicking on any of the markers will show information about the object being tracked.
How to build
-
Install Go
-
Install NodeJS
-
Install MySQL
-
Clone this repo and
cd
into this repo -
Run
./db/reset.sh
-
Run
./db/user.sh $PASSWORD
- this will create a MySQL user namedgo
with the password$PASSWORD
-
Run
go mod tidy
-
Run
cd ui && npm install && npm run build
-
Run
go build -o tmp/web ./cmd/web
-
Run
./tmp/web -dbname=one_step_gps -dbuser=go -dbpw=$PASSWORD
-
Point your browser to
http://localhost:4000