monetr / rest-api Goto Github PK
View Code? Open in Web Editor NEWREST API powering our budgeting application.
Home Page: https://docs.monetr.dev
License: Other
REST API powering our budgeting application.
Home Page: https://docs.monetr.dev
License: Other
TODO
comment in 531fcac. It's been assigned to @elliotcourant because they committed the code.TODO
comment in 8022c8d. It's been assigned to @elliotcourant because they committed the code.We should try to run the entire application stack in minikube. Then we can run an ngrok container in minikube and do something with this: https://ngrok.com/docs#non-local
Then we can have ngrok forward something like rest-api.default.svc.cluster.local:4000
.
This should also be tucked behind a build flag maybe? Where the rest-api automatically reaches out to ngrok running in kube like ngrok.default.svc.cluster.local:4040
and requests the public ngrok domain https://ngrok.com/docs#client-api-base
TODO
comment in 029bf7a. It's been assigned to @elliotcourant because they committed the code.TODO
comment in 029bf7a. It's been assigned to @elliotcourant because they committed the code.TODO
comment in 531fcac. It's been assigned to @elliotcourant because they committed the code.We need to be able to send users emails when they sign up or when they forget their password.
TODO
comment in 0079467. It's been assigned to @elliotcourant because they committed the code.Long term the REST API should use two different connections to the database. When any write might be performed during a request or an action; then the primary database connection needs to be used. When only reads will be performed during a request or action, either a replica or the primary connection can be used. To simplify logic it might be best to always use a replica for reads.
This has the potential to cause some issues with stale reads. When completely deployed the database the REST API will be using will be using asynchronous replication. So if something like an expense were created and then the user tried to see that expense in a different browser or device shortly after, its possible that the user won't see it. I do not have any numbers at the time of writing this for what to expect for replication lag with PostgreSQL. But at the time of writing this I feel that even a replication lag of a few seconds is acceptable (even if it's not ideal). This is because any action that can be taken by the API that would modify any data; will always be served by the primary. Which will always have the most up-to-date data.
I plan on using pgo to deploy a high-availability PostgreSQL cluster to Kubernetes for the REST API. go-pg (the ORM used by the REST API) already has some basic connection pooling built into it. So I'm not sure how much the API might benefit from something like pgbouncer. pgpool is another alternative that is aware of primary and replica nodes.
TODO
comment in f190dbe. It's been assigned to @elliotcourant because they committed the code.TODO
comment in 95992eb. It's been assigned to @elliotcourant because they committed the code.https://stripe.com/docs/api/products
https://stripe.com/docs/api/plans
https://stripe.com/docs/api/plans/create
Look into using this terraform provider to make managing the stripe resources and objects easier?
https://github.com/franckverrot/terraform-provider-stripe/tree/v1.8.0
amount
; Integer in cents for how much to charge for the particular plan. (Will be 300
/$3.00
or 100
/$1.00
)currency
; USDinterval
; Will be month
initially, will have other options later.WIP
TODO
comment in 531fcac. It's been assigned to @elliotcourant because they committed the code.TODO
comment in 61ade51. It's been assigned to @elliotcourant because they committed the code.For better readability, always place default
of switch as first or last case.
There is 1 occurrence of this issue in the repository.
See all occurrences on DeepSource โ deepsource.io/gh/HarderThanItNeedsToBe/rest-api/issue/SCC-ST1015/occurrences/
TODO
comment in 83f3074. It's been assigned to @elliotcourant because they committed the code.Add an API endpoint /bank_accounts/{bankAccountId:uint64}/spending/{spendingId:uint64}/transactions
that will return the last few transactions that were spent from the specified spending.
TODO
comment in db96eda. It's been assigned to @elliotcourant because they committed the code.TODO
comment in 029bf7a. It's been assigned to @elliotcourant because they committed the code.https://plaid.com/docs/api/webhooks/#transaction-webhooks
These need to be implemented in order for the application to be aware of transactions that have been moved from a pending state to a complete state. As I understand it, a pending transaction is deleted and a new transaction is created with the same data but without the pending state.
LATER: Historical update: When we initially link with plaid we should wait for this webhook before performing our initial transaction pull.
TODO
comment in 67104b7. It's been assigned to @elliotcourant because they committed the code.TODO
comment in 0079467. It's been assigned to @elliotcourant because they committed the code.TODO
comment in 203280e. It's been assigned to @elliotcourant because they committed the code.Goals are similar to expenses but are not recurring. They only fund until they reach their target, at which point they are complete.
Fields:
These should largely function the same way expenses do, but do not reset once the target is reached.
I do not think that the application we be able to scale very far beyond maybe a few hundred users with the gocraft/work library and a single redis instance.
RabbitMQ has the potential to scale much further. This isn't set in stone, this is meant to be a research ticket later on.
TODO
comment in 67104b7. It's been assigned to @elliotcourant because they committed the code.TODO
comment in 029bf7a. It's been assigned to @elliotcourant because they committed the code.TODO
comment in 7b24456. It's been assigned to @elliotcourant because they committed the code.Bank accounts (at the time of writing this) can't be changed once they are created.
Bank accounts should be able to be modified with a PUT request to /bank_accounts/{bankAccountId}
.
If the bank account belongs to a Plaid link then only the following fields can be modified:
If a bank account belongs to a manual link all the fields above and these fields can be modified:
The user can never modify the following fields:
TODO
comment in d128369. It's been assigned to @elliotcourant because they committed the code.TODO
comment in 203280e. It's been assigned to @elliotcourant because they committed the code.TODO
comment in 0079467. It's been assigned to @elliotcourant because they committed the code.Transactions should be able to be modified with a PUT request to /bank_accounts/{bankAccountId}/transactions/{transactionId}
.
If a transaction is from a manual link, then the following fields can be modified along with all the fields from the plaid version.
If a transaction was not created with a manual link, and was imported via Plaid then only the following fields can be modified:
A transaction cannot change its bank account.
Behaviors for expenses:
TODO
comment in 0079467. It's been assigned to @elliotcourant because they committed the code.Use the following API to create a stripe customer when a new user registers for the application.
https://stripe.com/docs/api/customers/create
There don't seem to be any required parameters with this API, but we would want to include the user's name at the very least. We would also want to include their user Id in the metadata.
The customer Id would be then stored on a billing table, this table would reference both the user and the account object's in the application. If the user is deleted then the record in the table should be deleted as well.
TODO
comment in 029bf7a. It's been assigned to @elliotcourant because they committed the code.When a transaction is spent from an expense we need to keep track of how much was spent. For example; If a transaction is $10 and is spent from an expense that only has $5 allocated, then we cannot spend all $10 from it. We should thus keep track in a separate object, or as an additional field on the transaction itself for expenseAmount
. This way if the expense a transaction is spent from changes we can easily revert the amount on an expense.
This solves an issue relating to #46
We should cache this account on the request context so that way its available for other accessors during a request. As the API matures more and more it will become less likely that we will only need to access the account object once for any given request.
TODO
comment in 61ade51. It's been assigned to @elliotcourant because they committed the code.TODO
comment in 0079467. It's been assigned to @elliotcourant because they committed the code.The Login API endpoint should require a captcha key when captcha is enabled.
TODO
comment in 60381ed. It's been assigned to @elliotcourant because they committed the code.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.