In the project directory, you can run:
This command will download all the dependencies that are required
in your source files and update go.mod file with that dependency.
After make some modification in file schema.graphqls
, run this command to generate models and resolver
Start web server
- signup(graphql mutation) -- register new user
- login(graphql mutation) -- login, if succeed a valid JWT will be returned
- uploadReceipt(graphql mutation) -- create receipt with uploaded image file(a valid token needed)
- fetchReceipts(graphql query) -- fetch all receipts created by user(a valid token needed)
- fetchReceipt(graphql query) -- fetch a specific receipt, receipt image will be scaled if paramter
scaleRatio
is a valid number (0, 100)
I do not have golong working experience before,there might be some stupid errors in my implementation. Test is missing, error handlering need improve as well. Need some time to learn this part of golang.