Skip to content

System Architecture

BluePsyduck edited this page Feb 19, 2021 · 4 revisions

The FIB project uses several components to make providing the data possible. The following picture shows a rough overview about the system architecture operating in the background.

The image shows the following components:

  • Portal Frontend: The actual website the user will see and interact with. In fact, a normal user will never see anything else, as the Portal Frontend is the only frontend of the whole project. The Portal Frontend uses browser-based rendering, and only needs the server for receiving the actual data to display.

  • Portal API: This API is closely coupled to the Portal Frontend (thus called the Portal API), and provides the data exactly as the frontend needs it. It is also the only API which is attached to the frontend, so all requests from the web browser will go through this API. It uses a local database to store mostly session information to the users, like their settings and which pages they have viewed.

  • Data API: The main API of the FIB, having all the items and recipes. This API is the actual data source for the frontend, providing all the details to items, recipes, a search engine and so on. If external tools are interested in the data as well, then this API is the starting point. It of course has its own database to store all the data in. This database is by far the biggest one.

  • Combination API: The second API operates on the metadata of mods and combinations, thus called the Combination API. It mainly has two tasks: Provide information like a Combination ID to a list of mods with which the data from the main API can be accessed, and manage a queue of new combinations to be exported.

  • Export: This component is the only component not able to run on the webserver, because it needs the actual Factorio game. While it is labeled as "Game Server" in the image, picture it more like an old PC in some corner of a room, having Factorio installed. The Export is looking in the Combination API for new jobs, picks one, and processes it. Required mods will get pulled automatically from the Factorio Mod Portal, and an additional dump mod will write all the data to the log file, from where the Export can parse and prepare them. The data, including all the icons, is then uploaded through FTP to the webserver, and the job is updated in the Combination API.

  • Data API Import: The Data API import is the counterpart of the Export on the webserver. When the data is uploaded to the FTP space, the Import will read it and insert it into the API database. The API import is actually the only part writing to the API database (except for the search cache), the Data API itself is only reading from it.