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.
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.
It is also possible to place a bid for < 11AM on the previous day at any time. But, this is to ensure you can run python3 -m services.process_bids
to test with day-ahead data.
Timezones
Everything is handled as UTC + Offset. Submit bid page shows the current time in the user's timezone as well as the timezone for the market. Everything else is displayed in UTC for now.
Requirements
- Node: v22
- Python: v3.11