aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2025-04-27 21:17:16 -0600
committerNavan Chauhan <navanchauhan@gmail.com>2025-04-27 21:17:16 -0600
commitf52782c4dccc3f2330d9dcd14ba4e3cf0522f8cf (patch)
treead0b88833e055ff46fda84fc5a676781970a5f7a
parent623a03cc02b2e87a187aca29db5f3c787713fc74 (diff)
add design decisions
-rw-r--r--README.md23
1 files changed, 20 insertions, 3 deletions
diff --git a/README.md b/README.md
index 6484c9d..4921d35 100644
--- a/README.md
+++ b/README.md
@@ -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`
-
-
-