Install the required dependencies:
$ go get ./...
Build an executable:
$ go build
Run the binary:
# On Mac
$ ./yak-shop
# On Windows
$ ./yak-shop.exe
You should be prompted a few commands you can run.
To start the HTTP server, execute the following:
$ ./yak-shop start-server
The above command will start a server on port :8080
.
Possible endpoints:
- GET
/yak-shop/stock/:days
- GET
/yak-shop/herd/:days
- POST
/yak-shop/order/:days
Also, it's possible to retrieve information about the stock using the command line:
$ ./yak-shop get-data -f herd.xml -d 14
Where -f
is the name of the file and -d
is the number of days
cd
into the frontend
and Install the dependencies:
$ cd frontend
$ yarn install
Start the devlopment server:
$ yarn dev
The command above should start a server on port :3000
and open a new tab on your browser.
- Write unit tests (backend)
- Write unit tests (frontend)
- Create abstractions and remove duplicated code on services
- Create abstraction for file opener. Currently it has the logic in two places different places,
cmd/getData.go
andapp/app.go
- Make typing more consistent