In general I have found — over 20 years of experience architecting software - the following:
1. Platforms and reusable frameworks should be architected as well as possible. Apps can be whatever.
2. A developer who writes clean code and documents it is far better than a “10x” developer, unless you have budget for only one developer.
3. Functions should have extensibility, put the required parameters as parameters and always include an “options” at the end. Each function can have defaults that you can extend, which means you need a deep-extend method:
https://qbix.com/platform/guide/javascript#functions
4. When in doubt whether to do convention A or B, take a bit more time to do C which can handle both, and add the convention in a config. You never know when someone may need something else!
5. Similar to 4, if you can have an extra indirection, add it. So you can let others hook into “before” and “after” hooks at any point. Use events instead of functions.
6. In fact try to have event driven architecture rather than futzing around with mutating data. The easiest way to sync is to maintain a linear total order for events.
7. Think about how lookups will proceed and partition everything by those keys. Sometimes you need to have duplicate tables and keep a sync from a “primary” table to a “secodary” one in the app layer. Doing this allows you to do sharding or even go serverless peer-to-peer later!
8. Security: more checks are better than less. Pile on private keys, bearer tokens (api or cookie), and so on. Use a device keychain:
https://qbix.com/blog/2018/01/17/modern-security-practices-f...