# Interview Task by Spheron
We're developing a digital marketplace that enables users to purchase items using cryptocurrency. This marketplace will feature various items, with a sample provided for reference. Your task is to design an API server facilitating the display of available inventory and allowing users to make purchases.
To make a purchase:
- A user will send a cryptocurrency transaction to a specified endpoint.
- This transaction must be validated before any updates are made to the inventory.
- Note: While the process suggests a cryptocurrency transaction, in practice, this can be a simulated (mocked) transaction.
The API should include the following endpoints:
- View available items, including quantity and price denominated in a specific crypto token.
- Review items previously purchased by the user.
- An admin-exclusive endpoint for updating item quantity and pricing.
- Execute a purchase from the marketplace.
To determine the price in a specific crypto token, an integration with third-party APIs, such as CoinMarketCap, is required. Be aware that such third-party services might impose daily rate limits.
## Mocked Items Data
```json
[
{
item: "Table",
description: "a table with good wood",
price: 10
},
{
item: "Chair",
description: "a chair with good wood",
price: 20
},
{
item: "Laptop",
description: "for studing, macbook",
price: 1000
},
{
item: "Lamp",
description: "nice lamp for study",
price: 50
}
]
```
## Tech Stack
- Node.js
- Typescript
- MongoDB
- Redis
- Docker
- Docker Compose
## Additional Info
Consider using design patterns like caching, scalability, etc. to enhance the code & system quality.
## Bonus
It would be a bonus if you deploy it on AWS and provide a live API for us to test it out. Also, you can docker-compose with two replicas of the same services and 1 LB with a Mongodb.
## Submission Criteria
- Public Github code base
- Live demo link deployed on AWS
- Proper documentation on the Readme
- Environment variables (if any)
- Please complete the task and return it to us within 1 week of sharing the task. Bonus: If you build this before the timeline suggested here.
## Contact
Please contact us by email or reply to the same email that is used to send the task if there is any doubt about the task.