TradeSims
- 14 Devlogs
- 72 Total hours
Django basec financial tracker
Django basec financial tracker
So this devlog is gonna be relatively short, cause it just comprises of correcting all changes requested, most importantly hosting on nest
Theres still a few issues with the website, but these are largely due to the hosting being on nest, cause the render website is mostly fine.
Firstly, the whole website is very laggy and all round unresponsive for a few seconds after any press taht requires a query to supabase or redis
Secondly, the dashboard does not render properly the first time, so id suggest to click the try again button or reload the page entirely.
Even after reloading the portfolio performance part just doesn not work until you click on the one month or 3 month bnutton ( I have no clue why but this is on nest only) then it works
The nest caddy does go down, like it did jstu at the time of writing this, so if it does happen to go down during the review, please check through tradesims.onrender.com, where the website is still upp
Thats all. Once again, Thanks !!
Hours: 12? 15? 20? (idek 😭😭)
Made the entire stock page have real data, you can actually buy and sell stocks now. This also updates transactions and holdings.
Brand new holdings page that shows every stock you own.
Finally, MY WEBSITE IS DEPLOYED.
Try it out now:
I thought it was complete alst time, but when i checked the dashoard i remembered the buttons id added to trending stocks for adding to wishlist
This one was slightly hard to do as it took changes in both JS and Python. I faced another error with color of the start but that worked out
This led me to my next problem
Whenever i called yfinance on dashboard for market movers and trending stocks it might not be in the database
This led to issues whenever I tried to wishlist those stocks or visited them it failed
Now Ive made a function to check if a stock is in the database, if its not, it updates top stocks and now it can be accessed
The same goes for the search bar, if theres no stock present then you can search for it, and if yfin has it, it adds to stocks and is forever accessible and updates just like all other stocks
This IS THE HARDEST PART OF ALL
Im not even sure how its working. but it is
Ive used redis and Supabase for the cache and database respiectively
Redis is mostlyto recude dependence on yfinance so taht i can reduce requiests, prevent rate limiting
And uptime robot is for monitoring and keeping the webstie up.
Thats about it. Thanks for the read
Hours: 10
I made everythine from the head to the news get real data from yfinance.
Oh and also, one of my friends told me about Trading View so i scrapped my own chanrt and used their library to make an actual candlestick stock chart
The following:
- About page
- Key statistics
- Financials
- News
- Order history
- Holding Position
Have been grabbed from backend ( YFin and DB models ) to display data in real time
This is the only part of the page that is not using actual data, its still simulated and yotu cant really buy stuff rn. but soon itll work
Once again, the biggest problem here was spelling mismatch between the wesite API and component names and classes and id’s
( We all know how amazing i am at typing)
Hours: 17
This is has been a grinddd. So many errors and aaaaaaa 😭😭😭
But the entire stock page with all of its components is currently complete.
The entire page uses fake data inside the MockData.jsFile :)
Next i gotta just create the real api endpoints and feed it to the frontend
The url for the stock is in the format:
<main-url>/stock/<stock_name>
Eg. ( Localhost ) http://127.0.0.1:8000/stock/AAPL/
Here is the place where the name and stock exchange is listed.
Watchlist button is also present here
Price, Gain and loss and time is also mentioned
A detailed chart with historical data of the stock witht timelines ranging from 1D to Max
Simply, an about page with details of Stock
Displays:
IDK how but this will probabaly be hardest to link to real data as ill have to change models too :(
Displays revenue and net income for As bar charts per quarter
Its the news duh
Might remove this if i cant link to real data
Only of said stock.
Straight from dataabse
Literally, just a place to buy and sell your stocks that you own.
It has its own frontend way of checking if you can afford a stock or not
Page to display what the user owns of the stock
Has other details like Investment and value
Shows some more stocks to explore
( currently jst like the ones available in the fake data )
AI played a good role here. Helped me debug sooooo many errors and helped in writing certain jss animations and css blocks.
All HTML and most CSS and Js was written by me ( Evident by the 17h worktime 🤣)
Use real data.
Test runs
Connect stock page to main page
Debug
(Hopefully thats all)
Hours: 9
Pages that now have live data:
- Landing page ( Markets page and moving section )
- Watchlist part
- Trending stocks ( With sparklines )
- Floating stock cards
All compoenents come together inside a stock page that will be displayed
This page is stil under development.
I am planning to only use fake data for now, the i will slowly progress to real data from API and database
There is very little js that i have written for this part till now, but there are more files planed
Its best to store all data from apis specially if multiple pages need to visit it, cause well then it doesnt reach limit.
Revised JS and how to put together animations
Again, I already listed everything I learnt and did in the bug fixes :)
Thats about it !! Thanks for the read
This is an extension of the previous devlog, at in all it was too long to fit inside one 😭😭😂😅
Buy tag inside the transactions section was very uncooperativeAPI selection. Oh man! Theres so many parameters to check for and so many pros and cons and ups and downs.
Capitalisation, i mean i knew it was important, but still. Spellings and capitalisation gave me a headache 😭😭😭
~ [ I really gotta improve my typing accuracy]
Data sttructuring designs matter a lot more than i thought. When creating the dashboard, all i thought was, what all do i want. BUt then i realised alter, that its more about what all will the backend send and i should have structured it accoring to that; It would also have saved me some time
Even tho i did plan everything well this time, i did slip out at a few places; like the 0 Change error in my main section is caused due to the way i made my backend
There is a lot more, but most of it has been covered in the problems sections, which obviously meant learning about everything that meant wrong, so im not going to repeat it all here
First, obiviously, just fix all the bugs in the Updated version
once thats done, i plan to create a way for users to actually quote and buy stocks.
I also want to create detailed amalysis pages for stocks dynamically, if possible ( I really hope i dont have to change APIs again 😭)
Thanks for the read !!
Hours: 10
The list includes:
- User data pulled form database instead of fake values
- Live market overview
- Daily gainers and losers with live data
- Sparklines and growth charts for all stocks
- Watchlist dynamically rendered from user’s database
- Transactions rendered from database
- Portfolio progression chart created from users previous net worths
These changes were meant to be distributed among two journals. But due to my absolutely amazing memory i forgot and created all these functions
Hence this devlong is gonna be a long one
dashboard_api function in views.py to dynamically fetch user dataS&P500, NASDAQ and Dow Jones ETFs.markets.py file inside servicesInitially, I thought of using finnhub as the provider due to its generous free tier and live data.
Next, i consider Alpha Vantage as my data provider. This idea was quickly scrapped due to its sparing free tier of 25 requests/day which would be exhausted in mere minutes
So finally, i went with a mix of Finnhub and YFinance, and i thought it was the best combination. However, again, it lagged, it would not render properly. And besider, apart from the 15 mins delay, which, lets face it, is not game changing for a simulator, YFinance offered everything i needed, and also it had good documentation i could refer to
My final data feed comes from YFinance and yahooquery, which I am quite proud of
Spellings mismatch with exact wording of the data the stock returned
Issues with perfectly parsing it in the exact format required by JavaScript [What can i say, my typing is just that good]
It was so bad that i did not even push my changes to github for this part
YFinance for me somehow made this quite simpler and i was able to get it running.
Thankfully, no errors presently
Hours: 4.5
Create Django Models for backend foundation of TradeSims and connect the Login and Register pages to the backend database.
GET and POST methodsLogin required decoratorsauthenticate
Hours: 3
Create and render the frontend part of login and register pages for website
Writing HTML code and creating a form to input the First Name, last name, user ID, email ID, and password.
After initial creation of HTML pages, it was broken into functional components to make code more readable andstructured
The HTML forms and components were created by me, with specific styling desicions inspired by Claude.
The Specific CSS and JavaScript used to stylise the webpage, and to check for password strength, and email validity was implimented by claude.
All AI generated code was cross checked and modified by me to fit the project’s coding style
Created multiple components for homepage(such as hero, markets etc.) , used CSS and JS to beautifully style landing page. Compiled all components into final home.html file to successfully run my django app for the first time
Completed initial layout with a navbar, and template indexing, ready to use as a base for all webfiles. Also added a new django software
Initial layout and template html file