Core Concepts
There are four interrelated core concepts: App, Definition, Builder, and Runtime. The very high-level is your App uses a Builder to produce a Definition, which is then executed by the Runtime.
graph LR app(["App"]) app -->|"Uses"| builder(["Builder"]) builder -->|"Emits"| definition(["Definition"]) runtime(["Runtime"]) -->|"Executes"| definition
App: The App is your code. It’s the functionality that you wish to deliver. It’s the “Todo App” or the “Customer Relationship Management”.
Definition: At its core, the Alpyne Platform is described by a Definition. This definition includes how items are stored and accessed, what events your system has, and how external systems can access the platform.
Canonically the Definition is an object. This object contains all the structure and handlers for your App.
The Definition is described by the interfaces and code in @alpynejs/definition.
However, generally you will not interact directly with a definition. It’s produced by your own App, which uses a Builder. The Builder is a framework that helps you produce a definition. So if you have a “Todo App” it’ll call functions like addTemplate and addEvent to construct the structure and logic you need.
Most entities in the Definition are identified by a PRN (alPyne Resource Name).
Runtime: The Runtime actually executes the definition. It will run the Event Loop, recurring jobs, as well as respond to User interactions via an API such as REST.
Phases
Section titled “Phases”We often describe the App as “Design-Time” since it represents the phases when the App is described and the Definition is generated.
Equally, and unsurprisingly, when the App is running with real Data and Interactions is described as “Run-Time” (mirroring the Runtime).
The Definition spans both of these phases. Design-Time produces the Definition and the Run-Time executes it.
Broader Picture
Section titled “Broader Picture”Assets: Assets are produced by Generators. These are particular expressions of the definition; TypeScript definitions, Frontend interfaces, Documentation.
graph LR app(["App"]) assets(["Assets"]) builder(["Builder"]) definition(["Definition"]) generator(["Generator"]) runtime(["Runtime"]) app -->|"Uses"| builder builder -->|"Emits"| definition runtime -->|"Executes"| definition definition -->|"Drives"| generator generator -->|"Emits"| assets