Hi!
You're proposed to create simple grocery shopping cart application with two screens:
- Shop catalog screen
- Shopping cart screen
Application communicates with API server located at http://13.48.127.170:3000/ and performs few operations (described below in API section). Prelimiary application designs can be found here:
- PNG screens:
Shopping | Cart |
---|---|
- Figma sketches - https://www.figma.com/file/fCFHyNlfcezCg9AuDPdbBu/TONS?node-id=3%3A2
Application will enable user to interact with following user stories:
- "As a user I want to browse through list of products"
- "As a user I want to add product to cart by clicking on it"
- "As a user I want to see my cart"
- "As a user I want to modify quantity of items in my cart"
GET http://13.48.127.170:3000/products
Params:
limit(query): Int
offset(query): Int
Example request:
curl -X GET 'http://13.48.127.170:3000/products?limit=10&offset=10'
Example response:
[{"id":218799993587214750,"name":"FLOUR0047","imageURL":"https://tons-test-grocery-images.s3.eu-central-1.amazonaws.com/FLOUR/FLOUR0047.png","pricePerUnit":7.12},{"id":278313333619827200,"name":"SUGAR0010","imageURL":"https://tons-test-grocery-images.s3.eu-central-1.amazonaws.com/SUGAR/SUGAR0010.png","pricePerUnit":8.47},{"id":379016280437608060,"name":"SUGAR0091","imageURL":"https://tons-test-grocery-images.s3.eu-central-1.amazonaws.com/SUGAR/SUGAR0091.png","pricePerUnit":19.74},{"id":387068229937812500,"name":"SUGAR0017","imageURL":"https://tons-test-grocery-images.s3.eu-central-1.amazonaws.com/SUGAR/SUGAR0017.png","pricePerUnit":2.93},{"id":416030267332217700,"name":"FLOUR0048","imageURL":"https://tons-test-grocery-images.s3.eu-central-1.amazonaws.com/FLOUR/FLOUR0048.png","pricePerUnit":14.99},{"id":416281690644061950,"name":"SUGAR0114","imageURL":"https://tons-test-grocery-images.s3.eu-central-1.amazonaws.com/SUGAR/SUGAR0114.png","pricePerUnit":3.52},{"id":572385525504231000,"name":"FLOUR0011","imageURL":"https://tons-test-grocery-images.s3.eu-central-1.amazonaws.com/FLOUR/FLOUR0011.png","pricePerUnit":1.85},{"id":637839146771222300,"name":"FLOUR0108","imageURL":"https://tons-test-grocery-images.s3.eu-central-1.amazonaws.com/FLOUR/FLOUR0108.png","pricePerUnit":10.61},{"id":642756541451076200,"name":"FLOUR0093","imageURL":"https://tons-test-grocery-images.s3.eu-central-1.amazonaws.com/FLOUR/FLOUR0093.png","pricePerUnit":12.44},{"id":726194184824496100,"name":"SUGAR0009","imageURL":"https://tons-test-grocery-images.s3.eu-central-1.amazonaws.com/SUGAR/SUGAR0009.png","pricePerUnit":16.03}]
GET http://13.48.127.170:3000/cart
Params:
id(query): string
Example request:
curl -X GET 'http://13.48.127.170:3000/cart?id=hello'
Example response:
{"id":"hello","products":[{"quantity":2,"product":{"id":726194184824496100,"name":"SUGAR0009","imageURL":"https://tons-test-grocery-images.s3.eu-central-1.amazonaws.com/SUGAR/SUGAR0009.png","pricePerUnit":16.03}}]}
POST http://13.48.127.170:3000/cart
Example request:
curl -X POST http://13.48.127.170:3000/cart -d'{"id":"hello", "products":[{"quantity":2, "product":{"id":726194184824496100}}]}' -H'Content-Type: application/json'
Example response:
{"id":"hello","products":[{"quantity":2,"product":{"id":726194184824496100,"name":"SUGAR0009","imageURL":"https://tons-test-grocery-images.s3.eu-central-1.amazonaws.com/SUGAR/SUGAR0009.png","pricePerUnit":16.03}}]}
It is recommended that you generate UUID and use it for get/update cart
- You may choose any reasonable libs for this assignment. We're not limiting your choice here, just will give you suggestion to use solutions you're confident with.
- If needed, you may choose any dependency management (CocoaPods, SwiftPM, Carthage). Just make sure to include working README.md on how to build and run an app. It might be good idea to do clean checkout of the repo and try to build an app from scratch before submission.
- You are free to choose any UI creation approach (storyboard, xib, code). We're not limiting your choice here, however, keeping in mind the simplicity of design, creation of UI in code will be a plus.
- You are encouraged to make any reasonable UX improvements on top of what's given in this assignment. We'd love to learn your ideas here.
- You are free to choose any architecture pattern of your preference (MVx, Flux, Redux, VIPER etc.) During architecture assessment we would focus on:
- Appropriateness of selected architecture (Remember, this is a simple app. 6 levels of mapping of 5 levels of nothing won't bring you additional bonus points)
- Implementation cleaniness (How good you own the pattern you're employing in the app and how clean it's usage is)
- If you struggle with something for too long, please remember: "better done than perfect". We'd love to see your submissions and discuss results.