Every project starts the same: two weeks debating folder structure, wiring up middleware, configuring tests. I've done it enough times to extract the pattern. These are the project templates I wish existed when I started my last three backends.
Node.js · Go · .NET — same architecture, three languages.
I've seen this movie a hundred times. Sprint 1: debating Clean Architecture vs Hexagonal. Sprint 2: wiring up middleware, error handling, and logging. Sprint 3: figuring out test infrastructure. Sprint 4: finally writing business logic — on top of a foundation nobody's confident about. Or the other version: skip the foundation, write features fast, and spend month 4 untangling spaghetti while your PM asks why velocity dropped.
src/
controllers/
UserController
OrderController
ProductController
services/
UserService
OrderService
ProductService
repositories/
UserRepository
OrderRepository
ProductRepository
// Change one feature?
// Touch 4 folders and 12 files. src/
features/
create-user/
handler
validator
events
tests
place-order/
handler
validator
events
tests
// Change one feature?
// One folder. Done. Same architecture, three languages. It's interesting to see how Vertical Slice translates across ecosystems — where Go's explicitness shines, where .NET's type system catches things TypeScript can't, and where Node.js just gets out of the way. Useful for polyglot teams or engineers who think across stacks.
One feature = one folder. Handler, validator, events, tests — everything together. Want to change the payment flow? Open one folder. Don't touch anything else. This is the single best architectural decision I've made in 25 years.
"When a user is created, send a welcome email." In most codebases, you'd shove that into the user handler. Here, you add a subscriber. The user feature doesn't know and doesn't care. Decoupling that actually works.
Clean data access abstracted behind interfaces. Swap Postgres for MongoDB without touching business logic. Tests run against in-memory implementations.
Auth, validation, error handling, structured logging — already plugged in. Every request goes through the same pipeline. No more "I forgot to add error handling to the new endpoint."
Tests live next to the code they test. Radical concept, I know. Unit tests for logic, integration tests for the full slice. Open the feature folder, everything's there — including what proves it works.
User registration and order creation — fully working, fully tested. Not empty folders with a README. Real code that hits the database, publishes events, and validates input. Read it, then replicate the pattern for your own features.
Every feature is a self-contained folder. No hunting across layers.
The foundation's already laid. The patterns are proven. The tests pass. Open the project, read the example features, and start building yours.