Skip to content

m-arrieta-r/backend-skeleton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Backend Skeleton / Vertical Slicing / Clean Architecture

License: MIT GitHub Activity GitHub stars

TL;DR

A flexible, production-ready Backend Skeleton designed for Node.js and TypeScript projects of all sizes. It implements Vertical Slicing and Clean Architecture by organizing code into specific Application Cases (app cases), promoting high maintainability and decoupled domain logic.

Explanation

This isn't a brand new architecture, but rather a clear way to visualize and implement "vertical slicing" in your codebase.

Examples

Motivation

Many existing folder conventions rely on traditional layered structures (package by layer), sometimes mistakenly labeled as "hexagonal" or "clean architecture." However, these architectures don't inherently dictate a horizontal (layered) approach.

Let's move away from big service files and horizontal folder structures!

Key Insights

"A layered architecture doesn't scream anything about business domain"
— Missing chapter, Clean architecture, Robert C Martin and Simon Brown

"As an application grows, each layer can get sufficiently complex on its own that you need to modularize further. When this happens it's usually not best to use presentation-domain-data as the higher level of modules. Often frameworks encourage you to have something like view-model-data as the top level namespaces; that's OK for smaller systems, but once any of these layers gets too big you should split your top level into domain oriented modules which are internally layered."
— Presentation Domain Data Layering, Martin Fowler

"The pattern has absolutely nothing to say about how you structure your application internally."
— Hexagonal Architecture, Alistair Cockburn

Compatibility

This structure has been successfully tested with:

  • Serverless architectures using Lambda handlers
  • NodeJs (ExpressJS, KoaJS, CLI)
  • Domain-Driven Design (DDD)
  • MVPs (without clean or hexagonal architecture)
  • NestJS (avoiding excessive service files)
  • Enterprise Projects (with clean architecture and DDD)

Inspiration

Guiding Principles

  • Prioritize Critical Thinking: Don't always rely on common sense; it might not be accurate.
  • Learn from Others: Many people (some of them popular) have likely encountered similar challenges. Follow their lead.
  • Discover Better Ways to Develop Software: Embracing experimentation is crucial for enhancing project success.

License

This project is licensed under the MIT License - see the LICENSE file for details.


MIT © 2026 m-arrieta-r

<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "SoftwareSourceCode", "name": "backend-skeleton", "description": "A flexible folder structure designed for projects of all sizes, based on organizing code by specific package by application cases.", "codeRepository": "https://github.com/miarrietar/backend-skeleton", "programmingLanguage": "TypeScript", "license": "https://github.com/miarrietar/backend-skeleton/blob/main/LICENSE.md", "author": { "@type": "Person", "name": "m-arrieta-r" }, "keywords": "backend, skeleton, architecture, vertical-slicing, ddd, clean-architecture, hexagonal-architecture, typescript, nodejs" } </script>

About

A practical, scalable folder structure designed for both Minimum Viable Products (MVPs) and large-scale enterprise projects. This structure emphasizes application cases, enhancing readability and maintainability.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors