diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2025-04-27 21:17:16 -0600 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2025-04-27 21:17:16 -0600 |
commit | f52782c4dccc3f2330d9dcd14ba4e3cf0522f8cf (patch) | |
tree | ad0b88833e055ff46fda84fc5a676781970a5f7a | |
parent | 623a03cc02b2e87a187aca29db5f3c787713fc74 (diff) |
add design decisions
-rw-r--r-- | README.md | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -1,5 +1,25 @@ # Virtual Energy Trading App +## (Questionable) Design Decisions + +This is just a section to state that I am aware these design decisions are questionable and not good practices. These decisions were made for the sake of simplicity and ease of development. + +### Authentication + +There is no real-authentication implemented. There is a dummy user in the database, and all the bids are attached to this user. On the web-interface, there is no login functionality. All bids are submitted as if they were made by the dummy user. + +In production, rather than specifying the user ID as part of the bid, the backend should authenticate the user and associate the bid with the authenticated user's ID. + +### Caching + +In production, rather than calling the gridstatus API to get the market data, the backend should cache the data locally and update it periodically. + +Also, rather than using the simple in-memory cache, the backend should use a more robust caching mechanism such as Redis or Memcached. + +### Bid Management + +Currently there is a cron job running every hour to check the bids in the database and then process them. In this process the market data is fetched in real-time from the gridstatus API. Ideally, the database is updated with the latest market data before processing the bids. That way the cron job can simply process the bids. + ## Project Structure ``` @@ -34,6 +54,3 @@ * API Endpoints * `GET /trader/pnl` - - - |