Code organization patterns in Convex
1. Convex seems to force all code into two buckets: internal, and api (public and private).
2. Convex furthur devides all code into actions, and then all the rest (mutations, queries).
3. All files in the root of the convex folder seem to represent a resource, or a domain, and thus become the tip of the spear for the entire application.
Given the above, I've found it rather challenging to organize the codebase. Convex seems to want a CQRS style, which makes sense given the separation of queries and mutations. That much is nice, when everything lives in convex land with pure mutations and queries, the code really looks good.
Where it gets challenging is with actions and the nodejs runtime.
Has anyone else wrestled with this? Any example codebases or tips for better organizing actions? Often times, things are foced into actions merely because they need the nodejs runtime, or they are calling an external service. Because of this they need to be in a separate file, even if the code is highly coupled or related to mutations and queries.
Overall it creates a bit of spaghetti where code bounces around between files, calling mutations, actions, mutations, queries, actions, etc.
Perhaps I am just inexperienced with this database-first reactive style of programming. I welcome any tips!
