Vertical Slice Architecture For .NET 7 + React.JS

We all like nice architecture 🏛️ , but what is nice and functional in software architecture and development? Do we enjoy jumping back and forth between directories that represent horizontal layers like the Domain, UI, Repository, Frontend vs Backend in order to develop a feature and release it?

I imagine not if you’re like me, and maybe like me you will enjoy Vertical Slice Architecture 🍕. Basically the idea is to group code into directories by feature first. This should increase code cohesion and let developers focus on developing features and ship them instead of keeping a rigid structure and architecture intact.

I’ve created a free open source .NET 7 project template for fullstack development with React.js ⚛️ that adops this architecture and have the following characteristics:

  • See all code related to the feature you are working without bothering with unrelated code.

  • Keep all your unit tests together with code that’s being tested. Tests are removed from compilation in Release-mode.

  • Choose the sub-architecture you like for a specific feature without applying it uniformly to all features.

  • Easy to Copy and Paste feature from one app to another app or microservice.

Reduce cognitive load and become more focused and productive.

Checkout the code and documentation on on github:
github.com/kavhad/dotnet-react-vertical-slice

Here’s a youtube about the architecture, by Derek Comartin:
youtube.com/watch?v=L2Wnq0ChAIA&t=3s

Previous
Previous

The case for a consulting developer

Next
Next

Reviewing .NET 7