fernandoporazzi / yak-shop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yak-shop

Up and running (backend)

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

Up and running (frontend)

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.

Todo

  • 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 and app/app.go
  • Make typing more consistent

About


Languages

Language:Go 65.9%Language:TypeScript 23.3%Language:CSS 10.4%Language:JavaScript 0.4%