-
Notifications
You must be signed in to change notification settings - Fork 3
Description
I got this project stood up in a local dev environment mostly for nostalgia, but I'm curious about maybe redirecting the project to maybe be a fully client side application There's s couple of things that I'd have to figure out first,
Pricing
Obviously we won't have access to a Redis price cache like before (also, RIP EMDR). So we'll have to figure out a way for the client to fetch and store pricing data.
I'm thinking about using localStorage for caching it, which should be quick to access once it has it. The trick would be to get it. There's a few market websites that we can access via API, but something to consider: the largest store has 490 unique type IDs used for calculations (not including blueprint requirements which are calculated separately). That means upon loading the page, we would have to fetch price data for 490 types. Most market APIs works via GETs and querystrings, which limits the URL length. So we'd either have to chunk it, or find an API which allows POST.
There's also EVE ESI, but that would require 1 API call per type.
Test
Would need to test performance of localStorage before going this route. I'm pretty sure it's fast, but when doing 490 fetch requests - even something as quick as 15ms per call can cause noticeable delay.
Data
We don't have access to SQL in the client, so I'll have to figure out a way to deliver the data. One thing that I've always wanted to look into is IndexedDB. We can have the client fetch JSON files whenever there's an update and stuff it into IndexedDB. I'll need to do some research as to the best way to structure and access this data since I've never worked with it before (for example, should I have two data sets: LPStore and LPOffer, or one dataset which is the LPOffer with a corporationID attached to it (this would essentially duplicate records tho, but I don't know what's "proper" in the world of document / object storage)).
Test
Performance of IndexedDB. Evaluate way to only initialize / update database if there's new versions out there (so maybe we'll need a version number stored on the client or soemthing)
Jumps
Jump calculations are a relatively minor feature, but something that we don't have access to in the client. Fortunately, ESI provides an endpoint for this:
https://esi.evetech.net/ui/#/Routes/get_route_origin_destination