kart7990 / virtualpitwall

https://staging.virtualpitwall.com
Other
15 stars 7 forks source link

Car class details and first mocking version #27

Closed elft3r closed 5 months ago

elft3r commented 5 months ago

Hey @kart7990, I added a new component with single- and multi-class details. This helped me further learn the data structure even further.

While doing this, I also added a first version of mocking the API. It's not fancy for now and just reads the JSON files in the mock-data folder. However, I found this to be the easiest implementation to get going and iterate faster. Happy to hear your thoughts on this and how to improve it. You can use this by running npm run dev-mock.

One question that I have is regarding the car details in the standings. For the car class, the API returns the classId, className and classColor. However, for the car, it only returns the carName, and not the carId or carColor. Where do you get the information for the class from? Is this from the iRacing API or are you setting these in the backend? How can we best set this for the cars as well?

Best, Jochen

elft3r commented 5 months ago

FYI: Both of the class detail components are not yet very efficient. I will fix that in the next iteration of the component. I will then move the calculation to the state update mechanism so that it only gets updated when a new fastest lap time is set.