A Stocks and Shares application built in .NET with Blazor Server, using a SQLServer database and MudBlazor UI. Implements HTTPCLient to call 2 external APIs - a YahooFinance clone API for stock prices and a FX API to source the latest USD/GBP fx rate.
The final build will feature Authentication, where a user will be able to login and view their own portfolio. This is not yet implemented, so currently all users and their respective portfolio and trading activity is visible to all.
A user can be created with a linked portfolio. The user may then add and withdraw cash from their portfolio and trade stocks on the current stock list. The stock list is pulled from a Yahoo Finance clone API and, due to the limit on the free service for the API, I have limited the number of stocks to 50. The 50 stocks are a combination of top stocks in the Dow Jones and Nasdaq Indexes.
Each trade triggers the recalculation of current value and performance at both the individual holding level and also portfolio level, taking into account FX as the stocks are priced in USD and the portfolios are denominated in GBP.
The individual stock pages and the user portfolio pages will also include a chart tracking performance over a given period. This will likely require the use of JSinterop to make use of JavaScript chart libraries and will require an additioanl API call to request Time-series data on the stocks. The additional API call and respective data models have yet to be created as I am still currently working on the other features.
I have been exploring the .NET Framework and have looked at RazorPages, MVC and Blazor. I opted to build this app with Blazor as I wanted to work predominantly with C#. Blazor allows me to create the full application using C#, rather than writing the backend with C# and using a JavaScript frontend such as React.
I opted for Blazor Server over Blazor WebAssembly as I wanted to make use of Entity Framework and work directly with a Database for this project, rather than use a Hosted WebAssembly model.
I have so far learned much about Blazor and working in .NET within the Visual Studio IDE. In particular, I now have a better understanding of the use of Entity Framework in setting up, accessing and updating the Database. I have also learned the use of HTTPClient in .NET to call external APIs. I already knew how to do this in JavaScript, but now have an understanding of implementing it in C# and .NET.
Over the course on this project I am looking to add Athentication and also expect to make use of the JSinterop feature of Blazor to use JS libraries for the stock chart feature. I also expect to become more proficient with MudBlazor, as this is the first occasion I have used this C# component library and I am learning the use of its components as I go.
Technologies
C#
Blazor Server
Entity Framework
SQL Server
MudBlazor UI
Back