Can be seen in prisma/schema.prisma file
CryptoCurrency table: Dimension table for storing each crypto details
CurrentPriceUSD table: Fact Table for storing USD price history
CurrentPriceGBP table: Fact Table for storing GBP price history
CurrentPriceEUR table: Fact Table for storing EUR price history
http://localhost:3000/api/cron
Fetch latest price from Coindesk API
Store price in MySQL database
Create new crytocurrency entry in CryptoCurrency Table if chartName does not exist in table
store latest price in CurrentPriceUSD, CurrentPriceGBP, CurrentPriceEUR table
(Not implemented): Was planning to use Github Action scheduled workflow to hit this endpoint every minute to trigger the api.
http://localhost:3000/api/cryptoprice/[id]
{
USD: [...],
EUR: [...],
GBP: [...],
}
Fetch all prices of the cryptocurrency that was specify
Query String to filtered out prices
http://localhost:3000/api/cryptoprice/bitcoin?timerange=10
timerange=10 will return all prices before 10 minutes
- The Filter time range select menu input will use either 10 minutes, 60 minutes or 120 minutes as the filtering range in the frontend.