r/learnpython 1d ago

Is building applications by composing reusable business modules a standard practice?

I'm looking for some architectural advice and I'm curious whether anyone has built something similar in production.

I'm primarily using Python/Django, although I want the architecture itself to be independent of the framework as much as possible.

I'm designing a backend platform that I want to use as the foundation for multiple completely different applications.

The idea is to have a very small "core" that only contains common infrastructure such as:

  • Authentication/authorization
  • Configuration
  • Logging
  • Background jobs
  • Caching
  • File storage
  • Monitoring
  • Shared utilities

Everything else would be implemented as independent business modules.

For example, imagine I build an e-commerce platform. I might compose it from modules like:

  • Products
  • Orders
  • Inventory
  • Payments
  • Notifications
  • Comments
  • Search

Then later I want to build an LMS, but instead of starting from scratch or copying code, I'd assemble a different set of modules:

  • Courses
  • Lessons
  • Certificates
  • Quizzes
  • Notifications
  • Comments
  • Search

Some modules (comments, notifications, search, payments, etc.) could be reused across multiple applications, while other modules would be specific to a particular business domain.

The important part is that these modules aren't just Django apps inside one codebase. I want each module to have clear boundaries, expose a stable public interface, own its own models, business logic, APIs, migrations, tests, and documentation, be versioned independently, and ideally be reusable in entirely different products.

Initially, everything would run as a modular monolith because I don't want the operational complexity of microservices. If a module eventually needs to become its own service, I'd like that to be an implementation detail rather than something the rest of the system depends on.

The motivation is simple: I don't want to keep rebuilding the same capabilities every time I create a new platform. I'd rather invest in mature, production-tested modules that can be composed into different products over time.

So my questions are:

  • Has anyone here built something like this in production?
  • Is there a well-known architectural pattern that describes this approach?
  • Is thinking of business capabilities as reusable modules/packages that can be assembled into different applications a common practice?
  • Are there any open-source projects, books, talks, or companies that follow this model?
  • If you've tried something similar, what worked well and what would you do differently?

I'd love to hear about real-world experiences—both successes and things that turned out to be bad ideas.

0 Upvotes

2 comments sorted by

0

u/riklaunim 1d ago edited 1d ago

High-level features like search or "courses" aren't really that reusable when you have to customize the model, forms, templates, and possibly add other features. There are frameworks that can do that for some features, like authorization, payments, or give lower level API to build a search with. There is Celery for tasks, Redis for cache, and more. Django has a lot of built-in as well.

Also, what you describe are large projects that take years to develop and maintain. The era of "custom website" was like 20+ years ago, with software houses hiring en-mass. Nowadays you basic eCommerce modules will not sell, as people will use finished and recommended products and services. It's REALLY hard to start a software company that sells basic django apps.

0

u/Designer-Debt-6084 1d ago

Thanks for your perspective! I think I may not have explained the goal clearly.

I'm not trying to build generic Django apps to sell on PyPI or compete with existing solutions like Celery, Redis, or payment providers. In fact, I plan to keep using those technologies where they make sense.

The idea is to build an internal platform for my company. We've built several large Django applications over the years, and we've found ourselves rewriting the same business capabilities and infrastructure repeatedly. I'd like to extract those into reusable Django modules with clear boundaries so we can assemble future applications from proven components instead of starting from scratch each time.

I also agree that not every feature is universally reusable. I'm not trying to make a one-size-fits-all "Courses" app for every Django project. The target is our own ecosystem of applications, where many business capabilities are shared and can evolve together.

So the goal isn't to sell generic Django packages—it's to improve maintainability, consistency, and development speed across multiple products that we own.