Devlog
I finally have some resemblance of a working project. Now, stocks are actually displayed on the site. A lot of work was done to get here.
The details
Firstly, I needed a market class so I could run the simulation on all stocks. Thankfully, I just needed to wrap the the class with a “Market” class that runs the simulation for all of the stocks. Next, I worked a bit on the database. I actually chose a different approach to the database than previously stated. I instead created a new sqlite3 database and use sqlite3 on python to access it. On the Nuxt side of things, I chose not to use prisma and instead use the better-sqlite3 lib to communicate. I still use prisma for users but, I don’t think it would have played nice with python. Also on the simulation-side, I made the stocks load from a json file. This is great because I intend to allow people to merge in their own stocks to encourage creativity. Now for events, I actually have the AI prompt pretty much done. I also implemented events that communicate with the OAI API. For now, I just print the events and I have yet to actually implement the generated events but I have a solid framework for it. I also implemented all the API routes to communicate with the market database. This allowed me to create a functional Market page. This allows me to just fetch it from the frontend easily.
Next Steps
I’m putting events on hold for now. I don’t even know if I’ll implement them with the AI stuff. I want to work on the actual buying and trading of stocks by the user. I don’t think it’ll be too hard to implement. I’ll also work on SSE/polling so the stocks live update. I’ll probably poll because SSE (Server Sent Events) are a lot of work. But I want to learn SSE/Websockets since i’ve never really used them before. I also want some sort of onboarding for users. I might also look into allowing hackclub oauth instead of also github oauth.
Log in to leave a comment