The database is now used to cache the data, so the API is not reached every time. The default expiry is 3 minutes, so new data will be fetched from the API after that.
The database is now used to cache the data, so the API is not reached every time. The default expiry is 3 minutes, so new data will be fetched from the API after that.
I made several improvements to the database, it now stores all the data including accounts, balances, and transactions, and pending transactions are shown & updated. When data is fetched from the API, the database is automatically updated. Authentication is improved by automatically refreshing the token after its expiry time. I made a lot of progress this devlog but it’s all backend stuff, so there’s not much to show, but here are the new tables in the DB:
I added a PostgreSQL database! The code I wrote can create a transactions table, add transactions from the API to the table, and fetch them from the database again.
I made a lot of behind-the-scenes changes, including separating the API, auth, and interface into different files, adding token renewal support (so you only need to log in once every 90 days) and added some dataclasses so the data from the API is in a standard form across the whole app. The video shows that if the API token is not valid, it can generate a new one with the refresh token.
I made a basic terminal interface for viewing bank account information, using the TrueLayer API. I used their mock bank account credentials to test my program!