azuresky7@gmail.com's avatar

Model Domain Architecture (MDA)

Hey everyone I created MDA to solve a real problem in my company: developers organizing code differently across projects (some used repositories, others put everything in controllers, some tried DDD halfway...).

What is MDA?

An opinionated starter kit that organizes Laravel projects around models, with clear separation:

Actions, Finders, Queries, Repositories by model

Predictable flow: Controller → Service → (Finder/Query/Action)

Flexible, not dogmatic - adapt it to your needs

What it's NOT: Full DDD or "the right way" - just a practical guide for team consistency. Why share this? I know there's much I still need to learn. I'd love your feedback:

What problems do you see? What would you improve? How have you solved similar issues?

Docs: zangles.github.io/MDA/README.en

Thanks for your time!

2 likes
9 replies
vincent15000's avatar

I'm not sure that a simple starter kit can really change the behaviors of dev teams.

What you are describing let me think about the DevOps culture as a solution to your problem.

azuresky7@gmail.com's avatar

Great point! MDA definitely won't magically fix team behavior—no architecture can. But I think there's value in making the "correct" path the easiest one. It's like putting healthy snacks at eye level in the fridge: it won't force anyone to eat better, but it removes one barrier. DevOps culture is about collaboration and automation, which is essential. MDA addresses a different (but related) problem: "When I need to add a feature, where does the code live and how do I keep it maintainable?" Think of it as complementary: DevOps helps you deploy cleanly, MDA helps you organize what you're deploying.

1 like
king-bcolor's avatar

A good approach. Some have tried DDD but only halfway through, which is correctly pointed out. However, is it still too complex? Would it be faster if we only used the Repository pattern and DTOs, rejecting the encapsulation of complex queries and replacing them with multiple simple queries, using them as needed to avoid an explosion of query objects? But a more pressing concern is how to elegantly apply this in Filament. The Repository pattern and DTOs are definitely suitable for splitting a task between two AI agents, allowing both agents to operate without concerning themselves with each other's specific behaviors.

1 like
azuresky7@gmail.com's avatar

Thanks for the feedback!

On "Repository + DTOs only": That works for small projects, but as you scale you'll face:

Where do complex reports go? (not CRUD) How to avoid 50-method repositories? How to prevent query duplication?

MDA's Finder/Query/Action separation solves this before it becomes a problem. On Filament: I haven't used Filament myself, so I can't speak from experience on integration patterns.

PS: Documentation was recently updated with more examples and Use Case patterns—worth checking out!

1 like
DigitalArtisan's avatar

I created MDA to solve a real problem No you didn't. The Object Management Group® Standards Development Organization (OMG® SDO) did.

OMG members voted to establish the MDA (Model Driven Architecture) as the base architecture for our organization's standards in late 2001.

You just happened to implement a Laravel version of MDA, that's all.

2 likes
Andrewrafat's avatar

Hey everyone 👋

I’ve been working on a developer-first chat package for Laravel, focused on API-only usage (no UI, no assumptions).

The goal is to let developers plug a full chat system into:

mobile apps

SaaS dashboards

SPAs without fighting opinionated UI layers.

Key features so far:

One-to-one & group conversations

Role-based participants (admin / member)

Invite & leave flows

Read receipts

Starred messages

Attachments (multipart uploads)

Realtime events (optional – works with Pusher, WebSockets, or disabled entirely)

Everything is built using Laravel events & broadcasting, so you can choose your realtime driver — or skip realtime completely.

I’d really appreciate feedback:

What’s missing?

Would you use this in production?

Any API design improvements you’d suggest?

Thanks 🙏

martinbean's avatar

I’d really appreciate feedback

@andrewrafat Cool. Here’s some feedback: don’t hijack someone else’s thread to spam about your project as your very first post in a forum.

Please or to participate in this conversation.