Deconstructing your application helps you to be able to better know how to manage its lifecycle. There are commonly four elements to an application:
Application Framework, i.e. Java, Node, etc.
The code running in the Application Framework
Zero environment specific definitions (environment agnostic)
The files describing how the Code runs, for a given environment.
Databases, Uploaded attachments, logs, state files, etc.