Week (5) - Finishing the version 2 APIs

iifawzi_
Published: 07/11/2021

Hi everyone!
In this week, I've worked on implementing the logic behind the version 2 APIs, we were having 6 APIs that were responsible for downloading png, svg or font icons, and it was only support customizing either the svg or the png, but not the font. Version 2 APIs is doing the same functionalities but with only 3 API, also I've added the possibility of generate a font for customized icons (flipping, rotation), and the ability of retrieving Bae64 string. by the end of this week, we've ended all the business functionalities, no additional features will be added, we will only work on improvements and making the process to the current apis much easier, by introducing caching and other features.

Updating icons process

The updating icons process were the hardest part in the previous two weeks, I will explain in short, how I implemented it. We depended on the Gitlab hooks to notify our backend if any new release is released, then the API will trigger the process of updating the icon and respond to the gitlab immediately. The updating process will start with updating the local <stron>eos-icons dependency to use it for fetching the latest icons by comparing the date stored in the icon object (retrieved from the json file as mentioned in the previous blog), and then compared to the date of the last update which's stored in the db, Then after preparing the objects with the corresponding svg codes, we add it to the database, The new icons are bulk inserted in the db, and the updated icons are first prepared using a factory function that creates the appropriate schema to be used against MongoDB, and each icon is stored separately, unfortunately, there's no better solution. We might discover one later.

What's next?

Next weeks, I will be working on implementing the searching API using Algolia, implementing the cache layer using Redis, and adding the APIs that will be responsible for suggesting the icons.</stron>
DJDT

Versions

Time

Settings from gsoc.settings

Headers

Request

SQL queries from 1 connection

Static files (2312 found, 3 used)

Templates (11 rendered)

Cache calls from 1 backend

Signals

Log messages