Install golang using https://golang.org/doc/install Please install the latest version Note: Please use linux or mac for optimal installation experience
go get
the commands make supports. Type make
to view this description
(1) make run: To build and run it
(2) make hotreload: To run air
(3) make build: To just build it
After building the code(make build), you can run a cli to start the server or run commands. Running ee126_car_simulation executable gets the following description.
NAME:
Simulation CLI - Simulating car traffic over time
USAGE:
ee126_car_simulation [global options] command [command options] [arguments...]
VERSION:
0.0.1
COMMANDS:
start-server, start Starts the golang server
run-terminal-simulation, t Can run the simulation as terminal printouts for single lane simulation
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help
--version, -v print the version
for development on a hot reloading server, we use the air library.
curl -fLo ./air \
https://raw.githubusercontent.com/cosmtrek/air/master/bin/darwin/air
chmod +x ./air
curl -fLo ./air \
https://raw.githubusercontent.com/cosmtrek/air/master/bin/linux/air
chmod +x ./air
curl -fLo ./air.exe \
https://raw.githubusercontent.com/cosmtrek/air/master/bin/windows/air.exe
The command air will build the code and run it.
air
Run yarn install
inside the frontend directory
Open a tab and run yarn start
to have it live reload
Deploy for production via yarn build