You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have read through the code to see how one could export an OpenApi schema as asked by #419, but what I've found is that there is a deeper issue going on in this repo.
That is, separating concerns in the app, having code whose purpose is handling the incoming HTTP route, code whose purpose it generating a response, and code whose purpose is accessing the database.
Currently, most of the endpoints have all this in a single function. Example:
but it does not seem to be a majority, as far as I could tell.
I'm not criticizing the work that has already been done, obviously there is a lot of work behind all of it, and it works!
However, going forward to be able to scale we would need to have some separation to make addition of routes, testing, adding an OpenAPI spec, much easier.
I would be glad to give a hand, I have dabbled a bit in JS, but my day job consist of being a backend developer in Python, so I know my way around a clean architecture, I'll just need to apply it to JS, similar to the secrets-service.js shown above.
What error did you receive?
No response
Where are you hosting Actual?
None
What browsers are you seeing the problem on?
No response
Operating System
None
The text was updated successfully, but these errors were encountered:
tcrasset
changed the title
[Feature Request]: apply separation of concerns to this repo
[Maintenance]: apply separation of concerns to this repo
Aug 15, 2024
Verified issue does not already exist?
What happened?
I have read through the code to see how one could export an OpenApi schema as asked by #419, but what I've found is that there is a deeper issue going on in this repo.
That is, separating concerns in the app, having code whose purpose is handling the incoming HTTP route, code whose purpose it generating a response, and code whose purpose is accessing the database.
Currently, most of the endpoints have all this in a single function. Example:
actual-server/src/app-sync.js
Line 24 in eec5fbb
There seem to be some files that are going in a positive direction, e.g.
https://github.com/actualbudget/actual-server/blob/master/src/services/secrets-service.js
but it does not seem to be a majority, as far as I could tell.
I'm not criticizing the work that has already been done, obviously there is a lot of work behind all of it, and it works!
However, going forward to be able to scale we would need to have some separation to make addition of routes, testing, adding an OpenAPI spec, much easier.
I would be glad to give a hand, I have dabbled a bit in JS, but my day job consist of being a backend developer in Python, so I know my way around a clean architecture, I'll just need to apply it to JS, similar to the secrets-service.js shown above.
What error did you receive?
No response
Where are you hosting Actual?
None
What browsers are you seeing the problem on?
No response
Operating System
None
The text was updated successfully, but these errors were encountered: