Large App or Multiple Apps with Dependencies

Hi Rick,

My situation is very similar to yours (at least when it comes to my main Anvil project :blush:). I’m in the process of refactoring a large monolithic Anvil app into a main app with a number of sub apps brought in as dependencies. For me, this approach to separation of concerns by “app decomposition” works well – and greatly increases my ability to reuse code for other projects.

I pursue a structure something like this:

Main client-side app

Server-side app (with client-side Python modules that call server functions, therefore also a dependency. This allows for caching and keeps things clean).

App for custom components (dependency)

App for feature 1 (dependency)

App for feature 2 (dependency)

App for styling (no Python code, but with css-files brought into the other apps via Native Libraries)

App for db (a no-code app, only showing the db – shared with the other apps)

The “app for db” is really just to be able to have data tables open on a separate screen, so that I can see what’s going on in the db during testing (remember to refresh, e.g. by switch to another table and back to see any change between runs). In general, I find it easier to navigate my project when I can have each sub app open in a separate browser tab (or sometimes in VS Code, if only Python code).

On a personal level, I also find it easier to execute plans when it’s about “nailing one app at a time” rather than a seemingly less specific corner of a large app (although it technically should not make a difference).

All the best,

Rufus.

2 Likes