Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large changes - updating pattern with a few new features #296

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jkoestner
Copy link
Contributor

To caveat - I'm not expecting this PR to be merged, but thought that it might help others if they were looking to do something similar.

I've been tinkering with the pattern template and really liked how it provided an initial framework with interacting with the tool. With that said it is a little outdated and worked through adding some additional functionality. The below lists describes the changes throughout the PR.

  • update packages for client and server (still could be updated - but there would need to be code rewritten)
  • add a transactions table (the transactions table does not include pending currently)
  • changed the overall method of using ngrok to using a reverse proxy
  • added a cron job that refreshes the transactions daily (for whatever reason the webhook wasn't working on all institutions)
  • added a label function that adds in a user defined field to the database

- update packages for client and server (still could be updated - but there would need to be code rewritten)
- add a transactions table (the transactions table does not include pending currently)
- changed the overall method of using ngrok to using a reverse proxy
- added a cron job that refreshes the transactions daily (for whatever reason the webhook wasn't working on all institutions)
- added a label function that adds in a user defined field to the database
@ToddKerpelman
Copy link

(Belated) Thanks for submitting this, @jkoestner ! I'm not sure if we'll merge this entire PR all at once, but I think at the very least, we can start adding these features one at a time where they make sense.

Comment on lines +52 to +55
// If user has entered a webhook in the .env file
if (PLAID_WEBHOOK_URL.indexOf('http') === 0) {
linkTokenParams.webhook = PLAID_WEBHOOK_URL;
}
Copy link
Collaborator

@phoenixy1 phoenixy1 Feb 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mentioned this to Todd over Slack, but it strikes me that if we want to support specifying a PLAID_WEBHOOK_URL we'd need to update .env.template to have instructions on doing this. I am a big fan of removing the ngrok dependency if possible, though, especially as ngrok just broke us again (this is at least the second time that a breaking change to ngrok has broken pattern).

@@ -63,6 +68,9 @@ const createOrUpdateTransactions = async transactions => {
unofficial_currency_code = EXCLUDED.unofficial_currency_code,
date = EXCLUDED.date,
pending = EXCLUDED.pending,
primary_category = EXCLUDED.primary_category,
detailed_category = EXCLUDED.detailed_category,
confidence_level = EXCLUDED.confidence_level,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

database/init/create.sql should also be updated accordingly:

CREATE TABLE transactions_table
(
<...>
        primary_category text,
	detailed_category text,
	confidence_level text,
<...>

@adidalal
Copy link

Thank you! Got this tentatively working locally (without ngrok and docker). It seems to work fine with Node 20.
Going to look at adding support for production ENV variables next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants