AZ
All writing
1 min read

The reference architecture I clone across every commerce app

nextjsarchitecturemongodbredispatterns
Part of the projectManagerentaA property/rental management app — and the reference architecture the other commerce apps are cloned from.View project

Managerenta is a property/rental management app. It is also, quietly, the most reused thing I've built — because its layering became the template every other commerce app inherits.

The triad

The pattern is a Model → Service → Route triad:

  • Models are the data layer only — schema and persistence, no business logic and no HTTP.
  • Services hold the business logic and access control.
  • Route handlers stay thin: parse, call a service, serialize.

It sounds obvious written down. The value is in holding the line: models never reach for a request, routes never reach for the database, and business rules have exactly one home.

Why "reference" is the real feature

Once this was solid — deployed with Docker and AWS Amplify/CodeBuild, tested with Playwright, and reviewed in a SECURITY_REVIEW.md rather than by vibes — it became cheaper to start the next app by cloning the pattern than by improvising. Golden Bite, Chekka, and Mogadget all carry this shape. A lesson learned in any one of them flows back to the reference, so the whole family improves together.

The payoff

Getting the skeleton right once and reusing it is boring in the best way: new products spend their novelty budget on the actual problem, not on re-litigating how a request becomes a database write.

Back to the projectManagerentaSee the full case study and related write-ups.View project