design a schema to store all the data we have here
setup a postgresql db according to the schema
create functions to allow all the code to easily interface with the database (would recommend using the knex library to build out SQL queries, and a Database class to make it easy later on for other functions to call it)
Mammoth job, basically what's needed is to;
All this is likely to take over an hour tbh