Is This Modular Monolith Architecture Good? or a Massive Future Mistake?

Posted by UnderWolf1@reddit | ExperiencedDevs | View on Reddit | 39 comments

I’m trying to avoid both:

So I ended up designing something that’s basically a feature-oriented modular monolith inside a monorepo.

Operationally it’s still:

But internally, everything is split into isolated full-stack feature modules/plugins like:

Each module owns its own:

Example:

<FileManagerProvider>
  <FileBrowser />
  <FileUploadDialog />
</FileManagerProvider>

Where:

So the frontend/backend are owned together as one vertical feature slice instead of everything becoming shared global state and shared service spaghetti.

The main app mostly just composes modules together:

const auth = createAuth(...)
const fileManager = createFileManager(...)
app.use('/auth', auth.router)
app.use('/files', fileManager.router)

Cross-module DB references are allowed because it’s still one DB/app.

Example:

foods.image_id REFERENCES files.id

But business behavior still stays inside the owning module.

So another module can reference files.id but file permissions still go through file-manager services.

A major goal of this architecture is feature reusability.

I want modules/plugins to be installable across multiple apps/projects with minimal coupling.

For example:

So instead of reusing only “dumb UI components”, the goal is reusing entire full-stack capabilities/features.

This feels cleaner/scalable to me than both:

But I’m wondering if this is one of those architectures that sounds elegant and later becomes painful.

Has anyone here built systems like this long-term?

Where does this architecture usually fail?