The Twelve-factor App

🏭 A methodology for building modern, scalable SaaS applications

The Twelve-Factor App methodology is a set of best practices for building software-as-a-service (SaaS) applications that are scalable, maintainable, and portable.

Overview

The methodology was created by developers at Heroku based on their experience developing and deploying hundreds of applications. It’s designed to:

The Twelve Factors

1. Codebase

https://12factor.net/codebase

One codebase tracked in revision control, many deploys

Each application should have a single codebase that’s tracked in a version control system like Git. Multiple deployments (staging, production) can be derived from this single codebase.

Example: A single GitHub repository containing all application code, with different deployment environments configured through environment variables.

2. Dependencies

https://12factor.net/dependencies

Explicitly declare and isolate dependencies

All dependencies must be declared explicitly using a dependency declaration manifest. The application should never rely on implicit system-wide packages.

{  "name": "my-app",  "version": "1.0.0",  "dependencies": {    "express": "4.17.1",    "mongodb": "3.6.3"  }}

3. Config